]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: mdio-boardinfo: Allow recursive mdiobus_register()
authorAndrew Lunn <andrew@lunn.ch>
Thu, 19 Apr 2018 00:00:47 +0000 (02:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Apr 2018 14:33:26 +0000 (10:33 -0400)
commit17624448cac4788cb35a2e8964d798327036eed8
tree0260c91048a8ee0ad96fbfd9093cd04ba72db1ab
parentb322a8435f26982d635e528c9ebc60847ad0244c
net: phy: mdio-boardinfo: Allow recursive mdiobus_register()

mdiobus_register will search for any mdiobus board info registered for
the bus being registered. If found, it will probe devices on the bus.
That device, if for example it is an ethernet switch, may then try to
register an mdio bus. Thus we need to allow recursive calls to
mdiobus_register.

Holding the mdio_board_lock will cause a deadlock during this
recursion. Release the lock and use list_for_each_entry_safe.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-boardinfo.c