Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp983842pxb; Fri, 15 Apr 2022 17:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrn/z4zTlUbl0QT6K6OJIwwvBXUPlCNC1CFO8m3ykZ2uZdUTMwhZuJ0/OtYVNKqoDQFjhz X-Received: by 2002:a05:6a00:1ad2:b0:508:6739:5621 with SMTP id f18-20020a056a001ad200b0050867395621mr1531307pfv.42.1650068634602; Fri, 15 Apr 2022 17:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068634; cv=none; d=google.com; s=arc-20160816; b=TiMRGf1s/jNZchNpqMgvcSoRKMrvc7eNHbwfJrYC4vyV3wQDekpw4Pf8NFILhWFGpi 5WoBQ6G3Kdo5pId3bsd/hZscxpbXvhrgpFCc3z7fBVN+sLIFy2gkj0HWP+nDIg14vyW8 iJtuzfPcArVQKVytHk9Z8+5Si0MCOhujVwJ/AGAhLBKas3OLUulFmi+obebjQ0SUBW5H dC1KIc2U6aO9gFg9Tbr6HfWrGV9L6WyKauJkRRc52Y65ieL6RB79r9GAf/N00c/T2w4G eFTBA6fXY2M1E5OqypdEIa/8nQBgCiLubUcwEllWHtQmpXosLXmOvRn3LvtK7vM/WXE3 lpeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iPsrk/5qUgj7IgB+I0d9hWJypyGQID0E6Ego71lnOzk=; b=IRuS0bUB9m+lJVK4nGztTbiIACUUj5FtplXHG8Tz3lp/9JEV0GqGWsqGWHtNz0gVz7 socMrtctd5YmaJPpgQGADnZ4fsTDuajtz74JM3eFFCbouMUsJVv8lkC9NSex4e/sJBXD nDARrZv/EogAh3M3eN6Qmr6UWuphOEV/kNh00L4/qTsuCjw0E1g4rOzqyU6jap8vE9UV ZkKRyHu0SygTo5BkQ1Vf4h9B7Cr1qeSDk7WUtXa3toLZW08ORdx8QbzoXhHbWrv2XbPY 7FE7TMpiY4bBqfp1TVKD4uhkEJYj6D/rOpPdF+CBD1fa8k8+FViHPhyb0B9fAsLNXSVh c+WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U2xoJV98; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w9-20020a655349000000b0039815687f74si2722475pgr.839.2022.04.15.17.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:23:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=U2xoJV98; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F40BEE0ACB; Fri, 15 Apr 2022 17:22:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350557AbiDOGoC (ORCPT + 99 others); Fri, 15 Apr 2022 02:44:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243518AbiDOGoA (ORCPT ); Fri, 15 Apr 2022 02:44:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C59D8AFADD; Thu, 14 Apr 2022 23:41:32 -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 ams.source.kernel.org (Postfix) with ESMTPS id 8867AB82BF0; Fri, 15 Apr 2022 06:41:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA977C385A5; Fri, 15 Apr 2022 06:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650004890; bh=+L/HFWzltw7KDYz0FALc3guFX9clLm9cFM07Zin4qws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U2xoJV98ppVR4dwd0IrPUHQTzHUazzXZ+C+DgBpQQR75KPLW4WYFNd6JDZEL6JCBc w2nWV1/4a5WEGt99YbBCAtfxzoyk6NScThAh/KJNUtF5wp7GUw4Xa/uFGbluJTO1IG Xsxs6pLSdShzdF+FyDC66IJsu1Ft7gBf1C/pPWGo= Date: Fri, 15 Apr 2022 08:41:27 +0200 From: Greg KH To: Kartik Cc: ldewangan@nvidia.com, jirislaby@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH] serial: tegra: Correct error handling sequence Message-ID: References: <1648112644-16950-1-git-send-email-kkartik@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1648112644-16950-1-git-send-email-kkartik@nvidia.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, Mar 24, 2022 at 02:34:04PM +0530, Kartik wrote: > From: kartik > > In the current error handling sequence the driver checks for break > error at the end. > > By handling the break error first, we can avoid a situation where the > driver keeps processing the errors which can be caused by an unhandled > break error. > > Signed-off-by: kartik I need a full, legal name that you use to sign documents with. Is that this name? > --- > drivers/tty/serial/serial-tegra.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c > index b6223fa..ba78a02 100644 > --- a/drivers/tty/serial/serial-tegra.c > +++ b/drivers/tty/serial/serial-tegra.c > @@ -440,7 +440,19 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, > char flag = TTY_NORMAL; > > if (unlikely(lsr & TEGRA_UART_LSR_ANY)) { > - if (lsr & UART_LSR_OE) { > + if (lsr & UART_LSR_BI) { > + /* > + * Break error > + * If FIFO read error without any data, reset Rx FIFO > + */ > + if (!(lsr & UART_LSR_DR) && (lsr & UART_LSR_FIFOE)) > + tegra_uart_fifo_reset(tup, UART_FCR_CLEAR_RCVR); > + if (tup->uport.ignore_status_mask & UART_LSR_BI) > + return TTY_BREAK; > + flag = TTY_BREAK; > + tup->uport.icount.brk++; > + dev_dbg(tup->uport.dev, "Got Break\n"); > + } else if (lsr & UART_LSR_OE) { > /* Overrrun error */ > flag = TTY_OVERRUN; > tup->uport.icount.overrun++; > @@ -454,18 +466,6 @@ static char tegra_uart_decode_rx_error(struct tegra_uart_port *tup, > flag = TTY_FRAME; > tup->uport.icount.frame++; > dev_dbg(tup->uport.dev, "Got frame errors\n"); > - } else if (lsr & UART_LSR_BI) { > - /* > - * Break error > - * If FIFO read error without any data, reset Rx FIFO > - */ > - if (!(lsr & UART_LSR_DR) && (lsr & UART_LSR_FIFOE)) > - tegra_uart_fifo_reset(tup, UART_FCR_CLEAR_RCVR); > - if (tup->uport.ignore_status_mask & UART_LSR_BI) > - return TTY_BREAK; > - flag = TTY_BREAK; > - tup->uport.icount.brk++; > - dev_dbg(tup->uport.dev, "Got Break\n"); > } > uart_insert_char(&tup->uport, lsr, UART_LSR_OE, 0, flag); > } What commit does this fix? thanks, greg k-h