]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: re-apply PHY fixups during phy_register_device
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 28 Jul 2014 23:28:07 +0000 (16:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jul 2014 19:25:57 +0000 (12:25 -0700)
commit3c5bfd5d29bc6929beb526a9c1c3aec79a283b8e
tree65d0c7e059c868ca7b01145a14b412baa4af62a3
parent7be487d97a49efd6000375d6651627a00619eef7
net: phy: re-apply PHY fixups during phy_register_device

Commit aa86ccbba23f ("net: phy: consolidate PHY reset in phy_init_hw()")
moved the call to phy_scan_fixups() in phy_init_hw() after a software
reset is performed.

By the time phy_init_hw() is called in phy_device_register(), no driver
has been bound to this PHY yet, so all the checks in phy_init_hw()
against the PHY driver and the PHY driver's config_init function will
return 0. We will therefore never call phy_scan_fixups() as we should.

Fix this by calling phy_scan_fixups() and check for its return value to
restore the intended functionality.

This broke PHY drivers which do register an early PHY fixup callback to
intercept the PHY probing and do things like changing the 32-bits unique
PHY identifier when a pseudo-PHY address has been used, as well as
board-specific PHY fixups that need to be applied during driver probe
time.

Reported-by: Hauke Merthens <hauke-m@hauke-m.de>
Reported-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c