Re: [PATCH v3] rfkill: Add rfkill-any LED trigger

2 messages, 2 authors, 2017-01-05 · open the first message on its own page

Re: [PATCH v3] rfkill: Add rfkill-any LED trigger

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2017-01-02 12:52:09

On Mon, 2017-01-02 at 13:21 +0100, Johannes Berg wrote:
quoted
I'm not super happy with this conditional locking - can't we
instead
defer the necessary work to a workqueue, or so, for purposes of the
LED?
Actually, since you can sleep in here, and do various other things
like scheduling etc. this can't even be correct as is - one thread
might be in the probe and another might also attempt to do some
operations that require the lock but now don't take it.
Additionally, this doesn't address the "can be called in any context"
part, only the "even from within rfkill callbacks" part. It's clearly
still not safe to call this from any context that is not allowed to
sleep, for example.

johannes

Re: [PATCH v3] rfkill: Add rfkill-any LED trigger

From: Michał Kępień <hidden>
Date: 2017-01-05 14:37:22

On Mon, 2017-01-02 at 13:21 +0100, Johannes Berg wrote:
quoted
quoted
I'm not super happy with this conditional locking - can't we
instead
defer the necessary work to a workqueue, or so, for purposes of the
LED?
Actually, since you can sleep in here, and do various other things
like scheduling etc. this can't even be correct as is - one thread
might be in the probe and another might also attempt to do some
operations that require the lock but now don't take it.
Additionally, this doesn't address the "can be called in any context"
part, only the "even from within rfkill callbacks" part. It's clearly
still not safe to call this from any context that is not allowed to
sleep, for example.
Thanks for reviewing.  I will attempt a workqueue-based approach in v4.

-- 
Best regards,
Michał Kępień
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help