net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled
Subsystems (2)
PATCH v2 1/1 net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled
Stephen reported that he was unable to get the dsa_loop driver to get probed, and the reason ended up being because he had CONFIG_FIXED_PHY=y in his kernel configuration. As Masahiro explained it:
"obj-m += dsa/" means everything under dsa/ must be modular.
If there is a built-in object under dsa/ with CONFIG_NET_DSA=m, you cannot do "obj-$(CONFIG_NET_DSA) += dsa/".
You need to change it back to "obj-y += dsa/".
This was the case here whereby CONFIG_NET_DSA=m, and so the obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdinfo.o rule is not executed and the DSA loop mdio_board info structure is not registered with the kernel, and eventually the device is simply not found.
To preserve the intention of the original commit of limiting the amount of folder descending, conditionally descend into drivers/net/dsa when CONFIG_NET_DSA is enabled.
---
Changes in v2:
- conditionally descend into the dsa folder based upon CONFIG_NET_DSA
- change subject a bit to reflect the change
drivers/net/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/Makefile +3 -1
@@ -49,7 +49,9 @@ obj-$(CONFIG_MHI_NET) += mhi_net.o obj-$(CONFIG_ARCNET) += arcnet/ obj-$(CONFIG_CAIF) += caif/ obj-$(CONFIG_CAN) += can/ -obj-$(CONFIG_NET_DSA) += dsa/ +ifdef CONFIG_NET_DSA +obj-y += dsa/ +endif obj-$(CONFIG_ETHERNET) += ethernet/ obj-$(CONFIG_FDDI) += fddi/ obj-$(CONFIG_HIPPI) += hippi/
Signature · 1 line
2.34.1
Quoted 16 lines · Florian Fainelli
Stephen reported that he was unable to get the
dsa_loopdriver to get probed, and the reason ended up being because he hadCONFIG_FIXED_PHY=yin his kernel configuration. As Masahiro explained it:"obj-m += dsa/" means everything under dsa/ must be modular.
If there is a built-in object under dsa/ with
CONFIG_NET_DSA=m, you cannot do "obj-$(CONFIG_NET_DSA) += dsa/".You need to change it back to "obj-y += dsa/".
This was the case here whereby
CONFIG_NET_DSA=m, and so the obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdinfo.o rule is not executed and the DSA loopmdio_boardinfo structure is not registered with the kernel, and eventually the device is simply not found.
Quoted 8 lines
To preserve the intention of the original commit of limiting the amount of folder descending, conditionally descend into
drivers/net/dsawhenCONFIG_NET_DSAis enabled.Fixes 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")Reported-by Stephen Langstaff <[email protected]>Signed-off-by Florian Fainelli <[email protected]>---
From: Florian Fainelli <[email protected]>
Date: Thu, 16 May 2024 09:56:30 -0700
Quoted 16 lines
Stephen reported that he was unable to get the
dsa_loopdriver to get probed, and the reason ended up being because he hadCONFIG_FIXED_PHY=yin his kernel configuration. As Masahiro explained it:"obj-m += dsa/" means everything under dsa/ must be modular.
If there is a built-in object under dsa/ with
CONFIG_NET_DSA=m, you cannot do "obj-$(CONFIG_NET_DSA) += dsa/".You need to change it back to "obj-y += dsa/".
This was the case here whereby
CONFIG_NET_DSA=m, and so the obj-$(CONFIG_FIXED_PHY) += dsa_loop_bdinfo.o rule is not executed and the DSA loopmdio_boardinfo structure is not registered with the kernel, and eventually the device is simply not found.
Quoted 7 lines
To preserve the intention of the original commit of limiting the amount of folder descending, conditionally descend into
drivers/net/dsawhenCONFIG_NET_DSAis enabled.Fixes 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")Reported-by Stephen Langstaff <[email protected]>Signed-off-by Florian Fainelli <[email protected]>
Quoted 14 lines
---
Changes in v2:- conditionally descend into the dsa folder based upon
CONFIG_NET_DSA
- change subject a bit to reflect the changedrivers/net/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/Makefile +0
-0
drivers/net/Makefile obj-$(CONFIG_MHI_NET) += mhi_net.o · line 57
Quoted 10 lines
drivers/net/Makefile +3
-1@@ -49,7 +49,9 @@ obj-$(CONFIG_MHI_NET) += mhi_net.o obj-$(CONFIG_ARCNET) += arcnet/ obj-$(CONFIG_CAIF) += caif/ obj-$(CONFIG_CAN) += can/ -obj-$(CONFIG_NET_DSA) += dsa/ +ifdef CONFIG_NET_DSA +obj-y += dsa/ +endif obj-$(CONFIG_ETHERNET) += ethernet/ obj-$(CONFIG_FDDI) += fddi/ obj-$(CONFIG_HIPPI) += hippi/
Thanks,
Olek
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:
Quoted 10 lines · On Thu, 16 May 2024 09:56:30 -0700 you wrote:
Stephen reported that he was unable to get the
dsa_loopdriver to get probed, and the reason ended up being because he hadCONFIG_FIXED_PHY=yin his kernel configuration. As Masahiro explained it:"obj-m += dsa/" means everything under dsa/ must be modular.
If there is a built-in object under dsa/ with
CONFIG_NET_DSA=m, you cannot do "obj-$(CONFIG_NET_DSA) += dsa/".[...]
Here is the summary with links:
- [net,v2] net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled
https://git.kernel.org/netdev/net/c/b1fa60ec252f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html