Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e7e11d8b authored by Alexander Stein's avatar Alexander Stein Committed by Linus Torvalds
Browse files

drivers/leds/leds-pca955x.c: fix race condition while setting brightness on several LEDs



When issuing the following command:

  for I in 0 1 2 3 4 5 6 7; do
    echo 0 > /sys/class/leds/pca955x\:${I}/brightness;
  done

It is possible that all the pca955x_read_ls calls are done sequentially
before any pca955x_write_ls call is done.  This updates the LS only to
the last LED update in its set.

Fix this by using a global lock for the pca995x device during
pca955x_led_work.  Also used a struct for shared data betreen all LEDs.

[akpm@linux-foundation.org: revert unintentional rename of pca955x_ledsel()]
Signed-off-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Bryan Wu <bryan.wu@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 44e1e9f8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment