From: Florian Fainelli Date: Fri, 6 Dec 2013 21:01:34 +0000 (-0800) Subject: net: phy: consolidate PHY reset in phy_init_hw() X-Git-Tag: v3.14-rc1~94^2~558^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87aa9f9c61ad56d505641681812e92ad976f8608;p=pandora-kernel.git net: phy: consolidate PHY reset in phy_init_hw() There are quite a lot of drivers touching a PHY device MII_BMCR register to reset the PHY without taking care of: 1) ensuring that BMCR_RESET is cleared after a given timeout 2) the PHY state machine resuming to the proper state and re-applying potentially changed settings such as auto-negotiation Introduce phy_poll_reset() which will take care of polling the MII_BMCR for the BMCR_RESET bit to be cleared after a given timeout or return a timeout error code. In order to make sure the PHY is in a correct state, phy_init_hw() first issues a software reset through MII_BMCR and then applies any fixups. Signed-off-by: Florian Fainelli Signed-off-by: David S. Miller --- Reading git-diff-tree failed