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>] [day] [month] [year] [list]
Message-ID: <trinity-f28f6938-afbc-4059-a149-d220fa8dc6f9-1726430902358@3c-app-gmx-bap07>
Date: Sun, 15 Sep 2024 22:08:22 +0200
From: Hans-Frieder Vogt <hfdevel@....net>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
 Russell King <linux@...linux.org.uk>, FUJITA Tomonori
 <fujita.tomonori@...il.com>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>
Subject: [PATCH net-next v2 6/7] net: tn40xx: optimize mdio speed settings

Optimize MDIO speed settings. The PHYs of all currently supported TN4010
cards support 6 MHz operation. Therefore select 6 MHz already before
devm_mdiobus_register, which also saves another call to
tn40_mdio_set_speed afterwards. As a nice side effect, the loading of the
firmware for the AQR105 PHY is then reduced from 30 s to 5 s.

Remove the write to TN40_REG_MDIO_CMD_STAT in tn40_priv_init, which is
equivalent to tn40_mdio_set_speed to 1 Mhz and therefore would revert the
6 MHz speedup of the MDIO communication.

Signed-off-by: Hans-Frieder Vogt <hfdevel@....net>
---
 drivers/net/ethernet/tehuti/tn40.c      | 1 -
 drivers/net/ethernet/tehuti/tn40_mdio.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c
index 5f73eb1f7d9f..9ccf5cd89663 100644
--- a/drivers/net/ethernet/tehuti/tn40.c
+++ b/drivers/net/ethernet/tehuti/tn40.c
@@ -1642,7 +1642,6 @@ static int tn40_priv_init(struct tn40_priv *priv)
 	/* Set GPIO[9:0] to output 0 */
 	tn40_write_reg(priv, 0x51E0, 0x30010006);	/* GPIO_OE_ WR CMD */
 	tn40_write_reg(priv, 0x51F0, 0x0);	/* GPIO_OE_ DATA */
-	tn40_write_reg(priv, TN40_REG_MDIO_CMD_STAT, 0x3ec8);

 	/* we use tx descriptors to load a firmware. */
 	ret = tn40_create_tx_ring(priv);
diff --git a/drivers/net/ethernet/tehuti/tn40_mdio.c b/drivers/net/ethernet/tehuti/tn40_mdio.c
index 80eb68384389..993458cc4932 100644
--- a/drivers/net/ethernet/tehuti/tn40_mdio.c
+++ b/drivers/net/ethernet/tehuti/tn40_mdio.c
@@ -185,14 +185,13 @@ int tn40_mdiobus_init(struct tn40_priv *priv)
 			ret);
 	}

-	tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_1MHZ);
+	tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ);
 	ret = devm_mdiobus_register(&pdev->dev, bus);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register mdiobus %d %u %u\n",
 			ret, bus->state, MDIOBUS_UNREGISTERED);
 		goto err_swnodes_unregister;
 	}
-	tn40_mdio_set_speed(priv, TN40_MDIO_SPEED_6MHZ);
 	priv->mdio = bus;
 	return 0;

--
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ