From patchwork Fri Aug 16 11:43:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19230 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f199.google.com (mail-gh0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C84E246AB for ; Fri, 16 Aug 2013 11:45:24 +0000 (UTC) Received: by mail-gh0-f199.google.com with SMTP id g14sf2010408ghb.10 for ; Fri, 16 Aug 2013 04:45:23 -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=CbyTp8TaV9d9EFeX60+/YbQ1PPQrMhLsWqXmEwvIxnQ=; b=heGS2fDd09Nd3PLMq2gJ4FMvKiLWLBUOwTGelvu+eddYOyarK1muhZsyD1diDBvzfg U1Bb5G/kdPbReY92/l3UJSmLXOOBuORt9uVBfq3L8te1ew98FYVo3hylJ36gma2zhIIp FPT7nYBnwQ7jMhsALTLgma/VIWFLO+fW2FW1acLxI/PdSAFiKLZZbtjVX7yaRbYFfU1W gu7mo1RrTYeRJbXqtJwH4j0uq6YW3dERQmFjJTOrrYikeGmIgGB/Ke3MQCLmb69EOVYC GEyrNd/DryTYPut8YEoGXpRX53G2I8lEavmwa+kNBe0tSkyJBW3/74ikR2xeWAFZuWNT Y4vw== X-Received: by 10.236.31.228 with SMTP id m64mr428483yha.5.1376653523766; Fri, 16 Aug 2013 04:45:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.212 with SMTP id 20ls653612qeg.25.gmail; Fri, 16 Aug 2013 04:45:23 -0700 (PDT) X-Received: by 10.52.69.142 with SMTP id e14mr145962vdu.29.1376653523628; Fri, 16 Aug 2013 04:45:23 -0700 (PDT) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by mx.google.com with ESMTPS id sy7si226216vdc.40.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.52 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.52; Received: by mail-vb0-f52.google.com with SMTP id f12so1489756vbg.39 for ; Fri, 16 Aug 2013 04:45:23 -0700 (PDT) X-Gm-Message-State: ALoCoQmfBg9Yo4sSpP2481gDJ7dsazO451Jo4FuCzEOBBkoVOz10T0IPWUMpeAtwWAjHi2PN2MMs X-Received: by 10.52.249.102 with SMTP id yt6mr735803vdc.21.1376653523552; Fri, 16 Aug 2013 04:45:23 -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 u4csp64161vcz; Fri, 16 Aug 2013 04:45:23 -0700 (PDT) X-Received: by 10.66.192.132 with SMTP id hg4mr2677746pac.84.1376653522701; Fri, 16 Aug 2013 04:45:22 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id ds3si855188pbb.199.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so1784982pad.18 for ; Fri, 16 Aug 2013 04:45:22 -0700 (PDT) X-Received: by 10.66.192.234 with SMTP id hj10mr1071103pac.183.1376653522308; Fri, 16 Aug 2013 04:45:22 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ia5sm1643069pbc.42.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 16 Aug 2013 04:45:21 -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 , David Brown (maintainer:ARM/QUALCOMM MSM...), Daniel Walker (maintainer:ARM/QUALCOMM MSM...), Bryan Huntsman (maintainer:ARM/QUALCOMM MSM...) Subject: [PATCH 16/25] tty: serial: msm: drop uart_port->lock before calling tty_flip_buffer_push() Date: Fri, 16 Aug 2013 17:13:17 +0530 Message-Id: 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.212.52 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 Cc: David Brown (maintainer:ARM/QUALCOMM MSM...) Cc: Daniel Walker (maintainer:ARM/QUALCOMM MSM...) Cc: Bryan Huntsman (maintainer:ARM/QUALCOMM MSM...) Signed-off-by: Viresh Kumar --- drivers/tty/serial/msm_serial.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 2c6cfb3..daa2837 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -137,7 +137,10 @@ static void handle_rx_dm(struct uart_port *port, unsigned int misr) count -= 4; } + spin_unlock(&port->lock); tty_flip_buffer_push(tport); + spin_lock(&port->lock); + if (misr & (UART_IMR_RXSTALE)) msm_write(port, UART_CR_CMD_RESET_STALE_INT, UART_CR); msm_write(port, 0xFFFFFF, UARTDM_DMRX); @@ -189,7 +192,9 @@ static void handle_rx(struct uart_port *port) tty_insert_flip_char(tport, c, flag); } + spin_unlock(&port->lock); tty_flip_buffer_push(tport); + spin_lock(&port->lock); } static void reset_dm_count(struct uart_port *port)