Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3258171rwb; Mon, 15 Aug 2022 22:31:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6331CN1WiqUt07Imq4v2Avswnvo2guGMZY/uWHganxKlC84Wt2ir/z5FuimKgBZn8WGayR X-Received: by 2002:a17:90a:e616:b0:1f5:35a6:6008 with SMTP id j22-20020a17090ae61600b001f535a66008mr21492832pjy.134.1660627883378; Mon, 15 Aug 2022 22:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627883; cv=none; d=google.com; s=arc-20160816; b=Mn4JCl49zA/RWvGoGTVcTLsD8VQuOK1ZKMMOKVyjAiVrXxe42UCzt/hslYEbmLW9d0 fXqlMQ8xtFoU3S9z6uKrkf56g6lF1QdW/dZnU1UJ3WxbFexEvJP09Z/eh+FhaWZJisso RZbeyXGX3NuMMgSPqq6e00flP8qd1rDYOrXncq5DQRo/mLJIG66wSSZhoG666myQbGAi H+nmKQX2L2g8pV0bYgb6Vv/z2tE33Rl3YqdhCZVsElC4KEMNgpWrTrIM3uP+3UEcYL4p lwoVg04tOnbuupQazXOsPFodwVrMfXMkk44wNPeUFVDZURq3xJDbpSPeMiMjRnRhDdVY Eegg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oHv5kORQRVldKdqyzMEhr8yxRu+cS2bUpYszUlcvRcs=; b=ufwTMIPLsZ52ty/5CqPDf4d0Wu+O73oCWentOpsBKe9Nyc6wMNCQYQkldzcudGt6ve 3qV1gFAOsY3nnp2NSIPS3kYgiXQOPSfGujec10xdeKmFIoYuluyY4Y6Isi/R9UCxiQfe xyUbwzJEiLPeMx8HTtYzBskaT49zws1ISIAXs+iAFLSxi21GeFNoSY4oaUJq9EIPfRDz yvMhoA7LDzSwUV+FZ7ytkDbvC4sJk+xwLUPMVPPwJDGRTGnS/Uf36No/LNc+l6PPJDyH XGfTdVLzfN7AwkUIXsr5tyXD13jneguYmNx6Bci1OoMIwT6jYtMCZjrNKSBhYQIodujf HqAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="JIdd/0as"; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm6-20020a17090b3ec600b001ed0f6f1010si12974603pjb.70.2022.08.15.22.31.12; Mon, 15 Aug 2022 22:31:23 -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=@linuxfoundation.org header.s=korg header.b="JIdd/0as"; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232359AbiHPErA (ORCPT + 99 others); Tue, 16 Aug 2022 00:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232116AbiHPEnf (ORCPT ); Tue, 16 Aug 2022 00:43:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68C94D3998; Mon, 15 Aug 2022 13:39:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B377E611D2; Mon, 15 Aug 2022 20:39:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BFF8C433C1; Mon, 15 Aug 2022 20:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595977; bh=FlZRgnf0Nis8Q7Zg7eYvSYAnXAGbYEO4arB46zxJ7y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JIdd/0askqFcfjrZpM/3dPjCoy3Z0f34yP5dyIIHC3CROgjSL6o737Gih6/3fD6Zm xdETYGFW4byl4JnoEbQQK17pXVHshfoYcU7uwSXD+yLvtB5Y+zlyB/upitMYt7ysWR XP9TQx/8+a+wTGyQL27hUEbylcqKKFFiXdSWn1AA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Phil Edworthy , Miquel Raynal , Andy Shevchenko , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sasha Levin Subject: [PATCH 5.19 0901/1157] serial: 8250_dw: Use serial_lsr_in() in dw8250_handle_irq() Date: Mon, 15 Aug 2022 20:04:17 +0200 Message-Id: <20220815180515.506070164@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilpo Järvinen [ Upstream commit 197eb5c416ff0e52d152e6ff59b4e759d2f3e10d ] dw8250_handle_irq() reads LSR under a few conditions, convert both to use serial_lsr_in() in order to preserve LSR flags properly across reads. Fixes: 424d79183af0 ("serial: 8250_dw: Avoid "too much work" from bogus rx timeout interrupt") Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices") Cc: Douglas Anderson Cc: Phil Edworthy Cc: Miquel Raynal Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220608095431.18376-6-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_dw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index bb6aca07ab56..7e05b431a314 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -253,7 +253,7 @@ static int dw8250_handle_irq(struct uart_port *p) */ if (!up->dma && rx_timeout) { spin_lock_irqsave(&p->lock, flags); - status = p->serial_in(p, UART_LSR); + status = serial_lsr_in(up); if (!(status & (UART_LSR_DR | UART_LSR_BI))) (void) p->serial_in(p, UART_RX); @@ -263,7 +263,7 @@ static int dw8250_handle_irq(struct uart_port *p) /* Manually stop the Rx DMA transfer when acting as flow controller */ if (quirks & DW_UART_QUIRK_IS_DMA_FC && up->dma && up->dma->rx_running && rx_timeout) { - status = p->serial_in(p, UART_LSR); + status = serial_lsr_in(up); if (status & (UART_LSR_DR | UART_LSR_BI)) { dw8250_writel_ext(p, RZN1_UART_RDMACR, 0); dw8250_writel_ext(p, DW_UART_DMASA, 1); -- 2.35.1