diff mbox series

[net,v2] net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled

Message ID 20240516165631.1929731-1-florian.fainelli@broadcom.com (mailing list archive)
State Accepted
Commit b1fa60ec252fba39130107074becd12d0b3f83ec
Delegated to: Netdev Maintainers
Headers show
Series [net,v2] net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 922 this patch: 922
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 925 this patch: 925
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 927 this patch: 927
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-05-19--03-00 (tests: 1039)

Commit Message

Florian Fainelli May 16, 2024, 4:56 p.m. UTC
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.

Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
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(-)

Comments

Vladimir Oltean May 17, 2024, 3:17 p.m. UTC | #1
On Thu, May 16, 2024 at 09:56:30AM -0700, Florian Fainelli wrote:
> 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.
> 
> Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
> Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Alexander Lobakin May 17, 2024, 3:17 p.m. UTC | #2
From: Florian Fainelli <florian.fainelli@broadcom.com>
Date: Thu, 16 May 2024 09:56:30 -0700

> 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.
> 
> Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
> Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>

> ---
> 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(-)
> 
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 9c053673d6b2..13743d0e83b5 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -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
patchwork-bot+netdevbpf@kernel.org May 20, 2024, 10:10 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 16 May 2024 09:56:30 -0700 you wrote:
> 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/".
> 
> [...]

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!
diff mbox series

Patch

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 9c053673d6b2..13743d0e83b5 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -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/