net: sfp: ignore disabled SFP node
Subsystems (5)
PATCH 1/1 net: sfp: ignore disabled SFP node
Commit ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages") added code which finds SFP bus DT node even if the node is disabled with status = "disabled". Because of this, when phylink is created, it ends with non-null .sfp_bus member, even though the SFP module is not probed (because the node is disabled).
We need to ignore disabled SFP bus node.
--- drivers/net/phy/sfp-bus.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/phy/sfp-bus.c +5 -0
@@ -651,6 +651,11 @@ struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)else if (ret <0 )return ERR_PTR (ret); +if (!fwnode_device_is_available (ref.fwnode)) { +fwnode_handle_put (ref.fwnode); +return NULL ; + } + bus =sfp_bus_get (ref.fwnode);fwnode_handle_put (ref.fwnode);if (!bus)
Signature · 1 line
2.34.1
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 9 lines · On Wed, 19 Jan 2022 17:44:55 +0100 you wrote:
Commit
ce0aa27ff3f6("sfp: add sfp-bus to bridge between network devices and sfp cages") added code which finds SFP bus DT node even if the node is disabled with status = "disabled". Because of this, when phylink is created, it ends with non-null .sfp_bus member, even though the SFP module is not probed (because the node is disabled).We need to ignore disabled SFP bus node.
[...]
Here is the summary with links:
- [net] net: sfp: ignore disabled SFP node
https://git.kernel.org/netdev/net/c/2148927e6ed4
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html