Skip to content

Commit

Permalink
net: phy: call phy_disable_interrupts() in phy_attach_direct() instead
Browse files Browse the repository at this point in the history
Since the micrel phy driver calls phy_init_hw() as a workaround,
the commit 9886a4d ("net: phy: call phy_disable_interrupts()
in phy_init_hw()") disables the interrupt unexpectedly. So,
call phy_disable_interrupts() in phy_attach_direct() instead.
Otherwise, the phy cannot link up after the ethernet cable was
disconnected.

Note that other drivers (like at803x.c) also calls phy_init_hw().
So, perhaps, the driver caused a similar issue too.

Fixes: 9886a4d ("net: phy: call phy_disable_interrupts() in phy_init_hw()")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yoshihiro Shimoda authored and David S. Miller committed Sep 10, 2020
1 parent da26658 commit 7d3ba93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1143,10 +1143,6 @@ int phy_init_hw(struct phy_device *phydev)
if (ret < 0)
return ret;

ret = phy_disable_interrupts(phydev);
if (ret)
return ret;

if (phydev->drv->config_init)
ret = phydev->drv->config_init(phydev);

Expand Down Expand Up @@ -1423,6 +1419,10 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
if (err)
goto error;

err = phy_disable_interrupts(phydev);
if (err)
return err;

phy_resume(phydev);
phy_led_triggers_register(phydev);

Expand Down

0 comments on commit 7d3ba93

Please sign in to comment.