Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027078rwb; Mon, 15 Aug 2022 16:25:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR7VK+oRiZWALp+nLfNukyAUCCX70o/yn1xYfS6yCfU0lOssmE8WRG7sp88UbPrgkL3y5LeS X-Received: by 2002:a05:6402:84e:b0:440:4bac:be5a with SMTP id b14-20020a056402084e00b004404bacbe5amr16360937edz.103.1660605837960; Mon, 15 Aug 2022 16:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605837; cv=none; d=google.com; s=arc-20160816; b=S71KerNmsCNn0rm7OgXoFULOEU+bCLSJBWPNrnOqx69vUGwfTfbIP3O2xC5fnhAvoN w2B+8vMxzTRNIAfBtmg+uTJO8j2TPdgUQmGL/fKZ8sO8zQyS6H1cIlXW2BpEOlgTL40A CoNJGeDoI6q/acXcNRUdphRCVkrG6xe7Z7rxiLKkwfVib0A1xTSA1K6Ng3c5rn2yd8c7 nNQSdx1Mheo7sXMZa3HD8o/jxiRmkIILifkna+g6UqmrIGgBQDanQlg5sloMJNHZs3sY 4k5Qr8kwIWJVsfC3g5cYT6duyVPdK2skCKHGvmW+JNC3hSluKPmd+6p9sFenR2X9ilsY Mdmg== 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=EJ6WT3usUd/zF6YffpHYwzY5dygUasOq/oXDnsfQ25x5JnhiF8xH9qwefC1ViFRoV4 JpqLGumBNPC4gGQohSIHRUWrIOA9PY9SAzhlhR8fv9PLFDq+X8fpGSGJU8JPZh8SPdpv fyIla6FAQUX+73e8fKpUwBgiwJ18CNgDH6LXls5S0gJiienv91sInJ6VhgzIMkgYGj7K eWWXZGrdxv2+hbAriNgHu65eUrCHDN1hd1ycYXI7E7028EV/AEiy+DkZXc4fW1xk7hrf 2SK0JFNWxA9GaLUU+BuLKwBQFK1pElOTAcE7+rhH0FrsN6DZoqvvvEMNVj/USHGzsCbR JYXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bzK1m2eE; 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 y13-20020a50ce0d000000b00435681044a9si8516381edi.372.2022.08.15.16.23.32; Mon, 15 Aug 2022 16:23:57 -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=bzK1m2eE; 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 S1347184AbiHOW21 (ORCPT + 99 others); Mon, 15 Aug 2022 18:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349798AbiHOWVg (ORCPT ); Mon, 15 Aug 2022 18:21:36 -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 C9F49B5A4E; Mon, 15 Aug 2022 12:43:47 -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 0CA5F610A5; Mon, 15 Aug 2022 19:43:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06F7DC433B5; Mon, 15 Aug 2022 19:43:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592626; bh=ptbstcd6stve8vBtBfyzgL8zEE8ay3I+XdRF4HhLEpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bzK1m2eEGEIJkZm8D058Lm7D0lpKzS08u8akVJlJSul2FgL9xsFTlFXWUI7RTG3H+ ZJ8IOhIo95BbF7YtiNOQ431X+DwQKkvI2t6oxYziH1jAjQ4kkAOJ1q8eyrnG7Q2YDx zXcItG7ihoCbR9UEU6mLUd/4OHtx7EtSiyFxLpa4= 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.19 0117/1157] serial: mvebu-uart: uart2 error bits clearing Date: Mon, 15 Aug 2022 19:51:13 +0200 Message-Id: <20220815180444.294323311@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: 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