From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C92F6C54EBE for ; Mon, 16 Jan 2023 15:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OkxWHbYdrgCJ02GgJhjSCa1F1HDxbUdRLiVzl4BCm0Y=; b=bxz0Y1zVQuO/Pd ZsYAoJ+f9z3+jjCI5DFXgwZBphTiB7bQKF9eVNq26qCM5tNGb5VuONCPkOJWZq2ZspNvRBpOy1Hdo SNbTGfT3VxPA7PD0Wet54u3d/E0CBWeLjY62iP7VWeyraULxAfDMh4afoyNBMJs7n7CAtMKMMUbFy cAC4OO2ZLj+vKXMQyS6KSgC6eMdGkEn/UbN9kP75JiuXsY5oHvvgYC3gYwfQAATeDde1SSouk8I7R eDfcj7eSIktMZsALwCcw2C2EXMH3dg8OyciM2Gy4pFgQdjenPRb6OZTZtMABE8oeV0NcvQDmXs/M+ 5BT/rsbnNUqwW5P347ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRL1-00B5dK-Q2; Mon, 16 Jan 2023 15:23:55 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHRKy-00B5bn-3K for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2023 15:23:53 +0000 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 BDFFEB80FF1; Mon, 16 Jan 2023 15:23:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BC22C433EF; Mon, 16 Jan 2023 15:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673882629; bh=it0pkYXTAx8Hru0WRIy1t0XiKdnjq1cBLA/oVDeMr6g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZo95OzBRc3B3DFMD3O5YJ4yCk+3KYzMFsqM/183sQJQivshyvwvjGhSHPFmRg9ih vH7gyHcpcaomycD85hAF71k9H+M/E66kwyu9uiNjxGlhE9SLud3z7MN9+UakREP/3m 6y7K9OlFYxfrWVN7w4xdqjT6s71+7/T8ewQnCuGoGSl9SK45X6mrkDnUwiaWxTQZs3 wkiu52oDUxosVHQsospWezOEUneJrH14XBN4SV73w4MnKiMbNSipmpzvWe68vRuPxi W/WFn5izak04CGqB6aR8BpBmLGUUb8g6uQBvjGDyOiuI5stKePyWI62xDhdvu6XCDj +haBh/U/a/8tQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pHRLD-0005Tk-O1; Mon, 16 Jan 2023 16:24:08 +0100 Date: Mon, 16 Jan 2023 16:24:07 +0100 From: Johan Hovold To: Sergey Organov Cc: linux-serial@vger.kernel.org, Fabio Estevam , Greg Kroah-Hartman , Jiri Slaby , Richard Genoud , Sascha Hauer , Shawn Guo , Tim Harvey , Tomasz =?utf-8?Q?Mo=C5=84?= , linux-arm-kernel@lists.infradead.org, NXP Linux Team , Pengutronix Kernel Team Subject: Re: [PATCH 3/8] serial: imx: do not sysrq broken chars Message-ID: References: <87bko4e65y.fsf@osv.gnss.ru> <20230113184334.287130-1-sorganov@gmail.com> <20230113184334.287130-4-sorganov@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230113184334.287130-4-sorganov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_072352_304419_9F729189 X-CRM114-Status: GOOD ( 19.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jan 13, 2023 at 09:43:29PM +0300, Sergey Organov wrote: > Do not call uart_handle_sysrq_char() if we got any receive error along with > the character, as we don't want random junk to be considered a sysrq. > > Signed-off-by: Sergey Organov > --- > drivers/tty/serial/imx.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index e7fce31e460d..1c950112a598 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -911,9 +911,6 @@ static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) > continue; > } > > - if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx)) > - continue; > - > if (unlikely(rx & URXD_ERR)) { > if (rx & URXD_BRK) > sport->port.icount.brk++; > @@ -942,7 +939,8 @@ static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) > flg = TTY_OVERRUN; > > sport->port.sysrq = 0; > - } > + } else if (uart_handle_sysrq_char(&sport->port, (unsigned char)rx)) > + continue; Nit: missing braces {} Note that you could also place just place this after the block due to the reset of the sysrq time stamp. > > if (sport->port.ignore_status_mask & URXD_DUMMY_READ) > goto out; Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel