summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2024-05-31 14:01:24 +0200
committerLee Jones <lee@kernel.org>2024-06-21 11:57:10 +0100
commitb1bbd20f35e19774ea01989320495e09ac44fba3 (patch)
tree54ce930a4419863255fa805ff56d9fd6ac6448b1 /sound
parentdc6285088eda6ecd347f7d7fd7499008521a93a0 (diff)
downloadlinux-b1bbd20f35e19774ea01989320495e09ac44fba3.tar.gz
linux-b1bbd20f35e19774ea01989320495e09ac44fba3.tar.bz2
linux-b1bbd20f35e19774ea01989320495e09ac44fba3.zip
leds: trigger: Call synchronize_rcu() before calling trig->activate()
Some triggers call led_trigger_event() from their activate() callback to initialize the brightness of the LED for which the trigger is being activated. In order for the LED's initial state to be set correctly this requires that the led_trigger_event() call uses the new version of trigger->led_cdevs, which has the new LED. AFAICT led_trigger_event() will always use the new version when it is running on the same CPU as where the list_add_tail_rcu() call was made, which is why the missing synchronize_rcu() has not lead to bug reports. But if activate() is pre-empted, sleeps or uses a worker then the led_trigger_event() call may run on another CPU which may still use the old trigger->led_cdevs list. Add a synchronize_rcu() call to ensure that any led_trigger_event() calls done from activate() always use the new list. Triggers using led_trigger_event() from their activate() callback are: net/bluetooth/leds.c, net/rfkill/core.c and drivers/tty/vt/keyboard.c. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20240531120124.75662-1-hdegoede@redhat.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'sound')
0 files changed, 0 insertions, 0 deletions