lkml.org 
[lkml]   [2011]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2 3/4] platform: (TS-5500) add LED support
On 08/30/2011 02:15 PM, Mark Brown wrote:
> On Tue, Aug 30, 2011 at 05:14:24PM -0400, Vivien Didelot wrote:
>> "H. Peter Anvin" <hpa@zytor.com> wrote:
>>> On 08/29/2011 03:16 PM, Mark Brown wrote:
>
>>>> Can you not do outb() from atomic context? The reason lots of LED
>>>> drivers update the hardware in a workqueue is that they communicate
>>>> with the hardware over buses that can't be used in atomic context
>>>> like I2C or SPI but if that's not an issue then the workqueue is
>>>> not required and the code can be simplified.
>
>>> outb() can definitely be executed from atomic context.
>
>> Good to know, thanks. I removed the work_struct and instead lock a mutex
>> before setting led->new_brightness and calling outb().
>
> You can't take a mutex in atomic context...

OK, so what is the potential race that this mutex is called for? If it
just means that the brightness can be redundantly set to the same value
more than once, no atomicity is needed.

-hpa



\
 
 \ /
  Last update: 2011-08-30 23:21    [W:0.065 / U:22.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site