Skip to content

RFC leds: trigger: input-events: Fix locking issues of input_lock vs led-trigger locks

Hans de Goede linux-leds 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2leds: trigger: input-events: Replace led_on with a flags fielddrivers/leds/trigger/ledtrig-input-events.c+7 -61 reply
2/2leds: trigger: input-events: Fix locking issues of input_lock vs led-trigger locksdrivers/leds/trigger/ledtrig-input-events.c+28 -122 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/2] leds: trigger: input-events: Fix locking issues of input_lock vs led-trigger locks

Hi Lee, et. al.,

So approx. 24 hours after you merged my input-events trigger I have found a rather nasty locking issue with it after plugging a USB keyboard into a tablet which uses this new trigger. Sorry about the bad timing.

Patch 2/2 of this series tries to fix this and it fixes my reproducer. But I was worried about the deactivate path, so I gave that a try with the patch in place and this resulted in a new lockdep warning (now on deactivate).

So I need a different approach. I have a plan how to fix this differently and I plan to write a patch on top of for-leds-next in the next couple of days. But I guess you could also drop the "leds: trigger: Add new LED Input events trigger" from for-leds-next for now.

I thought it would be still good to post this patch as it shows the complex problem of LEDs or LED triggers getting registered by subsystems while holding a global lock from that subsystem vs the activate / deactivate method of the trigger calling functions of that same subsystem which require that same global lock. Basically this is the same LED trigger problem as this 6.9+ regression:

https://lore.kernel.org/regressions/[email protected]/

Regards,

Hans

Hans de Goede (2):
leds: trigger: input-events: Replace led_on with a flags field
leds: trigger: input-events: Fix locking issues of input_lock vs
led-trigger locks

 drivers/leds/trigger/ledtrig-input-events.c | 53 ++++++++++++++-------
 1 file changed, 35 insertions(+), 18 deletions(-)
Signature · 1 line
2.45.1