sfp: fix module initialisation with netdev already up
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 10 Jul 2018 11:05:36 +0000 (12:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:07:07 +0000 (13:07 +0200)
commit7fdaa8e0ce366957d3203387a613b5bc08b538bc
treeb89430a1c7cc8b59a163d29ec97f2e2fc8c8eebc
parente756fc5b02c62e57c4124f562e1e8888a346b953
sfp: fix module initialisation with netdev already up

[ Upstream commit 576cd32082351620a4e76b8babc4d5ae9b4bbb98 ]

It was been observed that with a particular order of initialisation,
the netdev can be up, but the SFP module still has its TX_DISABLE
signal asserted.  This occurs when the network device brought up before
the SFP kernel module has been inserted by userspace.

This occurs because sfp-bus layer does not hear about the change in
network device state, and so assumes that it is still down.  Set
netdev->sfp when the upstream is registered to work around this problem.

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