Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2812010rwb; Mon, 15 Aug 2022 11:50:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xuQIiGqUhYv4rNqtS7u6tke3p8ALThyK1cWkxJCwKjqSSHYrkdzZGCIzKhyG6E24MUS0c X-Received: by 2002:a17:906:9c82:b0:6df:baa2:9f75 with SMTP id fj2-20020a1709069c8200b006dfbaa29f75mr11369049ejc.762.1660589421198; Mon, 15 Aug 2022 11:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589421; cv=none; d=google.com; s=arc-20160816; b=o3wgHjH5q2BTg5oVSSNCzkW8sU4xNJsNebY+HFgV2EFwu2ktBnUENQXrKSB2SU1TNz nmzqvS7p9AY/KTLyqmKh/NFMmOZrjGOY7C5CtGD4N+cy2NTeSIemDiDS+jGlw7ZgJu3v G4L6FlO/Y7kYlY0OBpPTM78vRjMdHQeJA5bIQCMjMUpf5Zfq0b9XCYYm2tw7FoFHUUEW T9aFuJE3+v58j2RpXpxsF5WPTp/loe+77I0OMEPKvkt+RreJMedRdpIUCC7JlAS0F/qB v6CXugA1N3/b3V9iIMq2ICJK41aqX9niamMdLr4cnRZ2O1ldIwSn0JgQzYAmMdyZ8kMO s+6w== 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=iHp38tES0o7GaQNNjMaocVLmojK+2NnIypJkyazID90=; b=BOjmajlLClf9ANu/ChKHtwjaQy8K5/cBN52Fz4wHelX3ADMFvcW6ZTSeSMGqHyiipI 7fmSoijbyftgPT8uF46gt62p8YvEoORGcBkGVYP5uwL1NwWIGxCL0VZM/1UF6hOyMqZJ YqGHGh3cVlxarUqqVyaANheh2kofnVlgKLDRAKyAfmO62U98qlfYxnxn8YDNkSA4V498 aRyg6z23ihxw4a44D0w2AYT7s8NDmlqDxqX4TzFF+pL3AsJl4jD8G/UWQXmkYBIuO4wV w/e8as/XtWLLJvlyFlGDKz2DrCoiQ/ztGB2mk/aGyNSMLkNOZKkS7JxckGaGCbA6yLqx ZE4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=scDyuHF7; 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 qw40-20020a1709066a2800b00732fca94958si8668228ejc.706.2022.08.15.11.49.56; Mon, 15 Aug 2022 11:50:21 -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=scDyuHF7; 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 S240661AbiHOSYT (ORCPT + 99 others); Mon, 15 Aug 2022 14:24:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241453AbiHOSXw (ORCPT ); Mon, 15 Aug 2022 14:23:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12982ED44; Mon, 15 Aug 2022 11:17:53 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7ABC4B81063; Mon, 15 Aug 2022 18:17:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBB3DC433D6; Mon, 15 Aug 2022 18:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587469; bh=k99rQfAN/Lt2RYkkU5H2EoGW+vQy2MUMH4d2va9jXms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scDyuHF75ou4xVkK7qUF0Bw7GB5ee9AiUHaTEv2NTK8+Hk+Q5h+fY3HeNGjCKRnBW 8OOXngS47gaORaR1qKzNV4kXZ53vQMoiJiYfO6XJbUcTe3EvltRQGQBb92Iblchhgl 6QFkoTi7h7qN7NgkoCDoDQspiqIH632qzaDmAN8s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yi Guo , Nadav Haklai , Narendra Hadke , =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 5.15 087/779] serial: mvebu-uart: uart2 error bits clearing Date: Mon, 15 Aug 2022 19:55:31 +0200 Message-Id: <20220815180340.999276684@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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: Narendra Hadke commit a7209541239e5dd44d981289e5f9059222d40fd1 upstream. For mvebu uart2, error bits are not cleared on buffer read. This causes interrupt loop and system hang. Cc: stable@vger.kernel.org Reviewed-by: Yi Guo Reviewed-by: Nadav Haklai Signed-off-by: Narendra Hadke Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220726091221.12358-1-pali@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 11 +++++++++++ 1 file changed, 11 insertions(+) --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -237,6 +237,7 @@ static void mvebu_uart_rx_chars(struct u struct tty_port *tport = &port->state->port; unsigned char ch = 0; char flag = 0; + int ret; do { if (status & STAT_RX_RDY(port)) { @@ -249,6 +250,16 @@ static void mvebu_uart_rx_chars(struct u port->icount.parity++; } + /* + * For UART2, error bits are not cleared on buffer read. + * This causes interrupt loop and system hang. + */ + if (IS_EXTENDED(port) && (status & STAT_BRK_ERR)) { + ret = readl(port->membase + UART_STAT); + ret |= STAT_BRK_ERR; + writel(ret, port->membase + UART_STAT); + } + if (status & STAT_BRK_DET) { port->icount.brk++; status &= ~(STAT_FRM_ERR | STAT_PAR_ERR);