From nobody Fri Sep 20 21:45:35 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BE3CC77B7E for ; Thu, 25 May 2023 09:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240601AbjEYJen (ORCPT ); Thu, 25 May 2023 05:34:43 -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 ); 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 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 Cc: Petr Mladek , Thomas Gleixner , linux-kernel@vger.kernel.org, Jiri Slaby , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Tony Lindgren , Lukas Wunner , Matthias Schiffer , 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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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-m= s property") Signed-off-by: John Ogness Reviewed-by: Tony Lindgren --- 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) =20 up->ier =3D 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. --=20 2.30.2