Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3110604rwb; Mon, 15 Aug 2022 18:21:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR5/B1RgN7agkPa58jdWI0hIPm1bvIhdj6Vltk6Q6MeGDcYZ706OL7oIXInnvdqile7gzaEi X-Received: by 2002:a17:906:5d0f:b0:732:fb97:780d with SMTP id g15-20020a1709065d0f00b00732fb97780dmr12220271ejt.269.1660612862985; Mon, 15 Aug 2022 18:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660612862; cv=none; d=google.com; s=arc-20160816; b=w1ZewmZCjw3EZj/2X7s7qnl1GbDpK66Djt9kLXetN49mJtt90x8DbGa7kIhfUqZrcG bAQpoE/eOd7E/U7zIQcocAeDHJnKD7bHQwBStRx8Kn2bynkHaFcvG8hFjSxaFQo52W/z uqqnOd8dsgGAWnj3Hb5SuAPIGWUArdzL96TLyudbn0w+LpyzHS75AgbMInwOsX+d1gki Nu7Z0p/HXVlycZwQUKNvqilnwbd51wHs03eakkGTp4eB1llS3VVVKv4OEMYGwDj2lFk1 wF7HlTWky1SGF68+s4rDgHVy0noCE/nO+jI9krtMLA0J0ipDkDXm0bLHr5RS3OpWkrdu mXcQ== 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=sGTFHeyJmeNKtcIrnnH0f17YWGEq1LZuBR5FywvBukY=; b=jSndoAmPrRSsSU7s1I/YIz6+brHZYX7G/jR4n/4xIgkhoctNjF88Jw81cMbVqsLgx5 Wbx4Ibl8aVaDneJhCkYGKGrMGyBi5VRS4ckErO8/edrHBKYxunNS/nUY9znd0iYi0Sa1 mbUyIK4cmvPA6+dd3MU3iVUyAoQ4XTEeK6qdmyGxPBccYaP4969zpc48tOPX5kKsg0RB wueAro77rXw28KMieqrC1GOV2ZYmv0ZazrqYClQazzWn5ssuhOoNe01aFQa3uUmncxl8 rB08yIY59bPW4uTXARyvHvwWUMNJR24eEeJWWNnTg5uIAqusRdyvgGgnZFkoUgUtLve4 Q7kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iKALp9hg; 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 l10-20020a1709066b8a00b00726c7fc61dfsi7850070ejr.103.2022.08.15.18.20.36; Mon, 15 Aug 2022 18:21:02 -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=iKALp9hg; 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 S244098AbiHOWzX (ORCPT + 99 others); Mon, 15 Aug 2022 18:55:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242683AbiHOWyB (ORCPT ); Mon, 15 Aug 2022 18:54:01 -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 A4E3E7F11F; Mon, 15 Aug 2022 12:54:49 -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 D0FBC6113B; Mon, 15 Aug 2022 19:54:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3EE8C433D6; Mon, 15 Aug 2022 19:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593288; bh=Zs8uX0XxC7l9T7Gv2eAAYMFzEiCbxZ8p6gV3+tEkSGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iKALp9hg5EVCoM2ZcAv95swNMolNPw5TWVFQtVNSrT+kkK33kSYM+XzdJgyv80mpp 5rMkZ9qjBzXjJoBY3dzgQv9TeRM9tm60p8hillKeaAxpHJnKK4XjeVAAR9HywQ8Ev+ t+O+a/3QCFhmn6dQyYLfKo41Eij2Gnmj1CmZr/aI= 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.18 0923/1095] tty: serial: fsl_lpuart: correct the count of break characters Date: Mon, 15 Aug 2022 20:05:22 +0200 Message-Id: <20220815180507.445957567@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: 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 2cb89491dd09..65b76adf107c 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