Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1312347 > unrolled thread

[PATCH 0/8] General RFKill improvements

Started by"João Paulo Rechi Vita" <jprvita@gmail.com>
First post2016-01-19 16:50 +0100
Last post2016-01-26 14:10 +0100
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/8] General RFKill improvements "João Paulo Rechi Vita" <jprvita@gmail.com> - 2016-01-19 16:50 +0100
    [PATCH 1/8] rfkill: Documentation and style fixes "João Paulo Rechi Vita" <jprvita@gmail.com> - 2016-01-19 16:50 +0100
      Re: [PATCH 1/8] rfkill: Documentation and style fixes Johannes Berg <johannes@sipsolutions.net> - 2016-01-19 21:20 +0100
        Re: [PATCH 1/8] rfkill: Documentation and style fixes João Paulo Rechi Vita <jprvita@gmail.com> - 2016-01-19 21:30 +0100
    Re: [PATCH 0/8] General RFKill improvements Johannes Berg <johannes@sipsolutions.net> - 2016-01-26 14:10 +0100

#1312347 — [PATCH 0/8] General RFKill improvements

From"João Paulo Rechi Vita" <jprvita@gmail.com>
Date2016-01-19 16:50 +0100
Subject[PATCH 0/8] General RFKill improvements
Message-ID<qSGHE-1px-5@gated-at.bofh.it>
This series contains a few general improvements to the RFKill code, found while
I was writing the rfkill-all / airplane mode LED trigger. All were points where
I had to read twice or do some other kind of extra effort to fully understand
it, so I think merging these changes will benefit someone trying to understand
the RFKill subsystem in the future.

It also removes sysfs interfaces that were marked as obsolete for 4+ years.

João Paulo Rechi Vita (8):
  rfkill: Documentation and style fixes
  rfkill: Improve code readability
  rfkill: Improve code readability
  rfkill: Remove obsolete "claim" sysfs interface
  rfkill: Remove obsolete "state" sysfs interface
  rfkill: Move user_state_from_blocked() close to its user
  rfkill: Update userspace API documentation
  rfkill: Factor common code

 Documentation/ABI/obsolete/sysfs-class-rfkill |  29 -----
 Documentation/ABI/removed/sysfs-class-rfkill  |  30 +++++
 include/linux/rfkill.h                        |   7 +-
 include/uapi/linux/rfkill.h                   |   1 +
 net/rfkill/core.c                             | 154 ++++++++------------------
 5 files changed, 82 insertions(+), 139 deletions(-)
 delete mode 100644 Documentation/ABI/obsolete/sysfs-class-rfkill
 create mode 100644 Documentation/ABI/removed/sysfs-class-rfkill

-- 
2.5.0

[toc] | [next] | [standalone]


#1312349 — [PATCH 1/8] rfkill: Documentation and style fixes

From"João Paulo Rechi Vita" <jprvita@gmail.com>
Date2016-01-19 16:50 +0100
Subject[PATCH 1/8] rfkill: Documentation and style fixes
Message-ID<qSGHF-1px-39@gated-at.bofh.it>
In reply to#1312347
Fixes some small typos, punctuation, and copy & paste issues. Also
removes an extra blank line.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
 include/linux/rfkill.h | 7 ++++---
 net/rfkill/core.c      | 5 ++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index d901078..3dcbaf6 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -104,16 +104,17 @@ int __must_check rfkill_register(struct rfkill *rfkill);
  *
  * Pause polling -- say transmitter is off for other reasons.
  * NOTE: not necessary for suspend/resume -- in that case the
- * core stops polling anyway
+ * core stops polling anyway.
  */
 void rfkill_pause_polling(struct rfkill *rfkill);
 
 /**
  * rfkill_resume_polling(struct rfkill *rfkill)
  *
- * Pause polling -- say transmitter is off for other reasons.
+ * Resume polling previously paused with rfkill_pause_polling.
  * NOTE: not necessary for suspend/resume -- in that case the
- * core stops polling anyway
+ * core restarts polling anyway, even if was explicitly paused
+ * before suspending.
  */
 void rfkill_resume_polling(struct rfkill *rfkill);
 
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index f53bf3b6..4d6d726 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -303,8 +303,8 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
 	spin_lock_irqsave(&rfkill->lock, flags);
 	if (err) {
 		/*
-		 * Failed -- reset status to _prev, this may be different
-		 * from what set set _PREV to earlier in this function
+		 * Failed -- reset status to _PREV. This may be different
+		 * from what we have set _PREV to earlier in this function
 		 * if rfkill_set_sw_state was invoked.
 		 */
 		if (rfkill->state & RFKILL_BLOCK_SW_PREV)
@@ -477,7 +477,6 @@ bool rfkill_get_global_sw_state(const enum rfkill_type type)
 }
 #endif
 
-
 bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
 {
 	bool ret, change;
-- 
2.5.0

[toc] | [prev] | [next] | [standalone]


#1312481 — Re: [PATCH 1/8] rfkill: Documentation and style fixes

FromJohannes Berg <johannes@sipsolutions.net>
Date2016-01-19 21:20 +0100
SubjectRe: [PATCH 1/8] rfkill: Documentation and style fixes
Message-ID<qSKUW-4lv-3@gated-at.bofh.it>
In reply to#1312349
>  /**
>   * rfkill_resume_polling(struct rfkill *rfkill)
>   *
> - * Pause polling -- say transmitter is off for other reasons.
> + * Resume polling previously paused with rfkill_pause_polling.
>   * NOTE: not necessary for suspend/resume -- in that case the
> - * core stops polling anyway
> + * core restarts polling anyway, even if was explicitly paused
> + * before suspending.
>   */

If this is true, that's a bug, no? Drivers would call pause/resume when
their status changes, and shouldn't be required to check status at
resume time?

johannes

[toc] | [prev] | [next] | [standalone]


#1312487 — Re: [PATCH 1/8] rfkill: Documentation and style fixes

FromJoão Paulo Rechi Vita <jprvita@gmail.com>
Date2016-01-19 21:30 +0100
SubjectRe: [PATCH 1/8] rfkill: Documentation and style fixes
Message-ID<qSL4C-4qD-9@gated-at.bofh.it>
In reply to#1312481
On 19 January 2016 at 15:11, Johannes Berg <johannes@sipsolutions.net> wrote:
>
>>  /**
>>   * rfkill_resume_polling(struct rfkill *rfkill)
>>   *
>> - * Pause polling -- say transmitter is off for other reasons.
>> + * Resume polling previously paused with rfkill_pause_polling.
>>   * NOTE: not necessary for suspend/resume -- in that case the
>> - * core stops polling anyway
>> + * core restarts polling anyway, even if was explicitly paused
>> + * before suspending.
>>   */
>
> If this is true, that's a bug, no? Drivers would call pause/resume when
> their status changes, and shouldn't be required to check status at
> resume time?
>

I did not dive too much into the logic here, but
rfkill_resume_polling() is called unconditionally on rfkill_resume(),
so it seems that if a driver call rfkill_pause_polling() before
suspend, on resume polling will be "un-paused". That indeed looks
strange.

--
João Paulo Rechi Vita
http://about.me/jprvita

[toc] | [prev] | [next] | [standalone]


#1317880

FromJohannes Berg <johannes@sipsolutions.net>
Date2016-01-26 14:10 +0100
Message-ID<qVbxE-4zk-15@gated-at.bofh.it>
In reply to#1312347
Hi,

On Tue, 2016-01-19 at 10:42 -0500, João Paulo Rechi Vita wrote:
> This series contains a few general improvements to the RFKill code,
> found while
> I was writing the rfkill-all / airplane mode LED trigger. All were
> points where
> I had to read twice or do some other kind of extra effort to fully
> understand
> it, so I think merging these changes will benefit someone trying to
> understand
> the RFKill subsystem in the future.

I applied some of this. I think we need to keep the "state" sysfs
interface, perhaps you want to document it more clearly. I also didn't
apply the first patch since I'd fixed the suspend/pause issue, please
see if any of your patches remain relevant and resend that.

Thanks,
johannes

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web