From patchwork Fri Jan 13 18:43:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Organov X-Patchwork-Id: 13101495 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 A8E93C3DA78 for ; Fri, 13 Jan 2023 18:46:30 +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=gsS8zBg8pGBjdIRWTY1E/er4insGlUQ4JkG8WhoVzvA=; b=qrsC2sPc7NZLty fNEeUpia7JmKmywriiWgmZLnyy9iElHCq2cGlPvqbxespXLCg3WmNqYoW0g6yGBybDEQrv40iF/Z7 apMTB6wH156VZv2CbDen2bv4XSBfdDI9QmmHMssgb2UH4tk31IGW+sjU6G0uUiEAZEEEtbAYRe2Gq FksBskCKKzjvq9V2bLMJ9GHoazOLqFtY6JAYmZNTCLCTZrHsqFj5VU1Z5gwylfrq6slqg3h5eDFRT 7oTfrtD9abfBhzOk2brpqCvSwnTEnVFY7Kt+lfj0Xx6IF4z5CGiLQ19fFn2qN2ghjKRAs3U/YTLFC XrPxKoXiy9zerwD84Gkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGP3G-0045tD-5y; Fri, 13 Jan 2023 18:45:18 +0000 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGP1t-0045Jo-GL for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2023 18:43:54 +0000 Received: by mail-lf1-x133.google.com with SMTP id j17so34353297lfr.3 for ; Fri, 13 Jan 2023 10:43:52 -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=u4rfVI/XJr5X+KumzfTQcZa08y9SOr59F+VA0vvNt8Y=; b=HiA03k7vO+25XVOg1p3rcNpZ+bitaCG9UPkD8GsVXWwB8igzePAu2VcREZWn5HvjwJ QWqMWKFsk42V1qIx92+u8sF9cje9g6hgZvtMcTi0dqaHY1MWnKp9j7K7Z27u2UDcXjQC jVyzWwj7nh3+fEFxrGWaJInUv3RaPLlxdvjVj2E6zbnkctwxQcoMACOIs/wX5bHxAixG UfXaJ/9F3QUIcjMqtYQew/mcVjC9TY98VYivwNzaBBh6uU/l/U5iyMFrtZBxQIKa6ADq pRQttmB0Kphnf+l240qyAAxXQ4DpGPCuF0Qe5bM1w1NVdkkxQslUapQrGKxtSmc9AJ2t zJWA== 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=u4rfVI/XJr5X+KumzfTQcZa08y9SOr59F+VA0vvNt8Y=; b=ihpQt/rZ9hdNQCzSFYeKe7f7LQH1VkTDMm6t6tmgMcvbEnFAUvj7CxbyJ5m83OrBiT f+GzsmnJbgsAwzqN3tP21SLfjn/xQ5MeMumI2P+uH2Ujrm94P9yyx7QcUj8GyDeLkza6 irSD6I+f3WyDd5gfHJiQSJE6rxfvjKd0dRYiEtxE5Gb4T2y3DRsOhpbuoeHAfTArLWnD TCRbI8rBVqRC5DZwnxGiLl2YSrERj/r9nzgnPsO1MUgxDXevRqVx3pM3NiiV8MpQNZSV Bww2e2RQn9uVi4nyHpfyr/CyHoxZ5w0UDzkTI8bugJIZnmIg5hRU5cKi0c8KCI0stVcI Kihw== X-Gm-Message-State: AFqh2koEhKBcCXuO+SCNTKdjDyUjbRnaJbHnkIIHIYWuAcSGvpnT/1IC 1yVclLGxm5ZqK8IQ6E/wRDE= X-Google-Smtp-Source: AMrXdXsNvkqfT6j8HmsmKrH7FqifRSqm0j/FphLvcrSiVbhnqJHZdakyCGULs2BXzKrIEAyuSm6Ctg== X-Received: by 2002:ac2:484c:0:b0:4a4:68b8:c2b6 with SMTP id 12-20020ac2484c000000b004a468b8c2b6mr252565lfy.13.1673635431051; Fri, 13 Jan 2023 10:43:51 -0800 (PST) Received: from osv.localdomain ([89.175.180.246]) by smtp.gmail.com with ESMTPSA id o11-20020ac2434b000000b004cc9ddce3adsm1261439lfl.82.2023.01.13.10.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 10:43:50 -0800 (PST) From: Sergey Organov To: linux-serial@vger.kernel.org Cc: Fabio Estevam , Greg Kroah-Hartman , Jiri Slaby , Richard Genoud , Sascha Hauer , Shawn Guo , Tim Harvey , =?utf-8?q?Tomasz_Mo=C5=84?= , linux-arm-kernel@lists.infradead.org, NXP Linux Team , Pengutronix Kernel Team , Sergey Organov Subject: [PATCH 7/8] serial: imx: use readl() to optimize FIFO reading loop Date: Fri, 13 Jan 2023 21:43:33 +0300 Message-Id: <20230113184334.287130-8-sorganov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230113184334.287130-1-sorganov@gmail.com> References: <87bko4e65y.fsf@osv.gnss.ru> <20230113184334.287130-1-sorganov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230113_104353_586435_05E059A0 X-CRM114-Status: GOOD ( 12.64 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use readl() instead of heavier imx_uart_readl() in the Rx ISR, as we know we read registers that must not be cached. Signed-off-by: Sergey Organov --- drivers/tty/serial/imx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index be00362b8b67..f4236e8995fa 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -890,14 +890,15 @@ static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) struct imx_port *sport = dev_id; unsigned int rx, flg; struct tty_port *port = &sport->port.state->port; + typeof(sport->port.membase) membase = sport->port.membase; u32 usr2; /* If we received something, check for 0xff flood */ - usr2 = imx_uart_readl(sport, USR2); + usr2 = readl(membase + USR2); if (usr2 & USR2_RDR) imx_uart_check_flood(sport, usr2); - while ((rx = imx_uart_readl(sport, URXD0)) & URXD_CHARRDY) { + while ((rx = readl(membase + URXD0)) & URXD_CHARRDY) { flg = TTY_NORMAL; sport->port.icount.rx++;