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

2016-12-21 Thread Michał Kępień
off otherwise. This requires taking rfkill_global_mutex before calling rfkill_set_block() in rfkill_resume(): since rfkill_any_led_trigger_event(true) is called from rfkill_set_block() unconditionally, each caller of the latter needs to take care of locking rfkill_global_mutex. Signed-off-by: Michał Kęp

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

2017-01-05 Thread Michał Kępień
t; 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ń

[PATCH v4] rfkill: Add rfkill-any LED trigger

2017-01-05 Thread Michał Kępień
herwise. Signed-off-by: Michał Kępień --- Changes from v3: - Revert introducing a new bitfield and instead defer LED event firing to a work queue to prevent conditional locking and ensure the trigger can really be used from any context. This also voids the need to take rfkill_global_

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

2017-01-06 Thread Michał Kępień
> On Fri, 2017-01-06 at 07:07 +0100, Michał Kępień wrote: > > Add a new "global" (i.e. not per-rfkill device) LED trigger, rfkill- > > any, > > which may be useful on laptops with a single "radio LED" and multiple > > radio transmitters.  The trigger

[PATCH v2 1/2] net: rfkill: Cleanup error handling in rfkill_init()

2016-12-07 Thread Michał Kępień
Use a separate label per error condition in rfkill_init() to make it a bit cleaner and easier to extend. Signed-off-by: Michał Kępień --- No changes from v1. net/rfkill/core.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/net/rfkill/core.c b/net

[PATCH v2 2/2] net: rfkill: Add rfkill-any LED trigger

2016-12-07 Thread Michał Kępień
herwise. Signed-off-by: Michał Kępień --- Changes from v1: - take rfkill_global_mutex before calling rfkill_set_block() in rfkill_resume(); the need for doing this was previously obviated by 908209c ("rfkill: don't impose global states on resume"), but given that

Re: "rfkill: Add rfkill-any LED trigger" causes deadlock

2016-12-19 Thread Michał Kępień
, not patch 1/2 itself. > Michał, if you want to resubmit with this fixed, please also make sure > you don't reintroduce the unused label warning and have the appropriate > #ifdef that Arnd had later added for your change. Noted, thanks. I will post v3 once I figure out how to handle locking properly. -- Best regards, Michał Kępień

[PATCH 2/2] net: rfkill: Add rfkill-any LED trigger

2016-11-30 Thread Michał Kępień
urn it off otherwise. Signed-off-by: Michał Kępień --- Note that the search for any active radio will have quadratic complexity whenever __rfkill_switch_all() is used (as it calls rfkill_set_block() for every affected rfkill device), but I intentionally refrained from implementing rfkill_any_led_t

[PATCH 1/2] net: rfkill: Cleanup error handling in rfkill_init()

2016-11-30 Thread Michał Kępień
Use a separate label per error condition in rfkill_init() to make it a bit cleaner and easier to extend. Signed-off-by: Michał Kępień --- net/rfkill/core.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index

Re: [PATCH 2/2] net: rfkill: Add rfkill-any LED trigger

2016-12-01 Thread Michał Kępień
__rfkill_any_led_trigger_event(); >355 >356if (prev != curr) >357rfkill_event(rfkill); Thanks, these are obviously all valid concerns. Sorry for being sloppy with the ifdefs. If I get positive feedback on the proposed feature itself, all these issues (and the warning pointed out in the other message) will be resolved in v2. -- Best regards, Michał Kępień