Netdev List
 help / color / mirror / Atom feed
* [PATCH] igc: fix LEDS_CLASS dependency
@ 2024-02-22 10:02 Arnd Bergmann
  2024-02-22 10:18 ` Kurt Kanzenbach
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2024-02-22 10:02 UTC (permalink / raw)
  To: Jesse Brandeburg, Tony Nguyen
  Cc: Arnd Bergmann, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, intel-wired-lan, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When IGC is built-in but LEDS_CLASS is a loadable module, there is
a link failure:

x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'

Add another dependency that prevents this combination.

Fixes: ea578703b03d ("igc: Add support for LEDs on i225/i226")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/intel/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
index af7fa6856707..6e7901e12699 100644
--- a/drivers/net/ethernet/intel/Kconfig
+++ b/drivers/net/ethernet/intel/Kconfig
@@ -372,6 +372,7 @@ config IGC
 config IGC_LEDS
 	def_bool LEDS_TRIGGER_NETDEV
 	depends on IGC && LEDS_CLASS
+	depends on LEDS_CLASS=y || IGC=m
 	help
 	  Optional support for controlling the NIC LED's with the netdev
 	  LED trigger.
-- 
2.39.2


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

* Re: [PATCH] igc: fix LEDS_CLASS dependency
  2024-02-22 10:02 [PATCH] igc: fix LEDS_CLASS dependency Arnd Bergmann
@ 2024-02-22 10:18 ` Kurt Kanzenbach
  2024-02-22 10:21 ` [Intel-wired-lan] " Paul Menzel
  2024-02-23 23:15 ` Tony Nguyen
  2 siblings, 0 replies; 5+ messages in thread
From: Kurt Kanzenbach @ 2024-02-22 10:18 UTC (permalink / raw)
  To: Arnd Bergmann, Jesse Brandeburg, Tony Nguyen
  Cc: Arnd Bergmann, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, intel-wired-lan, netdev, linux-kernel

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

On Thu Feb 22 2024, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When IGC is built-in but LEDS_CLASS is a loadable module, there is
> a link failure:
>
> x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
> igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'
>
> Add another dependency that prevents this combination.
>
> Fixes: ea578703b03d ("igc: Add support for LEDs on i225/i226")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Ops, sorry. I tried to build all different combinations, but obviously
failed. Thanks for fixing this.

Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

* Re: [Intel-wired-lan] [PATCH] igc: fix LEDS_CLASS dependency
  2024-02-22 10:02 [PATCH] igc: fix LEDS_CLASS dependency Arnd Bergmann
  2024-02-22 10:18 ` Kurt Kanzenbach
@ 2024-02-22 10:21 ` Paul Menzel
  2024-02-23 23:15 ` Tony Nguyen
  2 siblings, 0 replies; 5+ messages in thread
From: Paul Menzel @ 2024-02-22 10:21 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jesse Brandeburg, Tony Nguyen, Andrew Lunn, Arnd Bergmann, netdev,
	linux-kernel, Eric Dumazet, intel-wired-lan, Jakub Kicinski,
	Paolo Abeni, David S. Miller

Dear Arnd,


Thank you for the patch.


Am 22.02.24 um 11:02 schrieb Arnd Bergmann:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When IGC is built-in but LEDS_CLASS is a loadable module, there is
> a link failure:
> 
> x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
> igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'
> 
> Add another dependency that prevents this combination.
> 
> Fixes: ea578703b03d ("igc: Add support for LEDs on i225/i226")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/net/ethernet/intel/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
> index af7fa6856707..6e7901e12699 100644
> --- a/drivers/net/ethernet/intel/Kconfig
> +++ b/drivers/net/ethernet/intel/Kconfig
> @@ -372,6 +372,7 @@ config IGC
>   config IGC_LEDS
>   	def_bool LEDS_TRIGGER_NETDEV
>   	depends on IGC && LEDS_CLASS
> +	depends on LEDS_CLASS=y || IGC=m

Should it be ordered as the line above?

>   	help
>   	  Optional support for controlling the NIC LED's with the netdev
>   	  LED trigger.


Kind regards,

Paul

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

* Re: [PATCH] igc: fix LEDS_CLASS dependency
  2024-02-22 10:02 [PATCH] igc: fix LEDS_CLASS dependency Arnd Bergmann
  2024-02-22 10:18 ` Kurt Kanzenbach
  2024-02-22 10:21 ` [Intel-wired-lan] " Paul Menzel
@ 2024-02-23 23:15 ` Tony Nguyen
  2024-02-24  7:50   ` Arnd Bergmann
  2 siblings, 1 reply; 5+ messages in thread
From: Tony Nguyen @ 2024-02-23 23:15 UTC (permalink / raw)
  To: Arnd Bergmann, Jesse Brandeburg
  Cc: Arnd Bergmann, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, intel-wired-lan, netdev, linux-kernel



On 2/22/2024 2:02 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> When IGC is built-in but LEDS_CLASS is a loadable module, there is
> a link failure:
> 
> x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup':
> igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext'
> 
> Add another dependency that prevents this combination.
> 
> Fixes: ea578703b03d ("igc: Add support for LEDs on i225/i226")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/net/ethernet/intel/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
> index af7fa6856707..6e7901e12699 100644
> --- a/drivers/net/ethernet/intel/Kconfig
> +++ b/drivers/net/ethernet/intel/Kconfig
> @@ -372,6 +372,7 @@ config IGC
>   config IGC_LEDS
>   	def_bool LEDS_TRIGGER_NETDEV
>   	depends on IGC && LEDS_CLASS
> +	depends on LEDS_CLASS=y || IGC=m

I don't know kbuild that well, but would this cover LEDS_CLASS=n with IGC=m?

There are Similar checks in the file [1][2] that would transpose to
  depends on IGC && LEDS_CLASS && !(IGC=y && LEDS_CLASS=m)

which should cover that and keep the checks in the file consistent. IMO 
a little more readable as well.

Thanks,
Tony

[1] 
https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/intel/Kconfig#L109
[2] 
https://elixir.bootlin.com/linux/latest/source/drivers/net/ethernet/intel/Kconfig#L161

>   	help
>   	  Optional support for controlling the NIC LED's with the netdev
>   	  LED trigger.

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

* Re: [PATCH] igc: fix LEDS_CLASS dependency
  2024-02-23 23:15 ` Tony Nguyen
@ 2024-02-24  7:50   ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2024-02-24  7:50 UTC (permalink / raw)
  To: Anthony L Nguyen, Arnd Bergmann, Jesse Brandeburg
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, intel-wired-lan@lists.osuosl.org, Netdev,
	linux-kernel

On Sat, Feb 24, 2024, at 00:15, Tony Nguyen wrote:
> On 2/22/2024 2:02 AM, Arnd Bergmann wrote:
>> 
>> diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig
>> index af7fa6856707..6e7901e12699 100644
>> --- a/drivers/net/ethernet/intel/Kconfig
>> +++ b/drivers/net/ethernet/intel/Kconfig
>> @@ -372,6 +372,7 @@ config IGC
>>   config IGC_LEDS
>>   	def_bool LEDS_TRIGGER_NETDEV
>>   	depends on IGC && LEDS_CLASS
>> +	depends on LEDS_CLASS=y || IGC=m
>
> I don't know kbuild that well, but would this cover LEDS_CLASS=n with IGC=m?

The 'depends on LEDS_CLASS' take care of that.

> There are Similar checks in the file [1][2] that would transpose to
>   depends on IGC && LEDS_CLASS && !(IGC=y && LEDS_CLASS=m)
>
> which should cover that and keep the checks in the file consistent. IMO 
> a little more readable as well.

Right, that works as well. I find the negative dependencies
slightly more confusing, they should do the same thing here.
Please apply whichever version makes most sense to you then.

     Arnd

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

end of thread, other threads:[~2024-02-24  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-22 10:02 [PATCH] igc: fix LEDS_CLASS dependency Arnd Bergmann
2024-02-22 10:18 ` Kurt Kanzenbach
2024-02-22 10:21 ` [Intel-wired-lan] " Paul Menzel
2024-02-23 23:15 ` Tony Nguyen
2024-02-24  7:50   ` Arnd Bergmann

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