linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: select MAC80211_LEDS conditionally
@ 2021-06-24 10:08 Liwei Song
  2021-06-24 10:41 ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Liwei Song @ 2021-06-24 10:08 UTC (permalink / raw)
  To: Luca Coelho, Kalle Valo, David, Jakub Kicinski, linux-wireless
  Cc: netdev, linux-kernel, liwei.song

MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211,
add condition to enable it in iwlwifi/Kconfig to avoid below
compile warning when LEDS_CLASS was set to m:

WARNING: unmet direct dependencies detected for MAC80211_LEDS
  Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y])
  Selected by [m]:
  - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m])

Signed-off-by: Liwei Song <liwei.song@windriver.com>
---
 drivers/net/wireless/intel/iwlwifi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/Kconfig b/drivers/net/wireless/intel/iwlwifi/Kconfig
index 1085afbefba8..0e1de69c259f 100644
--- a/drivers/net/wireless/intel/iwlwifi/Kconfig
+++ b/drivers/net/wireless/intel/iwlwifi/Kconfig
@@ -50,7 +50,7 @@ config IWLWIFI_LEDS
 	depends on LEDS_CLASS=y || LEDS_CLASS=IWLWIFI
 	depends on IWLMVM || IWLDVM
 	select LEDS_TRIGGERS
-	select MAC80211_LEDS
+	select MAC80211_LEDS if (LEDS_CLASS=y || LEDS_CLASS=MAC80211)
 	default y
 
 config IWLDVM
-- 
2.17.1


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

* Re: [PATCH] iwlwifi: select MAC80211_LEDS conditionally
  2021-06-24 10:08 [PATCH] iwlwifi: select MAC80211_LEDS conditionally Liwei Song
@ 2021-06-24 10:41 ` Kalle Valo
  2021-06-24 11:06   ` Liwei Song
  0 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2021-06-24 10:41 UTC (permalink / raw)
  To: Liwei Song
  Cc: Luca Coelho, David, Jakub Kicinski, linux-wireless, netdev, linux-kernel

Liwei Song <liwei.song@windriver.com> writes:

> MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211,
> add condition to enable it in iwlwifi/Kconfig to avoid below
> compile warning when LEDS_CLASS was set to m:
>
> WARNING: unmet direct dependencies detected for MAC80211_LEDS
>   Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y])
>   Selected by [m]:
>   - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m])
>
> Signed-off-by: Liwei Song <liwei.song@windriver.com>

Is this is a new regression or an old bug? What commit caused this?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH] iwlwifi: select MAC80211_LEDS conditionally
  2021-06-24 10:41 ` Kalle Valo
@ 2021-06-24 11:06   ` Liwei Song
  2021-07-26  9:26     ` Liwei Song
  2021-08-05 13:44     ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Liwei Song @ 2021-06-24 11:06 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Luca Coelho, David, Jakub Kicinski, linux-wireless, netdev, linux-kernel



On 6/24/21 18:41, Kalle Valo wrote:
> Liwei Song <liwei.song@windriver.com> writes:
> 
>> MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211,
>> add condition to enable it in iwlwifi/Kconfig to avoid below
>> compile warning when LEDS_CLASS was set to m:
>>
>> WARNING: unmet direct dependencies detected for MAC80211_LEDS
>>   Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y])
>>   Selected by [m]:
>>   - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m])
>>
>> Signed-off-by: Liwei Song <liwei.song@windriver.com>
> 
> Is this is a new regression or an old bug? What commit caused this?

It should be exist when the below commit change the dependency of MAC80211_LEDS
to fix some build error:

commit b64acb28da8394485f0762e657470c9fc33aca4d
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Jan 25 12:36:42 2021 +0100

    ath9k: fix build error with LEDS_CLASS=m
    
    When CONFIG_ATH9K is built-in but LED support is in a loadable
    module, both ath9k drivers fails to link:
    
    x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_deinit_leds':
    gpio.c:(.text+0x36): undefined reference to `led_classdev_unregister'
    x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_init_leds':
    gpio.c:(.text+0x179): undefined reference to `led_classdev_register_ext'
    
    The problem is that the 'imply' keyword does not enforce any dependency
    but is only a weak hint to Kconfig to enable another symbol from a
    defconfig file.
    
    Change imply to a 'depends on LEDS_CLASS' that prevents the incorrect
    configuration but still allows building the driver without LED support.
    
    The 'select MAC80211_LEDS' is now ensures that the LED support is
    actually used if it is present, and the added Kconfig dependency
    on MAC80211_LEDS ensures that it cannot be enabled manually when it
    has no effect.
    
    Fixes: 197f466e93f5 ("ath9k_htc: Do not select MAC80211_LEDS by default")
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Johannes Berg <johannes@sipsolutions.net>
    Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20210125113654.2408057-1-arnd@kernel.org

diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
index cd9a9bd242ba..51ec8256b7fa 100644
--- a/net/mac80211/Kconfig
+++ b/net/mac80211/Kconfig
@@ -69,7 +69,7 @@ config MAC80211_MESH
 config MAC80211_LEDS
        bool "Enable LED triggers"
        depends on MAC80211
-       depends on LEDS_CLASS
+       depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211


Thanks,
Liwei.


> 

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

* Re: [PATCH] iwlwifi: select MAC80211_LEDS conditionally
  2021-06-24 11:06   ` Liwei Song
@ 2021-07-26  9:26     ` Liwei Song
  2021-08-05 13:44     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Liwei Song @ 2021-07-26  9:26 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Luca Coelho, David, Jakub Kicinski, linux-wireless, netdev, linux-kernel

Hi,

Any suggestion about this patch?

Thanks,
Liwei.

On 6/24/21 19:06, Liwei Song wrote:
> 
> 
> On 6/24/21 18:41, Kalle Valo wrote:
>> Liwei Song <liwei.song@windriver.com> writes:
>>
>>> MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211,
>>> add condition to enable it in iwlwifi/Kconfig to avoid below
>>> compile warning when LEDS_CLASS was set to m:
>>>
>>> WARNING: unmet direct dependencies detected for MAC80211_LEDS
>>>   Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y])
>>>   Selected by [m]:
>>>   - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] && WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m])
>>>
>>> Signed-off-by: Liwei Song <liwei.song@windriver.com>
>>
>> Is this is a new regression or an old bug? What commit caused this?
> 
> It should be exist when the below commit change the dependency of MAC80211_LEDS
> to fix some build error:
> 
> commit b64acb28da8394485f0762e657470c9fc33aca4d
> Author: Arnd Bergmann <arnd@arndb.de>
> Date:   Mon Jan 25 12:36:42 2021 +0100
> 
>     ath9k: fix build error with LEDS_CLASS=m
>     
>     When CONFIG_ATH9K is built-in but LED support is in a loadable
>     module, both ath9k drivers fails to link:
>     
>     x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_deinit_leds':
>     gpio.c:(.text+0x36): undefined reference to `led_classdev_unregister'
>     x86_64-linux-ld: drivers/net/wireless/ath/ath9k/gpio.o: in function `ath_init_leds':
>     gpio.c:(.text+0x179): undefined reference to `led_classdev_register_ext'
>     
>     The problem is that the 'imply' keyword does not enforce any dependency
>     but is only a weak hint to Kconfig to enable another symbol from a
>     defconfig file.
>     
>     Change imply to a 'depends on LEDS_CLASS' that prevents the incorrect
>     configuration but still allows building the driver without LED support.
>     
>     The 'select MAC80211_LEDS' is now ensures that the LED support is
>     actually used if it is present, and the added Kconfig dependency
>     on MAC80211_LEDS ensures that it cannot be enabled manually when it
>     has no effect.
>     
>     Fixes: 197f466e93f5 ("ath9k_htc: Do not select MAC80211_LEDS by default")
>     Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>     Acked-by: Johannes Berg <johannes@sipsolutions.net>
>     Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
>     Link: https://lore.kernel.org/r/20210125113654.2408057-1-arnd@kernel.org
> 
> diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
> index cd9a9bd242ba..51ec8256b7fa 100644
> --- a/net/mac80211/Kconfig
> +++ b/net/mac80211/Kconfig
> @@ -69,7 +69,7 @@ config MAC80211_MESH
>  config MAC80211_LEDS
>         bool "Enable LED triggers"
>         depends on MAC80211
> -       depends on LEDS_CLASS
> +       depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
> 
> 
> Thanks,
> Liwei.
> 
> 
>>

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

* Re: [PATCH] iwlwifi: select MAC80211_LEDS conditionally
  2021-06-24 11:06   ` Liwei Song
  2021-07-26  9:26     ` Liwei Song
@ 2021-08-05 13:44     ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2021-08-05 13:44 UTC (permalink / raw)
  To: Liwei Song
  Cc: Luca Coelho, David, Jakub Kicinski, linux-wireless, netdev, linux-kernel

Liwei Song <liwei.song@windriver.com> writes:

> On 6/24/21 18:41, Kalle Valo wrote:
>> Liwei Song <liwei.song@windriver.com> writes:
>> 
>>> MAC80211_LEDS depends on LEDS_CLASS=y or LEDS_CLASS=MAC80211,
>>> add condition to enable it in iwlwifi/Kconfig to avoid below
>>> compile warning when LEDS_CLASS was set to m:
>>>
>>> WARNING: unmet direct dependencies detected for MAC80211_LEDS
>>>   Depends on [n]: NET [=y] && WIRELESS [=y] && MAC80211 [=y] &&
>>> (LEDS_CLASS [=m]=y || LEDS_CLASS [=m]=MAC80211 [=y])
>>>   Selected by [m]:
>>>   - IWLWIFI_LEDS [=y] && NETDEVICES [=y] && WLAN [=y] &&
>>> WLAN_VENDOR_INTEL [=y] && IWLWIFI [=m] && (LEDS_CLASS [=m]=y ||
>>> LEDS_CLASS [=m]=IWLWIFI [=m]) && (IWLMVM [=m] || IWLDVM [=m])
>>>
>>> Signed-off-by: Liwei Song <liwei.song@windriver.com>
>> 
>> Is this is a new regression or an old bug? What commit caused this?
>
> It should be exist when the below commit change the dependency of MAC80211_LEDS
> to fix some build error:
>
> commit b64acb28da8394485f0762e657470c9fc33aca4d
> Author: Arnd Bergmann <arnd@arndb.de>
> Date:   Mon Jan 25 12:36:42 2021 +0100
>
>     ath9k: fix build error with LEDS_CLASS=m

Thanks, it seems LEDS_CLASS is a constant source of problems for
wireless drivers :/

Luca, what should we do? We cannot have compile errors in the tree.

I assigned this patch to me on patchwork.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

end of thread, other threads:[~2021-08-05 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 10:08 [PATCH] iwlwifi: select MAC80211_LEDS conditionally Liwei Song
2021-06-24 10:41 ` Kalle Valo
2021-06-24 11:06   ` Liwei Song
2021-07-26  9:26     ` Liwei Song
2021-08-05 13:44     ` Kalle Valo

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).