* [PATCH net] net: sfp: ignore disabled SFP node
@ 2022-01-19 16:44 Marek Behún
2022-01-24 12:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Marek Behún @ 2022-01-19 16:44 UTC (permalink / raw)
To: netdev
Cc: Russell King, Andrew Lunn, David S . Miller, Marek Behún, stable
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.
Fixes: ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages")
Signed-off-by: Marek Behún <kabel@kernel.org>
Cc: stable@vger.kernel.org # 2203cbf2c8b5 ("net: sfp: move fwnode parsing into sfp-bus layer")
---
drivers/net/phy/sfp-bus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index 0c6c0d1843bc..c1512c9925a6 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -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)
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: sfp: ignore disabled SFP node
2022-01-19 16:44 [PATCH net] net: sfp: ignore disabled SFP node Marek Behún
@ 2022-01-24 12:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-24 12:00 UTC (permalink / raw)
To: =?utf-8?q?Marek_Beh=C3=BAn_=3Ckabel=40kernel=2Eorg=3E?=
Cc: netdev, rmk+kernel, andrew, davem, stable
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-24 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 16:44 [PATCH net] net: sfp: ignore disabled SFP node Marek Behún
2022-01-24 12:00 ` patchwork-bot+netdevbpf
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).