lkml.org 
[lkml]   [2012]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] leds-pca955x: Fix race condition while setting brightness on several LEDs
On Wed,  8 Feb 2012 13:44:08 +0100
Alexander Stein <alexander.stein@systec-electronic.com> wrote:

> 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.

There's the bugfix.

> Also used a struct for shared data bewteen all LEDs.

And there's an apparently unrelated change whcih created a *lot* of
noise in the patch. It would be good to separate these things, with
the bugfix being the first change.

> ...
>
> -static inline u8 pca955x_ledsel(u8 oldval, int led_num, int state)
> +static inline u8 pca955x_ledel(u8 oldval, int led_num, int state)

Why was this function renamed, and what does "ledel" mean?



\
 
 \ /
  Last update: 2012-05-11 00:21    [from the cache]
©2003-2011 Jasper Spaans