]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: fix resume handling
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 12 Dec 2017 10:45:36 +0000 (10:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Dec 2017 20:00:10 +0000 (15:00 -0500)
commit271a2e88569792562e841532dadd94beeaa467af
treec3bac205223f88e42ad6c7e0f5fbde9c6ca1a553
parentd579fdb698a9c68a6098ffb9363b35d753199f6f
net: phy: fix resume handling

When a PHY has the BMCR_PDOWN bit set, it may decide to ignore writes
to other registers, or reset the registers to power-on defaults.
Micrel PHYs do this for their interrupt registers.

The current structure of phylib tries to enable interrupts before
resuming (and releasing) the BMCR_PDOWN bit.  This fails, causing
Micrel PHYs to stop working after a suspend/resume sequence if they
are using interrupts.

Fix this by ensuring that the PHY driver resume methods do not take
the phydev->lock mutex themselves, but the callers of phy_resume()
take that lock.  This then allows us to move the call to phy_resume()
before we enable interrupts in phy_start().

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/at803x.c
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c