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 10:15:07 +0200 [thread overview]
Message-ID: <1241511307.25807.6.camel@johannes.local> (raw)
In-Reply-To: <9b2b86520905010242q443eb19bnc9e2c86a23605c2d@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]
Hi,
Sorry for the long wait.
> > I could make the rfkill core do that at resume, but I'm not really sure
> > it's what we want -- there are too many cases imho:
> > * hard rfkill might have changed
> > * soft rfkill might still be ok in hw
> > * soft rfkill might need reconfiguring
> > etc. I think generally it's saner to let the driver sort it out -- it
> > can always ask for the current state by using set_hw_state() or so.
>
> 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. But
yes. However, how would the core handle it?
> You need this to handle hibernation. If the rfkill state persists
> across hibernation (which mine does, even in S5), you can always cause
> the state to change, by pressing the wireless toggle key _while the
> hibernation image is being written to disk_. At that stage, all
> devices are active, so that s2disk can interact with the user and
> write the image wherever it chooses. The kernel will not "remember"
> the state change on resume, since it happened after the kernel image
> was snapshotted.
Good scenario, yes, it's definitely possible.
> If the rfkill state does _not_ persist over hibernation, then clearly
> the state can change on resume and you will again need a resume
> handler,
>
> On my EeePC, this is just more dramatic because it can de-power a PCI
> device without notifying the driver. But the new rfkill design will
> require all devices to have a resume method, because there is no
> get_state() callback. Otherwise, reading of
> /sys/class/rfkill/rfkill*/state after resume from hibernation may
> return an incorrect result. I don't think we should allow that to
> happen.
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.
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 8:15 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 [this message]
2009-05-05 14:04 ` Alan Jenkins
2009-05-05 14:11 ` Johannes Berg
-- 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=1241511307.25807.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox