[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJKOXPc6LWnqiyO9WgxUZPo-vitNcQQr2oDoyD44P2YTSJ7j=g@mail.gmail.com>
Date: Mon, 25 Jan 2021 14:27:51 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: QCA ath9k Development <ath9k-devel@....qualcomm.com>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Johannes Berg <johannes@...solutions.net>,
Arnd Bergmann <arnd@...db.de>,
Masahiro Yamada <masahiroy@...nel.org>,
Flavio Suligoi <f.suligoi@...m.it>,
linux-wireless <linux-wireless@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ath9k: fix build error with LEDS_CLASS=m
On Mon, 25 Jan 2021 at 14:09, Arnd Bergmann <arnd@...nel.org> wrote:
>
> On Mon, Jan 25, 2021 at 12:40 PM Krzysztof Kozlowski <krzk@...nel.org> wrote:
> > On Mon, 25 Jan 2021 at 12:36, Arnd Bergmann <arnd@...nel.org> wrote:
> > >
> > > From: Arnd Bergmann <arnd@...db.de>
> > >
> > > 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.
> >
> > But we do not want to have this dependency (selecting MAC80211_LEDS).
> > I fixed this problem here:
> > https://lore.kernel.org/lkml/20201227143034.1134829-1-krzk@kernel.org/
> > Maybe let's take this approach?
>
> Generally speaking, I don't like to have a device driver specific Kconfig
> setting 'select' a subsystem', for two reasons:
>
> - you suddenly get asked for tons of new LED specific options when
> enabling seemingly benign options
>
> - Mixing 'depends on' and 'select' leads to bugs with circular
> dependencies that usually require turning some other 'select'
> into 'depends on'.
>
> The problem with LEDS_CLASS in particular is that there is a mix of drivers
> using one vs the other roughly 50:50.
Yes, you are right, I also don't like it. However it was like this
before my commit so I am not introducing a new issue. The point is
that in your choice the MAC80211_LEDS will be selected if LEDS_CLASS
is present, which is exactly what I was trying to fix/remove. My WiFi
dongle does not have a LED and it causes a periodic (every second)
event. However I still have LEDS_CLASS for other LEDS in the system.
Best regards,
Krzysztof
On Mon, 25 Jan 2021 at 14:09, Arnd Bergmann <arnd@...nel.org> wrote:
>
> On Mon, Jan 25, 2021 at 12:40 PM Krzysztof Kozlowski <krzk@...nel.org> wrote:
> > On Mon, 25 Jan 2021 at 12:36, Arnd Bergmann <arnd@...nel.org> wrote:
> > >
> > > From: Arnd Bergmann <arnd@...db.de>
> > >
> > > 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.
> >
> > But we do not want to have this dependency (selecting MAC80211_LEDS).
> > I fixed this problem here:
> > https://lore.kernel.org/lkml/20201227143034.1134829-1-krzk@kernel.org/
> > Maybe let's take this approach?
>
> Generally speaking, I don't like to have a device driver specific Kconfig
> setting 'select' a subsystem', for two reasons:
>
> - you suddenly get asked for tons of new LED specific options when
> enabling seemingly benign options
>
> - Mixing 'depends on' and 'select' leads to bugs with circular
> dependencies that usually require turning some other 'select'
> into 'depends on'.
>
> The problem with LEDS_CLASS in particular is that there is a mix of drivers
> using one vs the other roughly 50:50.
>
> Arnd
Powered by blists - more mailing lists