lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 11 May 2012 09:32:21 +0200
From:	Alexander Stein <alexander.stein@...tec-electronic.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Richard Purdie <rpurdie@...ys.net>, linux-kernel@...r.kernel.org,
	Bryan Wu <bryan.wu@...onical.com>
Subject: Re: [PATCH] leds-pca955x: Fix race condition while setting brightness on several LEDs

Am Donnerstag, 10. Mai 2012, 14:40:16 schrieb Andrew Morton:
> On Wed,  8 Feb 2012 13:44:08 +0100
> 
> Alexander Stein <alexander.stein@...tec-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.

This doesn't work. A problem was that each LED had it's own lock used upon 
scheduling it's own workqueue. No synchronization betwen all LEDs on this 
chip.

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

Whoops, my mistake. This wasn't intended. I will gladly send a new patch with 
the last function name change reverted. Unless someone objects against the 
synchronizaton.

Regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein

SYS TEC electronic GmbH
August-Bebel-Str. 29
D-07973 Greiz

Tel: +49-3661-6279-0, Fax: +49-3661-6279-99
eMail:    Alexander.Stein@...tec-electronic.com
Internet: http://www.systec-electronic.com

Managing Director: Dipl.-Phys. Siegmar Schmidt
Commercial registry: Amtsgericht Jena, HRB 205563
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ