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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200625152331.3784018-7-olteanv@gmail.com>
Date:   Thu, 25 Jun 2020 18:23:30 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     davem@...emloft.net, netdev@...r.kernel.org
Cc:     andrew@...n.ch, f.fainelli@...il.com, vivien.didelot@...il.com,
        claudiu.manoil@....com, alexandru.marginean@....com,
        ioana.ciornei@....com, linux@...linux.org.uk
Subject: [PATCH net-next 6/7] net: dsa: felix: disable in-band AN in MII_BMCR without reset

From: Vladimir Oltean <vladimir.oltean@....com>

The PCS doesn't need to be reset, we just need to clear BMCR_ANENABLE.
Since the only writable fields of MII_BMCR in this PCS are:

- BMCR_RESET
- BMCR_LOOPBACK
- BMCR_ANENABLE
- BMCR_PDOWN
- BMCR_ISOLATE
- BMCR_ANRESTART

it's safe to write zero to disable in-band AN.

Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 7d2673dab7d3..dba62c609efc 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -807,7 +807,7 @@ static void vsc9959_pcs_init_sgmii(struct phy_device *pcs,
 			if_mode |= ENETC_PCS_IF_MODE_DUPLEX_HALF;
 
 		phy_write(pcs, ENETC_PCS_IF_MODE, if_mode);
-		phy_write(pcs, MII_BMCR, BMCR_RESET);
+		phy_write(pcs, MII_BMCR, 0);
 	}
 }
 
@@ -844,7 +844,7 @@ static void vsc9959_pcs_init_2500basex(struct phy_device *pcs,
 		if_mode |= ENETC_PCS_IF_MODE_DUPLEX_HALF;
 
 	phy_write(pcs, ENETC_PCS_IF_MODE, if_mode);
-	phy_write(pcs, MII_BMCR, BMCR_RESET);
+	phy_write(pcs, MII_BMCR, 0);
 }
 
 static void vsc9959_pcs_init_usxgmii(struct phy_device *pcs,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ