Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp167587imw; Fri, 15 Jul 2022 00:02:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u6swBLYqBp6YDrB67BXT8HQQwvUGkTTOyuxjFwTRSMNcq4QFF9p6RPOoLvyBisrWStk8HT X-Received: by 2002:a05:6402:268e:b0:43a:8f91:582 with SMTP id w14-20020a056402268e00b0043a8f910582mr16864890edd.419.1657868541175; Fri, 15 Jul 2022 00:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657868541; cv=none; d=google.com; s=arc-20160816; b=C/yc+f6jnqSa7tGcqtAr9DpdjnChvbJyMVmG4zy5zZvZK1PIgqdVXYIQC5amlzkxYC 6j/L6/c5Ko74qEnOS4rzxKXCGeMRTOCFwkfTNoqk2x7bvpIXYDC5SZH+DMWbfrQOoB2w +1hvOOhzCon+Wsf3DvnDVEwUHhXVFpzKDkCoSvEsk/GsGuy38bj/wRkL3TB/A15QjODq AZSHjPzkDmtTb8pcvQVkKkojyt+v7MYHwlBuW4FEDczmy8Gh0l97FLwhumZu1wKjzxci ZvnessBPMIXniV8q9VvUnOWudkMF1JdzJ05pdpQF+Sss39/ETsBgy/noyvB2b9eUHOyH peGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=+mLRTaRDGXgpkH+hihE3uyVt6q2SF/pcz5ieGtWUJKU=; b=0QJUVv5kKq/3xHEYCSqrpJZcOeJSXvfL08v+n1LPKrC7sue28ps0Jkp6doVqFQts89 UKuOXjgvWPbaSSdzYp9cwVuSBLYGlfkiZrRILwfHn5b+m3EizPH2v0Qr4e4w+PvKrEMe gmXSGx7wdt61sZU1PBGEwnlTuwApw1YJRp+Yt+hrLUVwZodvQ0l/xLMgDy8TPeaQiRw1 +DjN88PxfmHlLnSsg0n5XtADNNauZ3vbZIYQITnTHu2tQej3MrIPx0YC0XD0kso48nxE t2YZ+Swqt8cipGKgpXVVAhbc3AoExkooTvYFAXnqvX45YneJTqSCHvyjvtwEYLsClwlO wDaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=GERYpNTO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lf3-20020a170907174300b0072b4151c094si3592028ejc.879.2022.07.15.00.01.54; Fri, 15 Jul 2022 00:02:21 -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=@walle.cc header.s=mail2016061301 header.b=GERYpNTO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230382AbiGOG7O (ORCPT + 99 others); Fri, 15 Jul 2022 02:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiGOG7D (ORCPT ); Fri, 15 Jul 2022 02:59:03 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12391A042; Thu, 14 Jul 2022 23:59:02 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 0473D22238; Fri, 15 Jul 2022 08:59:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1657868340; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+mLRTaRDGXgpkH+hihE3uyVt6q2SF/pcz5ieGtWUJKU=; b=GERYpNTOyfh5jTSDGbiShfTzmio1GZJux7pai8jiEuykBGlqzwEuJ4catXYuKkDHELAGZc Sc1RgJNNkSltzoaUpkleNV+99fSOsQ6BJvHi1AYzbE6TY+WEfHJqbhTtXCNlaR+lY4yhxi uIxLyvxqntHE0JKTmqCuVetBwn8fJYU= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 15 Jul 2022 08:58:59 +0200 From: Michael Walle To: Sherry Sun Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: Re: [PATCH 1/2] tty: serial: fsl_lpuart: correct the count of break characters In-Reply-To: <20220715025944.11076-2-sherry.sun@nxp.com> References: <20220715025944.11076-1-sherry.sun@nxp.com> <20220715025944.11076-2-sherry.sun@nxp.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: michael@walle.cc X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Am 2022-07-15 04:59, schrieb Sherry Sun: > 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. Ah, it seems I mixed up the framing and the partiy error. Did you test the break in the receive path, though? -michael > > Fixes: 5541a9bacfe5 ("serial: fsl_lpuart: handle break and make sysrq > work") > Signed-off-by: Sherry Sun > --- > 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 fc7d235a1e27..b6365566a460 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) -- -michael