Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3250877rwb; Mon, 15 Aug 2022 22:19:27 -0700 (PDT) X-Google-Smtp-Source: AA6agR6QU1u38x0TAPr0AkAmFX8N484hjNu51i7jAlnrlKYHGdsVvVjethEMKU0E/5P5qC8WJi7A X-Received: by 2002:a17:90a:9383:b0:1f4:fd59:7e47 with SMTP id q3-20020a17090a938300b001f4fd597e47mr22495517pjo.172.1660627166803; Mon, 15 Aug 2022 22:19:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627166; cv=none; d=google.com; s=arc-20160816; b=oMj6n6/5t95wbXQAU1Dk4twzFfUdwlqQIsRfZPQHtePEaxKuY4eyP0VPEZwiSvNi96 tlyiIV4tIyFxJnvvnK4Z5Hy+TEqeAHd5hedRw224cr88HHBsuEBd5cls5cpST4IosFt0 TRbltE7bOvLf194/y4mtA1rh52TyzPf26MMdU0B3BVaN30Rtf8O4cB3zlvvbMFU+AlYT eve4wo8SsGYuLDbpXHEN3uU1AznDk6NHtR+mHeQQV5T5cKcS1Rlhhwxdjs9+NoCjSfr2 M3A7G7lXO7wZRwXyKn6KfuPXwfe9xbTLXHM/0HAUgOury2xJcQHqzjxxo00fB7Fvq4Fj BFnA== 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=Rr5V5mbcqXEAlZHYZb4cu2gLf+C2VJRsi+TeqlgIWZc=; b=njwqZ578UgM9XaJA6RqTGWFn3do8HtE267NZaffn7HAhGBc4FH/Io1krc1I4gpe3SR kY2XqCaHPN4H2UBBZM2YRlUmFapQVS9FiNgIa7bwfGPrZAhEWiX4R4yo4hnTHC0agIAX 5/uYCjTb7aYcyvtd7ZYZVVVlHJtukMEUjQ06mXyvXXQWax4oa/iGVMLrg+fIv39HjHHn JpeNBpgYtF783QBJCl05DOPnqMF8Kqbgz9GZ9opd2KAyaDhOI2S2dTa5QrK0hS0uz0dY x1Dup071NUHc5ZhiOTiBx39e44WhItBwUuePmNCOIHuAoyTUl991e7qVvGnPnxGI3X24 2R9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XPIYxXg5; 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 bt19-20020a056a00439300b0052f75073e5bsi11792550pfb.7.2022.08.15.22.19.15; Mon, 15 Aug 2022 22:19:26 -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=XPIYxXg5; 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 S232228AbiHPEwU (ORCPT + 99 others); Tue, 16 Aug 2022 00:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbiHPEsP (ORCPT ); Tue, 16 Aug 2022 00:48:15 -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 59B50B08BC; Mon, 15 Aug 2022 13:43:23 -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 E8DE86127C; Mon, 15 Aug 2022 20:43:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B88C433C1; Mon, 15 Aug 2022 20:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596201; bh=/qLeM6O+hsKWkm56b8NdyqMMrg/DKwhFZQtIKkk3yxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XPIYxXg5WjWVsCmYyEVYNs4XHMnXCBp1HKO9YDxXInDqbZ++t2aluUy68k8ZlhzBi 91qhcCm/2efLPx6ji6BbK5eQ2CjOZRzVVIMdhk1kQYtvaNa9RvCapQAbqVgY0DkqQk dRvMYhp/HfiuWMgF8dRAAABtTb0FnoGQwvzA/E94= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Walle , Sherry Sun , Sasha Levin Subject: [PATCH 5.19 1003/1157] tty: serial: fsl_lpuart: correct the count of break characters Date: Mon, 15 Aug 2022 20:05:59 +0200 Message-Id: <20220815180519.918305358@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: Sherry Sun [ Upstream commit 707f816f25590c20e056b3bd4a17ce69b03fe856 ] The LPUART can't distinguish between a break signal and a framing error, so need to count the break characters if there is a framing error and received data is zero instead of the parity error. Fixes: 5541a9bacfe5 ("serial: fsl_lpuart: handle break and make sysrq work") Reviewed-by: Michael Walle Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20220725050115.12396-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/fsl_lpuart.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 0d6e62f6bb07..561d6d0b7c94 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -990,12 +990,12 @@ static void lpuart32_rxint(struct lpuart_port *sport) if (sr & (UARTSTAT_PE | UARTSTAT_OR | UARTSTAT_FE)) { if (sr & UARTSTAT_PE) { + sport->port.icount.parity++; + } else if (sr & UARTSTAT_FE) { if (is_break) sport->port.icount.brk++; else - sport->port.icount.parity++; - } else if (sr & UARTSTAT_FE) { - sport->port.icount.frame++; + sport->port.icount.frame++; } if (sr & UARTSTAT_OR) @@ -1010,12 +1010,12 @@ static void lpuart32_rxint(struct lpuart_port *sport) sr &= sport->port.read_status_mask; if (sr & UARTSTAT_PE) { + flg = TTY_PARITY; + } else if (sr & UARTSTAT_FE) { if (is_break) flg = TTY_BREAK; else - flg = TTY_PARITY; - } else if (sr & UARTSTAT_FE) { - flg = TTY_FRAME; + flg = TTY_FRAME; } if (sr & UARTSTAT_OR) -- 2.35.1