Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3136976rwb; Mon, 15 Aug 2022 19:04:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR61zlfsGY/OXLwIK0hywBNPe0xus9d2HD0B3BrccsaWH+c8UH4yP54zPXHR6EzWVaUBnqhV X-Received: by 2002:a17:906:5a71:b0:730:aaa1:a9ec with SMTP id my49-20020a1709065a7100b00730aaa1a9ecmr11911561ejc.440.1660615468497; Mon, 15 Aug 2022 19:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660615468; cv=none; d=google.com; s=arc-20160816; b=dQlC8J94leKm8T5hzDusSDEScfO4SrDRLiQZGWn4IDkbaKQvywdvLL2fAP9+l+oJ/1 60KcR/Z9FvscvNr94+ADC7w8fotyHf/57iVBbIaDW251QHHDHUiAwQUAlDIni/PReLsw e9+Ma+t8zuOiC9NOCAI/Hq903DlEXiM/yN7xC7/wVxIbygilHkcDHHemBIt0pCZTUXlP 76WnYpUmdF8wKAKS6vZKfYTmwOTAwx6DFbmnSrQDlf520YORSJTaW9pIrPabUCRXEWmD WTO3bpfi+qiW/1V2LJPKNznWB2M607TKhsOJDK1LsqmhocjcFeM4sy95u6zsn+uMOdw5 x4ug== 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=0LyWcPOhGroCaFR9GOA2lHBs5QveJNOC0i6VaqyEi8w=; b=YIa1JHH8IoOrBsCdqvYcrhQFKrYQeDmezgri/NvRx6lApj44xe3Rd9vcQwl1xF2LGw U2t7+F/OPcxzr7z1HqVKA8AMTI0YaMYqGjoywE/RpLsp7Hj3s9O7RI1NUrzZwXutzkYI WjMdz8fa8ZhxW85JvoTrAmkxdzrZSuW3DhydQXN0HdkxxnY+5uWA/E6Z5vlcQcv07cSC +HcW8US1UrqXnZtz+zjZLtl+ejiCr2c9SlBl4Fz+XYPAV+nzhPVM6XHuf3kXAFVWd+7k fMpe16zY2PQEHUYp2Ynec3Agorlx7jl+TcrfEPSKVkAu4gw9nBo60F+dq3IkwSqi5HCf IHnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MWOJVKHD; 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 ne18-20020a1709077b9200b0073086ecd585si9263179ejc.625.2022.08.15.19.04.02; Mon, 15 Aug 2022 19:04:28 -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=MWOJVKHD; 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 S1346316AbiHPAnT (ORCPT + 99 others); Mon, 15 Aug 2022 20:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349280AbiHPAlZ (ORCPT ); Mon, 15 Aug 2022 20:41:25 -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 ACDD318EC2B; Mon, 15 Aug 2022 13:39:16 -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 7739560F60; Mon, 15 Aug 2022 20:39:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E8EC433C1; Mon, 15 Aug 2022 20:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595954; bh=Et3J7TTyEf0zhFy7gHsoT3NCUvxMZ4Fzd+9iFqXT2GE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWOJVKHDh0qhMe5LV56VwbvxnqS56OEqfatCOpIfpgmeXiGU/ueVW4XZir4wV7dvm mry8TpRjU0lqeBXamGiKyyUX+3PiP2lo3TqL7XyQUL9daRMi2O6CqeeG/iTIpmEHJI lrb6gdHycXCmRi78rbU2wLqqw/We8ziOPD9sHSV0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sasha Levin Subject: [PATCH 5.19 0900/1157] serial: 8250: Get preserved flags using serial_lsr_in() Date: Mon, 15 Aug 2022 20:04:16 +0200 Message-Id: <20220815180515.457945267@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 6a4241e8f9b17aa17f55842d6478f280c22d2b44 ] serial8250_handle_irq() assumes it's the first to read LSR register. However, there are 8250 drivers which perform LSR read in their own irq handler prior to calling serial8250_handle_irq(). As not all flags are preserved across LSR reads, use serial_lsr_in() helper to get all the preserved flags. This commit might fix other commits too besides the ones for DW UART mentioned below. It's just not clear to me which of the other devices clear some of the LSR flags on read. AFAIK, nobody has complained about this problem (either against DW or other devices) so it might not have that bad impact in the end. 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") Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220608095431.18376-4-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index c9d8c0de56e5..2b86c55ed374 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1922,7 +1922,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) spin_lock_irqsave(&port->lock, flags); - status = serial_port_in(port, UART_LSR); + status = serial_lsr_in(up); /* * If port is stopped and there are no error conditions in the -- 2.35.1