lkml.org 
[lkml]   [2019]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Revert "leds: avoid races with workqueue"?
On Sun, 26 May 2019, Pavel Machek wrote:
> On Sat 2019-05-25 10:32:31, Hugh Dickins wrote:
> >
> > Thanks, Pavel: yes, that works fine for me on the T420s, no debug
> > complaints, good and silent; and the wifi LED is blinking as before.
>
> I'd like to prevent recurrence of similar problem, and I wonder if you
> can give me a hint.
>
> I can annotate code that can sleep with might_sleep().
>
> How can I annotate code that can not sleep? I might do
>
> spin_lock(&dummy);
> this_should_not_sleep();
> spin_unlock(&dummy);
>
> But I don't really need extra serialization. I just want annotations for
> lockdep. Any ideas?

I haven't tried to do that directly, so I'm likely to give bad advice:
in particular, I forget the limitations of checking in_atomic().

But very useful (and much cheaper than lockdep) debug options in
this area are CONFIG_DEBUG_PREEMPT and CONFIG_DEBUG_ATOMIC_SLEEP.

Hugh

\
 
 \ /
  Last update: 2019-05-26 22:37    [W:0.059 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site