]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: bcmgenet: update UMAC_CMD only when link is detected
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 11 Aug 2014 21:50:44 +0000 (14:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Aug 2014 22:10:11 +0000 (15:10 -0700)
commitc677ba8b3c47650358572091ed8a6af50bfca877
tree0708972d3881aa53abd1075d39b3bc39cde1022a
parentcc013fb4889892cd6058cfb122c43aeea7d930e8
net: bcmgenet: update UMAC_CMD only when link is detected

When we bring the interface down, phy_stop() will schedule the PHY state
machine to call our link adjustment callback. By the time we do so, we
may have clock gated off the GENET hardware block, and this will cause
bus errors to happen in bcmgenet_mii_setup():

Make sure that we only touch the UMAC_CMD register when there is an
actual link. This is safe to do for two reasons:

- updating the Ethernet MAC registers only make sense when a physical
  link is present
- the PHY library state machine first set phydev->link = 0 before
  invoking phydev->adjust_link in the PHY_HALTED case

Fixes: 240524089d7a ("net: bcmgenet: only update UMAC_CMD if something changed")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/genet/bcmmii.c