Subject: Re: [PATCH net] r8169: fix LED-related deadlock on module removal

From: Lukas Wunner <[email-masked]>
Date: Fri, 5 Apr 2024 22:59:03 +0200

On Fri, Apr 05, 2024 at 10:29:15PM +0200, Heiner Kallweit wrote:
> --- a/drivers/net/ethernet/realtek/r8169_leds.c
> +++ b/drivers/net/ethernet/realtek/r8169_leds.c
> @@ -146,13 +146,12 @@ static void rtl8168_setup_ldev(struct r8169_led_classdev *ldev,
>  	led_cdev->hw_control_get_device = r8169_led_hw_control_get_device;
>  
>  	/* ignore errors */
> -	devm_led_classdev_register(&ndev->dev, led_cdev);
> +	devm_led_classdev_register(ndev->dev.parent, led_cdev);

IIUC, devm_led_classdev_register() uses the first argument both
to manage unregistering on unbind, but also as parent of the LED device.

While the former is desired, the latter likely is not.
I assume the LEDs now appear as children of the PCI device in sysfs,
not as children of the netdev.  Probably not what you want.

The second patch I posted should handle that correctly.

Thanks,

Lukas