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 B847FC54EBE for ; Mon, 16 Jan 2023 11:04: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:Message-ID: In-Reply-To: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=K+jRDNjF3oY0K0s7IWIZAqVxSPB2H3OIY8cBmH27Ceo=; b=dV7bS9AjNaiypQ 6HF63Lk7kflb7YscU/vEOJQdxUx33PimCTrikRB38ekC+hrHztyWKK6Wi8GQ6Zi01LfyMSh7smXQK kPuk4nECY8MkCHPKburLIupb329YHHtDp9jqwLrYEJbLqo0KUZFcqOLwywDVLs0/uumvHG5F/tkrN K7IAz57VhWPUSqwZHFxAs2kl5Hme5+fIQHCv3wNs9ZxyJW8IPJp4XHJOUVrrlL0nHoGq0ADxXsTUg 7XOhh5ID/LvT+T1QZfUIHjmmTH5ITBbjXJM9RzwUS1FbO7BO3azOfGNhMUa9qW7YZG327QGviP4LC GgM4w4WKw9y5/Ga2p0ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHNH4-009q7L-0L; Mon, 16 Jan 2023 11:03:34 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHNH0-009q6Q-76 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jan 2023 11:03:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673867010; x=1705403010; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=nVzUMlIkcRKOW6FyXKII1uOTS/tz/e2GWzpaNPjVds8=; b=A0DyQfmBw42Fj6PS9tfYtKrOZUZbPClgYm44+47MNLSGDDrRjdCGJfXA cAv713qzJMHbQ8LvbHr/Jrxv9TRwovWRTJz16r78V66CeRD70qPDKMOkF NR1GPjxBZHfX0IuvHhPGJ2IMXU9RTfJS4v+WJ+qNgHhKN6zTzXR94i96l GHctTJpkFMs+Yhn8TwPqc8xxQkLevAqvYvLT65sbAFf1l5Qw3VyDzGpMv 3f+PW5AwfmcZeEbuvKNOHhlV42wYRC6AF75vaTBZDnRNuH4yXmQRiGXyw HYoSfOivl+i/VY1oN/g5UEl/X/8yotwg8ajHwzuG2ss0LQtRTaAT9e63F g==; X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="351687763" X-IronPort-AV: E=Sophos;i="5.97,220,1669104000"; d="scan'208";a="351687763" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 03:03:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10591"; a="747685689" X-IronPort-AV: E=Sophos;i="5.97,220,1669104000"; d="scan'208";a="747685689" Received: from xsanroma-mobl.ger.corp.intel.com ([10.252.39.155]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2023 03:03:26 -0800 Date: Mon, 16 Jan 2023 13:03:23 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Sergey Organov cc: linux-serial , Fabio Estevam , Greg Kroah-Hartman , Jiri Slaby , Richard Genoud , Sascha Hauer , Shawn Guo , Tim Harvey , =?ISO-8859-2?Q?Tomasz_Mo=F1?= , linux-arm-kernel@lists.infradead.org, NXP Linux Team , Pengutronix Kernel Team Subject: Re: [PATCH 7/8] serial: imx: use readl() to optimize FIFO reading loop In-Reply-To: <20230113184334.287130-8-sorganov@gmail.com> Message-ID: <48ba84e3-7f52-9cfb-426a-a432587c1c9@linux.intel.com> References: <87bko4e65y.fsf@osv.gnss.ru> <20230113184334.287130-1-sorganov@gmail.com> <20230113184334.287130-8-sorganov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_030330_290388_E9BFB980 X-CRM114-Status: GOOD ( 19.10 ) 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, 13 Jan 2023, Sergey Organov wrote: > 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++; I'd just make a uport local variable and use uport->membase + xx. There are plenty of sport->port constructs to replace with uport in that function anyway. -- i. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel