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-next>] [day] [month] [year] [list]
Message-Id: <20231004195442.414766-1-shenwei.wang@nxp.com>
Date: Wed,  4 Oct 2023 14:54:42 -0500
From: Shenwei Wang <shenwei.wang@....com>
To: "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: Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Jose Abreu <joabreu@...opsys.com>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	NXP Linux Team <linux-imx@....com>,
	netdev@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-stm32@...md-mailman.stormreply.com,
	imx@...ts.linux.dev,
	Shenwei Wang <shenwei.wang@....com>,
	Mario Castaneda <mario.ignacio.castaneda.lopez@....com>
Subject: [PATCH net] net: stmmac: dwmac-imx: request high frequency mode

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);
 	} else {
+		release_bus_freq(BUS_FREQ_HIGH);
 		clk_disable_unprepare(dwmac->clk_tx);
 		clk_disable_unprepare(dwmac->clk_mem);
 	}
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ