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
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ń
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_
> 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
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
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
, 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ń
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
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
__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ń
10 matches
Mail list logo