From patchwork Fri Aug 16 11:43:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19231 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 566FB246AB for ; Fri, 16 Aug 2013 11:45:30 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf2127858vbg.2 for ; Fri, 16 Aug 2013 04:45:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=47RVvwbwXUCHHlm2DdWJE0cWOcHwnOcuJA+Vx+kosuk=; b=HCgTekEmnT2HgtmnLk0pMypwoEhuFyB7fL9wt1ikGInQshO+EUFB7s0lloPu8OlvpE MZhRqq+hKzwPiRsTLZmNozu24dFaBUHyVf4gK2NZzdHNwLjxkuHC/qbgV27TDR6kAuhV 9ZcRJmbw84++DY77WBD/cdI9LYRk0P507b5tNEhnbKVolQPVY0nw0Y9ags+X4RwO2e14 pMBjGNBm4r5k7cFsrb3olaVzMdYDWP5nUsviorHXhF1BHus3L6TCvPFOB4p7PNQdCPsv 7ECfeC2QBT3S5HcUUwDXZlEhajk0qaCEv6EG41bywDuAkYKTafkGpet0Ce2aLHZQHHL4 EKiQ== X-Received: by 10.236.115.198 with SMTP id e46mr408026yhh.33.1376653530090; Fri, 16 Aug 2013 04:45:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.1.38 with SMTP id 6ls719168qej.92.gmail; Fri, 16 Aug 2013 04:45:30 -0700 (PDT) X-Received: by 10.52.69.142 with SMTP id e14mr146280vdu.29.1376653529965; Fri, 16 Aug 2013 04:45:29 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id ya5si228664vec.19.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so1346551vcb.35 for ; Fri, 16 Aug 2013 04:45:29 -0700 (PDT) X-Gm-Message-State: ALoCoQmSlaWx0MLRJQVAsICCgvFv7yWJp3V8W44DSYOSMz0mdixR7AF/6TFJG7K3J/8M553H7aKk X-Received: by 10.58.76.130 with SMTP id k2mr183012vew.24.1376653529891; Fri, 16 Aug 2013 04:45:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp64165vcz; Fri, 16 Aug 2013 04:45:29 -0700 (PDT) X-Received: by 10.66.254.194 with SMTP id ak2mr1520191pad.167.1376653529072; Fri, 16 Aug 2013 04:45:29 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id iy4si858465pbb.185.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kl13so1788432pab.34 for ; Fri, 16 Aug 2013 04:45:28 -0700 (PDT) X-Received: by 10.68.190.197 with SMTP id gs5mr1162810pbc.90.1376653528589; Fri, 16 Aug 2013 04:45:28 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qv4sm1691617pbc.16.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:28 -0700 (PDT) From: Viresh Kumar To: gregkh@linuxfoundation.org, jslaby@suse.cz Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, linux-serial@vger.kernel.org, Viresh Kumar Subject: [PATCH 17/25] tty: serial: netx: drop uart_port->lock before calling tty_flip_buffer_push() Date: Fri, 16 Aug 2013 17:13:18 +0530 Message-Id: <3fbf56a800733879938f09f7e95eadf3d7e19401.1376651114.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The -rt patch triggers a lockdep warning for serial drivers if tty_flip_buffer_push() is called with uart_port->lock locked. This never shows up on UP kernels. Release the port lock before calling tty_flip_buffer_push() and reacquire it after the call. Similar stuff was already done for few other drivers in the past, like: commit 2389b272168ceec056ca1d8a870a97fa9c26e11a Author: Thomas Gleixner Date: Tue May 29 21:53:50 2007 +0100 [ARM] 4417/1: Serial: Fix AMBA drivers locking Signed-off-by: Viresh Kumar --- drivers/tty/serial/netx-serial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c index b9a40ed..4f59c4d 100644 --- a/drivers/tty/serial/netx-serial.c +++ b/drivers/tty/serial/netx-serial.c @@ -196,7 +196,7 @@ static void netx_txint(struct uart_port *port) uart_write_wakeup(port); } -static void netx_rxint(struct uart_port *port) +static void netx_rxint(struct uart_port *port, unsigned long *flags) { unsigned char rx, flg, status; @@ -236,7 +236,9 @@ static void netx_rxint(struct uart_port *port) uart_insert_char(port, status, SR_OE, rx, flg); } + spin_unlock_irqrestore(&port->lock, *flags); tty_flip_buffer_push(&port->state->port); + spin_lock_irqsave(&port->lock, *flags); } static irqreturn_t netx_int(int irq, void *dev_id) @@ -250,7 +252,7 @@ static irqreturn_t netx_int(int irq, void *dev_id) status = readl(port->membase + UART_IIR) & IIR_MASK; while (status) { if (status & IIR_RIS) - netx_rxint(port); + netx_rxint(port, &flags); if (status & IIR_TIS) netx_txint(port); if (status & IIR_MIS) {