linux/drivers/leds/trigger
Jakub Kicinski ea8ea212d4 leds: trigger: netdev: don't recurse on the netdev ops lock
get_device_state() calls __ethtool_get_link_ksettings() on the trigger's
netdev, which will soon take the dev's ops lock. Three of its callers
already hold that lock and one doesn't, so the function would either
deadlock or run unprotected depending on the path.

Make get_device_state() expect the dev's ops lock held and switch to
netif_get_link_ksettings():

  * netdev_trig_notify() NETDEV_UP / NETDEV_CHANGE / NETDEV_CHANGENAME
    arrive with the dev's ops lock held (per netdevices.rst).
  * set_device_name() does not hold the lock, take it explicitly.

Due to lock ordering we need to reshuffle the code in set_device_name()
a little bit. We need to find the device earlier on, so that we can
lock it before we take trigger_data->lock.

Link: https://patch.msgid.link/20260603012840.2254293-10-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-06-04 14:04:56 -07:00
..
Kconfig leds: trigger: Add new LED Input events trigger 2024-06-21 11:57:17 +01:00
ledtrig-activity.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-backlight.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-camera.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ledtrig-cpu.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
ledtrig-default-on.c leds: triggers: default-on: Add module alias for module auto-loading 2024-03-07 08:48:00 +00:00
ledtrig-disk.c leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value 2023-05-25 12:16:27 +01:00
ledtrig-gpio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-heartbeat.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-input-events.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-mtd.c leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value 2023-05-25 12:16:27 +01:00
ledtrig-netdev.c leds: trigger: netdev: don't recurse on the netdev ops lock 2026-06-04 14:04:56 -07:00
ledtrig-oneshot.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-panic.c leds: trigger: panic: Simplify led_trigger_set_panic 2024-03-07 08:48:01 +00:00
ledtrig-pattern.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-timer.c leds: triggers: Flush pending brightness before activating trigger 2024-06-26 16:56:07 +01:00
ledtrig-transient.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ledtrig-tty.c leds: Prefer IS_ERR_OR_NULL over manual NULL check 2026-03-10 13:33:26 +00:00
Makefile leds: trigger: Add new LED Input events trigger 2024-06-21 11:57:17 +01:00