Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2891793rwb; Mon, 15 Aug 2022 13:26:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rTxMZUT8aerDPlY8cFd3C8dtivF5aLffS0NSM4ebC5QBv9aSR/pZkouJsPfmtO/xuWC8m X-Received: by 2002:a17:907:a07b:b0:735:6744:c6be with SMTP id ia27-20020a170907a07b00b007356744c6bemr7868466ejc.685.1660595188634; Mon, 15 Aug 2022 13:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660595188; cv=none; d=google.com; s=arc-20160816; b=ztw5PLSsLxou3irsWPI59pfMQZLvv+HgzLfKfPqRo16+PPILeOjzxDdrzuJEuWusBW gTtidzheKC9sbk4bWrrcW7KyJObCA2oKP7HgdnTDZCEKDETZPHZFKmxnusbsWrbUjqjc YP9HiAkHMExah4RDvr+BWCerS4uH/fHQ5KcncDBA4IV0TuTU5FBP6/PrDl2np9cVjMof GCKj6Ia0vVzakhNPy9yPWK9VHVCdLp4V9Pi+a7dX2pE1tPueTPx6pb1CtjEpHwMfWbS+ 9K+O8+tOkj8mT/rNC+ReGpaSm/CoNWyQTK3bwwtWtF3EiwN7BrKKY5yorqN6ybQd7jUi gZcw== 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=EcEgrGnrTrzK3M5ICYx5zExRCRwtncKxzVzMzrLzfFM=; b=N5lWY7OdlktHY2MY2d1cPpALrA5wGX3OVaqliOJ7IgiTI8dfeP77f4kwOC4ObTUbpr PcYMpjEgTvxfBA3JnswFDUSn5WQ/LWdciHcZtn9+Y27RQPa8VNEFJb4dkhMBUDcezFI2 4TfXANmUzC8/xuOeH4/FpUglU5XuFrmDg81t8KezCXUworcMpQ7CvxfFfXrCaH49REtQ pEqxiSyO3997No6bGL9KRQFL/njGf6P+AtuizGfUk9pOxbbHSrhq+/H0yCm9AOyJSVS3 m6aKgaBK6hsEtdT0DSjkVgT5cJKLGv6+1AcgKOv53PG9AungHnKg1OyeT5+1XGXiN4UQ DZaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=V7IJB+Uw; 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 e14-20020a056402190e00b0043e8dd308a6si10496835edz.8.2022.08.15.13.25.58; Mon, 15 Aug 2022 13:26: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=V7IJB+Uw; 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 S1347197AbiHOUXi (ORCPT + 99 others); Mon, 15 Aug 2022 16:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346423AbiHOUPI (ORCPT ); Mon, 15 Aug 2022 16:15:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C3C9082F; Mon, 15 Aug 2022 11:59:27 -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 2585DB8105C; Mon, 15 Aug 2022 18:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69FFEC433D6; Mon, 15 Aug 2022 18:59:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589964; bh=ptbstcd6stve8vBtBfyzgL8zEE8ay3I+XdRF4HhLEpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V7IJB+UwBwt4Qg9FxlKbaJsa0QDGCtunv1rOZLVZI+7tGdzdlMljTfH56LZwkMh8E Y/fa/DW2W22TbA5Sgi/vuWb/Bf7ov1gPLanNKs+69B7ts1hQgJdme960UpWOzU5V8F GoXigvGeibaD5HDugzjhr9sSfbmnyXVppdZA72H4= 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.18 0107/1095] serial: mvebu-uart: uart2 error bits clearing Date: Mon, 15 Aug 2022 19:51:46 +0200 Message-Id: <20220815180433.993400408@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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(+) diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 0429c2a54290..ff61a8d00014 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -265,6 +265,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) struct tty_port *tport = &port->state->port; unsigned char ch = 0; char flag = 0; + int ret; do { if (status & STAT_RX_RDY(port)) { @@ -277,6 +278,16 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) 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); -- 2.37.1