* [PATCH net 2/2] sfp: fix module initialisation with netdev already up
@ 2018-07-10 11:05 Russell King
2018-07-12 6:12 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2018-07-10 11:05 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli; +Cc: David S. Miller, netdev
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>
---
drivers/net/phy/sfp-bus.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index e355e7db54a7..5e5fcc33421e 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -342,7 +342,6 @@ static int sfp_register_bus(struct sfp_bus *bus)
}
if (bus->started)
bus->socket_ops->start(bus->sfp);
- bus->netdev->sfp_bus = bus;
bus->registered = true;
return 0;
}
@@ -357,7 +356,6 @@ static void sfp_unregister_bus(struct sfp_bus *bus)
if (bus->phydev && ops && ops->disconnect_phy)
ops->disconnect_phy(bus->upstream);
}
- bus->netdev->sfp_bus = NULL;
bus->registered = false;
}
@@ -433,6 +431,7 @@ static void sfp_upstream_clear(struct sfp_bus *bus)
{
bus->upstream_ops = NULL;
bus->upstream = NULL;
+ bus->netdev->sfp_bus = NULL;
bus->netdev = NULL;
}
@@ -461,6 +460,7 @@ struct sfp_bus *sfp_register_upstream(struct fwnode_handle *fwnode,
bus->upstream_ops = ops;
bus->upstream = upstream;
bus->netdev = ndev;
+ ndev->sfp_bus = bus;
if (bus->sfp) {
ret = sfp_register_bus(bus);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 2/2] sfp: fix module initialisation with netdev already up
2018-07-10 11:05 [PATCH net 2/2] sfp: fix module initialisation with netdev already up Russell King
@ 2018-07-12 6:12 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-12 6:12 UTC (permalink / raw)
To: rmk+kernel; +Cc: andrew, f.fainelli, netdev
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Tue, 10 Jul 2018 12:05:36 +0100
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-12 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-10 11:05 [PATCH net 2/2] sfp: fix module initialisation with netdev already up Russell King
2018-07-12 6:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).