public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: Always descend into dsa/ folder
@ 2024-05-16  3:33 Florian Fainelli
  2024-05-16  8:58 ` Alexander Lobakin
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2024-05-16  3:33 UTC (permalink / raw)
  To: netdev
  Cc: masahiroy, aleksander.lobakin, Florian Fainelli,
	Stephen Langstaff, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Alexander Lobakin, Florian Fainelli, Vladimir Oltean,
	open list

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.

Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
 drivers/net/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 9c053673d6b2..0f6f0f091e0e 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -49,7 +49,7 @@ obj-$(CONFIG_MHI_NET) += mhi_net.o
 obj-$(CONFIG_ARCNET) += arcnet/
 obj-$(CONFIG_CAIF) += caif/
 obj-$(CONFIG_CAN) += can/
-obj-$(CONFIG_NET_DSA) += dsa/
+obj-y += dsa/
 obj-$(CONFIG_ETHERNET) += ethernet/
 obj-$(CONFIG_FDDI) += fddi/
 obj-$(CONFIG_HIPPI) += hippi/
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: Always descend into dsa/ folder
  2024-05-16  3:33 [PATCH net] net: Always descend into dsa/ folder Florian Fainelli
@ 2024-05-16  8:58 ` Alexander Lobakin
  2024-05-16 16:05   ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lobakin @ 2024-05-16  8:58 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, masahiroy, Stephen Langstaff, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
	Florian Fainelli, Vladimir Oltean, open list

From: Florian Fainelli <florian.fainelli@broadcom.com>
Date: Wed, 15 May 2024 20:33:45 -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.
> 
> Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
> Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
>  drivers/net/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 9c053673d6b2..0f6f0f091e0e 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -49,7 +49,7 @@ obj-$(CONFIG_MHI_NET) += mhi_net.o
>  obj-$(CONFIG_ARCNET) += arcnet/
>  obj-$(CONFIG_CAIF) += caif/
>  obj-$(CONFIG_CAN) += can/
> -obj-$(CONFIG_NET_DSA) += dsa/
> +obj-y += dsa/

obj-$(CONFIG_NET_DSA:m=y) += dsa/

?

or

ifdef CONFIG_NET_DSA
obj-y += dsa/
endif

I don't like always adding folders even if nothing will be built there
as we then have a lot of folders with just empty built-in.a.

>  obj-$(CONFIG_ETHERNET) += ethernet/
>  obj-$(CONFIG_FDDI) += fddi/
>  obj-$(CONFIG_HIPPI) += hippi/

Thanks,
Olek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: Always descend into dsa/ folder
  2024-05-16  8:58 ` Alexander Lobakin
@ 2024-05-16 16:05   ` Florian Fainelli
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2024-05-16 16:05 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: netdev, masahiroy, Stephen Langstaff, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Alexander Lobakin,
	Florian Fainelli, Vladimir Oltean, open list

[-- Attachment #1: Type: text/plain, Size: 1910 bytes --]

On 5/16/24 01:58, Alexander Lobakin wrote:
> From: Florian Fainelli <florian.fainelli@broadcom.com>
> Date: Wed, 15 May 2024 20:33:45 -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.
>>
>> Fixes: 227d72063fcc ("dsa: simplify Kconfig symbols and dependencies")
>> Reported-by: Stephen Langstaff <stephenlangstaff1@gmail.com>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>>   drivers/net/Makefile | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
>> index 9c053673d6b2..0f6f0f091e0e 100644
>> --- a/drivers/net/Makefile
>> +++ b/drivers/net/Makefile
>> @@ -49,7 +49,7 @@ obj-$(CONFIG_MHI_NET) += mhi_net.o
>>   obj-$(CONFIG_ARCNET) += arcnet/
>>   obj-$(CONFIG_CAIF) += caif/
>>   obj-$(CONFIG_CAN) += can/
>> -obj-$(CONFIG_NET_DSA) += dsa/
>> +obj-y += dsa/
> 
> obj-$(CONFIG_NET_DSA:m=y) += dsa/
> 
> ?
> 
> or
> 
> ifdef CONFIG_NET_DSA
> obj-y += dsa/
> endif
> 
> I don't like always adding folders even if nothing will be built there
> as we then have a lot of folders with just empty built-in.a.

Sounds good, I prefer the second version which is clearer IMHO, will 
spin a v2 in the next few hours. Thanks!
-- 
Florian


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-16 16:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16  3:33 [PATCH net] net: Always descend into dsa/ folder Florian Fainelli
2024-05-16  8:58 ` Alexander Lobakin
2024-05-16 16:05   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox