Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404403rwa; Tue, 23 Aug 2022 04:20:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4g50jccIkN4F+eKhOOQ3QySRW4GVFAYuPuvB6YZNtSZLUS0vNT4saAKFUuNdGUk+BStvog X-Received: by 2002:a17:903:22c1:b0:16e:fbcc:f298 with SMTP id y1-20020a17090322c100b0016efbccf298mr24731036plg.2.1661253612252; Tue, 23 Aug 2022 04:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253612; cv=none; d=google.com; s=arc-20160816; b=HUwRqr6DoBKO32AobHtIUgYEN7e8rDGdh2CymYBurU8NPORRvE36YoFkQf6Sr0GRVN YtELUyrdFN78ePCCsk3coyD0DMR9NV8pDbkUIN727Hn4NWcKzFv+CghZS5trlwcfuN/w dyi3QvYcWYRJm0F2/oGsk/yF4NWtvXm5bWPcIUkd7HBhHVWrUoQ5x9/iz7uFax4h6nq5 OYBfWuE1QMOCXKM9drLGxftT71jdSjFdhoQ8lUGWsWIDXPbZht0WwNhSSRHRn4sCSqVY E9LaSFvFPQbgA0UFmR9NyQhRU9bI+GiEBaFaLx0ghQYDEAsbDt/YvRFgSybY+VxgY3BM 06lA== 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=0t2eJkaQHK0gDSHLUjqFW/t6S9gSV4MM4m0FMGTYgUmPbgUEZ2GonQMISisbCMxUAC 0J4QLoFv1BnSIwcwsK/ukdVdA2SkIhmw/gQSmW0f9WpzbHI8DNF3mL+2yBd3LCyJ/zXq CVU3shEq9NfR85Awd56hdxPQolQ2sm3X5qdoMkKDoupULrGq9rTxBQ9hb+B13110z4yA z2WUcph4FK6rEPvSU8bkeewUCPOFYpXxJ2H1LHmsMtAHZptTDYFAuAKmekmcxFmQM/lA 68WxYo/ZtC9UqzHOGbo6Gt0ZdQ4OR5qH39O8E3CPaZQ571N/s2fpxzJ0T/5ylpiQpquj uyCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oKFkLDk1; 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 36-20020a631864000000b0041df966444esi15335419pgy.59.2022.08.23.04.20.00; Tue, 23 Aug 2022 04:20:12 -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=oKFkLDk1; 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 S1354921AbiHWKd3 (ORCPT + 99 others); Tue, 23 Aug 2022 06:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354342AbiHWKRK (ORCPT ); Tue, 23 Aug 2022 06:17:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25C580B5A; Tue, 23 Aug 2022 02:01:25 -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 98D5C61459; Tue, 23 Aug 2022 09:01:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B2EFC433D6; Tue, 23 Aug 2022 09:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245283; bh=k99rQfAN/Lt2RYkkU5H2EoGW+vQy2MUMH4d2va9jXms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oKFkLDk1w3mGccHmsXwpBa9OrTrXLiV/b6zDXoaMFK7Y3/Og8YVCaLDiWhoo4pEE9 /cRSk/p7kopfOTRWKRf7YPWv0lhhrxrfqxG92+AhD4BmvYqQNjXjns7MsEOUu2/RX0 +2cTAxiGWOFXYykoacA1ovu30HjVTHGf6nITrgLE= 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 4.19 029/287] serial: mvebu-uart: uart2 error bits clearing Date: Tue, 23 Aug 2022 10:23:18 +0200 Message-Id: <20220823080101.256900175@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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);