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 38003C05027 for ; Wed, 1 Feb 2023 14:43:54 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7V4wtxB86JijfW0vTmgc8vyeECFTkyBO92tUw/sdAKE=; b=wXPhi0/5Tlp8S9 hLiqDfpSryCxFKSiCUM2Neh4D+ZLR9KtU2n7mt7IGSY6GN0B+9N6GN24X9WOoLn7bZHgSCQuF3WAV JUfgKDezIhoheNC3JFr1+1Xl5ePu5x81bcj1VJvhxitKVan8T6dwrJvAXDF0QhchKPZuI48HM+YNX 1oYipZ5fQlytVOhfRyc6A8z5i3ajGJ3tVSN6vv+7ZJAamGK9ij2nfmO6yeLKpRbVjze5ejjmGBUlO z+lkgyHxIEnymTDK41U5QyBdLEwXLUQZC6Xxc/jg51ZnCqVr+OIMk3B6rFn5y5w+gnNdIlj5UY0Df RF/xj8G75RPFvAIg3xkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNEJq-00CSCo-Jb; Wed, 01 Feb 2023 14:42:39 +0000 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNE5V-00CLq3-Jj for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2023 14:27:51 +0000 Received: by mail-ed1-x52e.google.com with SMTP id v10so17849986edi.8 for ; Wed, 01 Feb 2023 06:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L5v/xKpmgx3IRd85qrBv3zwjvdUmTrkcJb9ZlFLMDeA=; b=DAPka0L/4I745c/qSKtgYk1wXpzL4moxASBPZFfPfq75oV0qTfjaY5x9Tjq2yLKzof 9fYKAsmN9k0Fu28gVIG26CnvnbN5z54z+r6oz//cPTtDMVEOS3BfzTiVwL01XNHicWV4 DZQxephCKADZIAC1Q9SxrKEAfSPvrBh9B2nakdG9VBvEBmRd57K2b+ZxN52HSbNy7jzT aGEtgbzC5XN2R/aO550nV1rLoUQiVvN9MMtxmFo7bzdT0gCE2CaCZIjNhte5mVq7BRRS sAJQNX1LkG1MKJv8q+g7yO5GvR3oqi09+nRxAFJYBhXLgCA/4LF5I/0WvLIDHIHTAwLH isbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L5v/xKpmgx3IRd85qrBv3zwjvdUmTrkcJb9ZlFLMDeA=; b=NWOmAM74TOtDXJIKaBFsQVqG8eC0Ja4/vT98rFJ0HnUniYF4pCHhCMdel/bjiTUr58 7bPlsoagDSo/WCj23UzvvxNL8J/lp5Qm7GfJrO6c1e4YWK/eZKI4XAJjAr3+s1MJm1tP 12zmtRmXMf3Ug2P52HOAAeLWTKtX/YD7yO5j70vMfIaht2UQtzDYj+I61VIIVgM7PIRm lCzmk2JN8lHONfy3aUHddP6ZSejofda9bd2ScfpQaX8Ehja5lVq5Jjlppw+Z2Xfhacuw PSIx3mbF3aDMdt8GYRxk3RrFQtYWM96vyg81uL94VRCGKwSsYuYSO6Z8OAClNphpiolo uyvg== X-Gm-Message-State: AO0yUKVZy7Oy5L7K4cGMzO9LMP7iCmO5s9QCJ4gRKM6OInxzfrZrOrfH nF6pDC1H/o2zSBOjDVCdTPo= X-Google-Smtp-Source: AK7set9QcDJuAnQSBUBYWr27mdVAgUyXyUxUF978MjptXVS6Ji9xpOjDJa2P1X5QD2PbSZYITR2dBw== X-Received: by 2002:a05:6402:882:b0:499:b48b:2c3 with SMTP id e2-20020a056402088200b00499b48b02c3mr2062287edy.25.1675261667832; Wed, 01 Feb 2023 06:27:47 -0800 (PST) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id cf8-20020a0564020b8800b004a18f2ffb86sm8975564edb.79.2023.02.01.06.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 06:27:47 -0800 (PST) From: Sergey Organov To: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org, Fabio Estevam , Jiri Slaby , Richard Genoud , Sascha Hauer , Shawn Guo , Tim Harvey , =?UTF-8?q?Tomasz=20Mo=C5=84?= , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Johan Hovold , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Sherry Sun , Stefan Wahren , linux-arm-kernel@lists.infradead.org, NXP Linux Team , Pengutronix Kernel Team , Sergey Organov Subject: [PATCH v1 6/7] serial: imx: stop using USR2 in FIFO reading loop Date: Wed, 1 Feb 2023 17:26:59 +0300 Message-Id: <20230201142700.4346-7-sorganov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230201142700.4346-1-sorganov@gmail.com> References: <87bko4e65y.fsf@osv.gnss.ru> <20230201142700.4346-1-sorganov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230201_062749_752632_702D7FD3 X-CRM114-Status: GOOD ( 14.22 ) 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 The chip provides all the needed bits in the URXD0 register that we read anyway for data, so get rid of reading USR2 and use only URXD0 bits instead. Signed-off-by: Sergey Organov --- drivers/tty/serial/imx.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index af4349fe6970..488d8119562e 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -892,27 +892,21 @@ static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) struct tty_port *port = &sport->port.state->port; u32 usr2; - usr2 = imx_uart_readl(sport, USR2); - /* If we received something, check for 0xff flood */ + usr2 = imx_uart_readl(sport, USR2); if (usr2 & USR2_RDR) imx_uart_check_flood(sport, usr2); - for ( ; usr2 & USR2_RDR; usr2 = imx_uart_readl(sport, USR2)) { + while ((rx = imx_uart_readl(sport, URXD0)) & URXD_CHARRDY) { flg = TTY_NORMAL; sport->port.icount.rx++; - rx = imx_uart_readl(sport, URXD0); - - if (usr2 & USR2_BRCD) { - imx_uart_writel(sport, USR2_BRCD, USR2); - if (uart_handle_break(&sport->port)) - continue; - } - if (unlikely(rx & URXD_ERR)) { - if (rx & URXD_BRK) + if (rx & URXD_BRK) { sport->port.icount.brk++; + if (uart_handle_break(&sport->port)) + continue; + } else if (rx & URXD_PRERR) sport->port.icount.parity++; else if (rx & URXD_FRMERR) -- 2.30.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel