lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7f3f0f83-8288-bea4-48a0-38786b18edc4@pengutronix.de>
Date: Thu, 5 Oct 2023 08:28:08 +0200
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Shenwei Wang <shenwei.wang@....com>, "David S. Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
 Maxime Coquelin <mcoquelin.stm32@...il.com>
Cc: imx@...ts.linux.dev, netdev@...r.kernel.org,
 Jose Abreu <joabreu@...opsys.com>, NXP Linux Team <linux-imx@....com>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Mario Castaneda <mario.ignacio.castaneda.lopez@....com>,
 Fabio Estevam <festevam@...il.com>,
 linux-stm32@...md-mailman.stormreply.com,
 linux-arm-kernel@...ts.infradead.org
Subject: Re: [Linux-stm32] [PATCH net] net: stmmac: dwmac-imx: request high
 frequency mode

Hello Shenwei,

On 04.10.23 21:54, Shenwei Wang wrote:
> Some i.MX SoCs like the i.mx8mq support adjusting the frequency of the
> DDR, AHB, and AXI buses based on system loading. If the dwmac interface
> in the driver does not request a HIGH frequency, it can significantly
> degrade performance when the system switches to a lower frequency to
> conserve power.
> 
> For example, on an i.MX8MQ EVK board, the throughput dropped to around
> 100Mbit/s on a 1Gbit connection:
> 
>     [ ID] Interval           Transfer     Bitrate
>     [  5]   0.00-10.00  sec   117 MBytes  97.9 Mbits/sec
> 
> However, throughput can return to expected levels after its driver requests
> the high frequency mode. Requesting high frequency in the dwmac driver is
> essential to maintain full throughput when the i.MX SoC adjusts bus speeds
> for power savings.
> 
> Signed-off-by: Mario Castaneda <mario.ignacio.castaneda.lopez@....com>
> Signed-off-by: Shenwei Wang <shenwei.wang@....com>
> Tested-by: Mario Castaneda <mario.ignacio.castaneda.lopez@....com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> index 8f730ada71f91..ba6ae0465ecaa 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
> @@ -6,6 +6,7 @@
>   *
>   */
>  
> +#include <linux/busfreq-imx.h>
>  #include <linux/clk.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/kernel.h>
> @@ -152,7 +153,9 @@ static int imx_dwmac_clks_config(void *priv, bool enabled)
>  			clk_disable_unprepare(dwmac->clk_mem);
>  			return ret;
>  		}
> +		request_bus_freq(BUS_FREQ_HIGH);

I don't find request_bus_freq in linux-next (next-20231005). AFAIK, it was only ever
suggested as RFC and never went beyond that as a reimplmeentation on top of devfreq
was requested instead of the i.MX-specific API used in the vendor fork.

Did you observe this performance pregression with mainline?

Cheers,
Ahmad


>  	} else {
> +		release_bus_freq(BUS_FREQ_HIGH);
>  		clk_disable_unprepare(dwmac->clk_tx);
>  		clk_disable_unprepare(dwmac->clk_mem);
>  	}

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ