From: Johannes Berg <johannes@sipsolutions.net>
To: Alan Jenkins <sourcejedi.lkml@googlemail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: rfkill rewrite
Date: Tue, 05 May 2009 16:11:41 +0200 [thread overview]
Message-ID: <1241532702.28069.6.camel@johannes.local> (raw)
In-Reply-To: <9b2b86520905050704p34e87d38gccfe78940ee95c2e@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2353 bytes --]
> >> I just realized or remembered something non-obvious. This means _all_
> >> rfkill drivers need a resume handler. They don't at the moment, so
> >> this would need to be fixed and documented. In which case, it's
> >> probably simpler for the core to do it.
> >
> > Only those that have a hard-rfkill line, which I think isn't all.
>
> My scenario quoted below affects soft-rfkill only.
Ah, you're thinking of that.
> > But yes. However, how would the core handle it?
>
> I was thinking of calling set_block() on resume to restore the
> pre-suspend state. That's what the old rfkill does, and why
> eeepc-laptop got away without a resume handler.
That makes sense.
> > So we would need to add a query_resume() method like query that is
> > called at resume time, and needs to call rfkill_set{,_hw,_sw}_state as
> > appopriate. Thoughts? We can enforce that much easier by making it a
> > required method.
>
> That would certainly follow your existing model. (BTW the kerneldoc
> for "query" is out of sync in v8; it says "return true for blocked"
> even though the prototype returns void :-).
Yeah, I noticed already and fixed it yesterday but didn't post v9 yet
(will also amend v9 with the outcome of this discussion)
> It's debatable as to what behaviour is more user-friendly for my nasty
> corner-case. query_resume() would allow the radio to always come back
> in the same state as it was in the moment the laptop went to sleep, if
> the hardware supports it. But the _global_ rfkill state will then be
> out of sync, and that means the next time you press the wireless
> toggle key it does nothing, which is disconcerting. Plus, it means
> the corner-case behaviour varies depending on whether the soft-rfkill
> line state survives over hibernation - which may even vary on the same
> machine (S5 versus S4? whether you remove the laptop's battery? weird
> firmware bugs?).
>
> All I'm trying to do is selfishly preserve eeepc-laptop across this
> re-write, for which purpose it seems easier to have set_block() called
> on resume :-). I don't know if that makes rfkill more awkward in
> wireless drivers (as opposed to platform drivers), or drivers which
> have a hardware rfkill line.
No, should be fine. I can add that and remove the resume code from
eeepc.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2009-05-05 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-01 9:42 rfkill rewrite Alan Jenkins
2009-05-05 8:15 ` Johannes Berg
2009-05-05 14:04 ` Alan Jenkins
2009-05-05 14:11 ` Johannes Berg [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-07-18 15:46 Rfkill rewrite Alan Jenkins
2009-07-18 17:40 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1241532702.28069.6.camel@johannes.local \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=sourcejedi.lkml@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.