Message ID | 20230525093159.223817-4-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp237862vqr; Thu, 25 May 2023 02:48:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5h/dAciohCLTshKCpzOd7rEF7iugLjKnLitwXIFMEThqQvU+rx4S63bAFXzuwFBA1Kk1Gq X-Received: by 2002:a05:6a00:1a93:b0:647:1cb7:b714 with SMTP id e19-20020a056a001a9300b006471cb7b714mr8204532pfv.3.1685008125737; Thu, 25 May 2023 02:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685008125; cv=none; d=google.com; s=arc-20160816; b=K42BpyuLdGuSfTxni/JSaYwcVc2Vj+bj904rj/WiMqRIygHZKM5ZfVjOSuNFmuIrJv OG1TPxbYRzcxWo1jKiJZrP4QNJtEc3uKcA4YJOA98IrGbPRUl/eY3B2YVPYmS/doLah7 2xxRhHMvjIzuLxv2OQx81DfDRehn8hUCM4gdFXDWBMnRZqH5yVe0ch5lgD5VVPEARIiq QdRqVVavRHwrG3NTy1A6cma1lBF2Xh3MqrkZcYyveho2dilCI+CRRb3iLNdoe2JguBFZ VXniUlfdD5xrZvBwIVcFRRplKfLO4IvHxt6t/b12xHjzDMB4L5QzLLHnWh7x22HTqfUg 6Z2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=ja3DzHE65weLmaEmyLLj0yo4U8LIunOOQtWnThWK8is=; b=D0nqno8TvTM7HPDHDgOrBFaBch7GukYnd5wIWK2bXe6Ep0lUxpSsbYHKyH3oVkRHqy fyodWbLlRalbTf+jBogihUkUUdFAjWtQhTnCGo+2pOVToidtnjX6a9QDdwTBZ2uC9sKM r4FSya8QcJgCx0IRr1r8lH33scTb5ZYbM2NULQRTYKm/o9zpRWUYVL6MKUADL5uuH9iG LgB1oNed3sjQ8BNbiyIUOmLzlrIoeOoAGzpMmEKi90tGuclJ/57AebGelEaZCpWpUmgm 0yXGSSuTNiy/28VQWaGRB4Rxqktyspa3z3cOmBxCL/8hL3waHIFzdy991hsEGDyVuANt YM8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uFW1cntd; dkim=neutral (no key) header.i=@linutronix.de header.b=XMnjW0U5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k76-20020a62844f000000b0064378fd1d54si1082669pfd.258.2023.05.25.02.48.31; Thu, 25 May 2023 02:48:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uFW1cntd; dkim=neutral (no key) header.i=@linutronix.de header.b=XMnjW0U5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240564AbjEYJem (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Thu, 25 May 2023 05:34:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240513AbjEYJeg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 25 May 2023 05:34:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0001519D; Thu, 25 May 2023 02:34:30 -0700 (PDT) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1685007269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ja3DzHE65weLmaEmyLLj0yo4U8LIunOOQtWnThWK8is=; b=uFW1cntdseBw4Nlcii3FUzxCE96sV9v1tVE5rbCJukpWARo0YvyDW7fNUPGg0FvNu6s1L4 t6We7a+2Z00Cq4YA+JMYTYuZrCzXPGgGyJu+VA6wDf9iXY1rTSJq2gin2OAdXzi4jlhSJJ 3e5VGO1cy8G/CiPauZwJFH61Mzyo8Z20iM27bMRS7h9OvjQ2RdwbjGLpOPPL6ZUXBR4I36 1Ejn83BGTNE4mxbHsoFkj+NO3zwSvdZ1CAdcexT1vBAsCmHNCuGvOHisxD7cSP9Gs2xDTE 1RW8HccAkhT8ktSDbML28YHUcHpu+Y80gH4/AE+K4LHshnnL6lSWW05OlabDBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1685007269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ja3DzHE65weLmaEmyLLj0yo4U8LIunOOQtWnThWK8is=; b=XMnjW0U55afe9vxq3aGUAviz6nfwdyywSmRFA3DlpYPJOAS2TclvYZK+gOQ4tF0Z+gwo/b sCv7GuZAsSdAu5AA== To: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Petr Mladek <pmladek@suse.com>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@kernel.org>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, Tony Lindgren <tony@atomide.com>, Lukas Wunner <lukas@wunner.de>, Matthias Schiffer <matthias.schiffer@ew.tq-group.com>, linux-serial@vger.kernel.org Subject: [PATCH tty v1 3/8] serial: 8250: lock port for stop_rx() in omap8250_irq() Date: Thu, 25 May 2023 11:37:54 +0206 Message-Id: <20230525093159.223817-4-john.ogness@linutronix.de> In-Reply-To: <20230525093159.223817-1-john.ogness@linutronix.de> References: <20230525093159.223817-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766859080603968781?= X-GMAIL-MSGID: =?utf-8?q?1766859080603968781?= |
Series |
synchronize UART_IER access against console write
|
|
Commit Message
John Ogness
May 25, 2023, 9:31 a.m. UTC
The uarts_ops stop_rx() callback expects that the port->lock is
taken and interrupts are disabled.
Fixes: 1fe0e1fa3209 ("serial: 8250_omap: Handle optional overrun-throttle-ms property")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
drivers/tty/serial/8250/8250_omap.c | 2 ++
1 file changed, 2 insertions(+)
Comments
* John Ogness <john.ogness@linutronix.de> [230525 09:34]: > The uarts_ops stop_rx() callback expects that the port->lock is > taken and interrupts are disabled. > > Fixes: 1fe0e1fa3209 ("serial: 8250_omap: Handle optional overrun-throttle-ms property") > Signed-off-by: John Ogness <john.ogness@linutronix.de> Looks good to me: Reviewed-by: Tony Lindgren <tony@atomide.com> > --- > drivers/tty/serial/8250/8250_omap.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c > index fbca0692aa51..c17d98161d5e 100644 > --- a/drivers/tty/serial/8250/8250_omap.c > +++ b/drivers/tty/serial/8250/8250_omap.c > @@ -658,7 +658,9 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) > > up->ier = port->serial_in(port, UART_IER); > if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { > + spin_lock(&port->lock); > port->ops->stop_rx(port); > + spin_unlock(&port->lock); > } else { > /* Keep restarting the timer until > * the input overrun subsides. > -- > 2.30.2 >
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index fbca0692aa51..c17d98161d5e 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -658,7 +658,9 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) up->ier = port->serial_in(port, UART_IER); if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { + spin_lock(&port->lock); port->ops->stop_rx(port); + spin_unlock(&port->lock); } else { /* Keep restarting the timer until * the input overrun subsides.