Skip to content

Commit 71a165f

Browse files
ffainelligregkh
authored andcommitted
net: phy: Do not perform software reset for Generic PHY
commit 0878fff upstream. The Generic PHY driver is a catch-all PHY driver and it should preserve whatever prior initialization has been done by boot loader or firmware agents. For specific PHY device configuration it is expected that a specialized PHY driver would take over that role. Resetting the generic PHY was a bad idea that has lead to several complaints and downstream workarounds e.g: in OpenWrt/LEDE so restore the behavior prior to 87aa9f9 ("net: phy: consolidate PHY reset in phy_init_hw()"). Reported-by: Felix Fietkau <[email protected]> Fixes: 87aa9f9 ("net: phy: consolidate PHY reset in phy_init_hw()") Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Amit Pundir <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8335b31 commit 71a165f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/net/phy/phy_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ static struct phy_driver genphy_driver[] = {
14421442
.phy_id = 0xffffffff,
14431443
.phy_id_mask = 0xffffffff,
14441444
.name = "Generic PHY",
1445-
.soft_reset = genphy_soft_reset,
1445+
.soft_reset = genphy_no_soft_reset,
14461446
.config_init = genphy_config_init,
14471447
.features = PHY_GBIT_FEATURES | SUPPORTED_MII |
14481448
SUPPORTED_AUI | SUPPORTED_FIBRE |

include/linux/phy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,10 @@ int genphy_read_status(struct phy_device *phydev);
785785
int genphy_suspend(struct phy_device *phydev);
786786
int genphy_resume(struct phy_device *phydev);
787787
int genphy_soft_reset(struct phy_device *phydev);
788+
static inline int genphy_no_soft_reset(struct phy_device *phydev)
789+
{
790+
return 0;
791+
}
788792
void phy_driver_unregister(struct phy_driver *drv);
789793
void phy_drivers_unregister(struct phy_driver *drv, int n);
790794
int phy_driver_register(struct phy_driver *new_driver);

0 commit comments

Comments
 (0)