lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250220214954.62lfljaxuclammce@skbuf>
Date: Thu, 20 Feb 2025 23:49:54 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Alvin Šipraga <alsi@...g-olufsen.dk>,
	Andrew Lunn <andrew@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Luiz Angelo Daros de Luca <luizluca@...il.com>,
	netdev@...r.kernel.org, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v3] net: dsa: rtl8366rb: Fix compilation problem

On Thu, Feb 20, 2025 at 07:48:15PM +0100, Linus Walleij wrote:
> When the kernel is compiled without LED framework support the
> rtl8366rb fails to build like this:
> 
> rtl8366rb.o: in function `rtl8366rb_setup_led':
> rtl8366rb.c:953:(.text.unlikely.rtl8366rb_setup_led+0xe8):
>   undefined reference to `led_init_default_state_get'
> rtl8366rb.c:980:(.text.unlikely.rtl8366rb_setup_led+0x240):
>   undefined reference to `devm_led_classdev_register_ext'
> 
> As this is constantly coming up in different randconfig builds,
> bite the bullet and create a separate file for the offending
> code, split out a header with all stuff needed both in the
> core driver and the leds code.
> 
> Add a new bool Kconfig option for the LED compile target, such
> that it depends on LEDS_CLASS=y || LEDS_CLASS=RTL8366RB
> which make LED support always available when LEDS_CLASS is
> compiled into the kernel and enforce that if the LEDS_CLASS
> is a module, then the RTL8366RB driver needs to be a module
> as well so that modprobe can resolve the dependencies.
> 
> Fixes: 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")
> Reported-by: kernel test robot <lkp@...el.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502070525.xMUImayb-lkp@intel.com/
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> ---
> Changes in v3:
> - Create a new NET_DSA_REALTEK_RTL8366RB_LEDS symbol and make
>   it resolve the compiled-in vs compiled-as-module dependencies.
> - Link to v2: https://lore.kernel.org/r/20250220-rtl8366rb-leds-compile-issue-v2-1-8f8ef5a3f022@linaro.org

The Kconfig approach where NET_DSA_REALTEK_RTL8366RB_LEDS just
disappears when there is a mismatch between LEDS_CLASS and RTL8366RB is
a bit unusual to me (I'm used to just seeing "depends on LEDS_CLASS || LEDS_CLASS=n"),
but this seems to work too, as far as I can see.

Reviewed-by: Vladimir Oltean <olteanv@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ