net: sfp: do not probe SFP module before we're attached
authorRussell King <rmk+kernel@armlinux.org.uk>
Wed, 6 Feb 2019 10:52:30 +0000 (10:52 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:06 +0000 (10:08 +0100)
commitc4ba68b8691e4879cc43c37ad395ea529709bf81
tree1f9222ab82c73043f8ef2f72a3dc7b63797e9d8d
parent2226f9592422c320e37585825a4f7b8bfb8c8504
net: sfp: do not probe SFP module before we're attached

[ Upstream commit b5bfc21af5cb3d53f9cee0ef82eaa43762a90f81 ]

When we probe a SFP module, we expect to be able to call the upstream
device's module_insert() function so that the upstream link can be
configured.  However, when the upstream device is delayed, we currently
may end up probing the module before the upstream device is available,
and lose the module_insert() call.

Avoid this by holding off probing the module until the SFP bus is
properly connected to both the SFP socket driver and the upstream
driver.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/sfp-bus.c
drivers/net/phy/sfp.c
drivers/net/phy/sfp.h