From patchwork Tue Mar 22 13:12:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 8642211 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C272B9F3D1 for ; Tue, 22 Mar 2016 13:14:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E021E2012D for ; Tue, 22 Mar 2016 13:14:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFA0A202A1 for ; Tue, 22 Mar 2016 13:14:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759088AbcCVNOD (ORCPT ); Tue, 22 Mar 2016 09:14:03 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32910 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759002AbcCVNNw (ORCPT ); Tue, 22 Mar 2016 09:13:52 -0400 Received: by mail-wm0-f67.google.com with SMTP id u125so3587985wmg.0; Tue, 22 Mar 2016 06:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dg8lw/pJj0EE4UdJS8JiMysDIi5jcL0CL8NRX9greHc=; b=I52pNj94a+v4cSgQdikE0z69gM5ij+BPg50E3lC3tcW/e2c8fFwF0PMUx+ZrFwTsqs oGtyDBlQqwVxpAlq0yWxsEqxW+JOyKOc2UFBG8/j/J3kjI4DWyJ4IupFcnz86yo9R9XB BXpp6+4TJ7gsDt/8bFSXhU2Os8Lou+0bjKjP8pW9jzCMr/TdRDQToYFCgvMiQO95zzP7 fsaX88am8/f2OAGJEJFSX6CbY1yssVHOuxvaNVcZ680VrxCzkhdL3p1OfyFfg/AFM6Kd lx8mQU/syhcSePrSN72/l2m9pst7iZ9eDC8MZl6BhryLmfeXsjtwUbmhovjlLCoLHIFz DR3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dg8lw/pJj0EE4UdJS8JiMysDIi5jcL0CL8NRX9greHc=; b=Dli2rw8dt8kDlsVxbs4VXQNosI94y6Gt8b9effa2flKWIG+OJcmqDS6htJaVVqCChf wNOhUHQOWWX9byb6O7j5a8Grw0EN4Vzk1pNxRIvvzgZb2L7HvEUT7HqSsQW4tB/cAYBQ qAIRFO5d+I9r8AlLJqeA+XexzHOO93mhOPjUk8T1eY4cq8w3sWS4/I1Wldm/rl4QFK8q cQIwo/HIBle/6ymDara2eOQPidSultr0yWBqOfzy+o29eC6e451xlkMWfbX8WGGMqTEj CX9Lo2PYjTroZ4CKPM0L9djus/8NX3EK3ooMrZyiIZATnbmQQDAyzMzh+thu9vuRG8oZ a6jg== X-Gm-Message-State: AD7BkJKi+DHZlXhfU/GbFU9/UxgyqrMHowFtZJ8Q7MLuOg0k4GcGBJMImQcFnNUNUtHUPw== X-Received: by 10.194.103.72 with SMTP id fu8mr38577844wjb.70.1458652425440; Tue, 22 Mar 2016 06:13:45 -0700 (PDT) Received: from development1.visionsystems.de (mail.visionsystems.de. [213.209.99.202]) by smtp.gmail.com with ESMTPSA id y72sm17384561wmh.21.2016.03.22.06.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 Mar 2016 06:13:44 -0700 (PDT) From: yegorslists@googlemail.com To: linux-serial@vger.kernel.org Cc: linux-omap@vger.kernel.org, gregkh@linuxfoundation.org, nm@ti.com, bigeasy@linutronix.de, tony@atomide.com, nsekhar@ti.com, Yegor Yefremov , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [PATCH v2 4/5] serial: mctrl_gpio: add IRQ locking Date: Tue, 22 Mar 2016 14:12:08 +0100 Message-Id: <1458652329-10138-5-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458652329-10138-1-git-send-email-yegorslists@googlemail.com> References: <1458652329-10138-1-git-send-email-yegorslists@googlemail.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yegor Yefremov uart_handle_cts_change() should be called in IRQ locked state, hence use port->lock to disable interrupts. CC: Uwe Kleine-König Signed-off-by: Yegor Yefremov --- drivers/tty/serial/serial_mctrl_gpio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index bb5e4f9..85b77ba 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -143,6 +143,9 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context) struct uart_port *port = gpios->port; u32 mctrl = gpios->mctrl_prev; u32 mctrl_diff; + unsigned long flags; + + spin_lock_irqsave(&port->lock, flags); mctrl_gpio_get(gpios, &mctrl); @@ -165,6 +168,8 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context) wake_up_interruptible(&port->state->port.delta_msr_wait); } + spin_unlock_irqrestore(&port->lock, flags); + return IRQ_HANDLED; }