From: Ivo van Doorn <ivdoorn@gmail.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: John Linville <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org,
Matthew Garrett <mjg59@srcf.ucam.org>,
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Subject: Re: [PATCH 2/2] rfkill: always call get_state() hook on resume
Date: Mon, 3 Nov 2008 18:20:18 +0100 [thread overview]
Message-ID: <200811031820.18533.IvDoorn@gmail.com> (raw)
In-Reply-To: <1225730537-2679-3-git-send-email-hmh@hmh.eng.br>
On Monday 03 November 2008, Henrique de Moraes Holschuh wrote:
> We "optimize" away the get_state() hook call on rfkill_toggle_radio
> when doing a forced state change. This means the resume path is not
> calling get_state() as it should.
>
> Call it manually on the resume handler, as we don't want to mess with
> the EPO path by removing the optimization. This has the added benefit
> of making it explicit that rfkill->state could have been modified
> before we hit the rfkill_toggle_radio() call in the class resume
> handler.
>
> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Cc: Ivo van Doorn <IvDoorn@gmail.com>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
> Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> net/rfkill/rfkill.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
> index caee717..7a82a35 100644
> --- a/net/rfkill/rfkill.c
> +++ b/net/rfkill/rfkill.c
> @@ -526,6 +526,7 @@ static int rfkill_suspend(struct device *dev, pm_message_t state)
> static int rfkill_resume(struct device *dev)
> {
> struct rfkill *rfkill = to_rfkill(dev);
> + enum rfkill_state newstate;
>
> if (dev->power.power_state.event != PM_EVENT_ON) {
> mutex_lock(&rfkill->mutex);
> @@ -533,6 +534,9 @@ static int rfkill_resume(struct device *dev)
> dev->power.power_state.event = PM_EVENT_ON;
>
> /* restore radio state AND notify everybody */
> + if (rfkill->get_state &&
> + !rfkill->get_state(rfkill->data, &newstate))
> + rfkill->state = newstate;
> rfkill_toggle_radio(rfkill, rfkill->state_for_resume, 1);
>
> mutex_unlock(&rfkill->mutex);
next prev parent reply other threads:[~2008-11-03 17:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-03 16:42 [GIT PATCH] rfkill fixes for 2.6.28-rc3 Henrique de Moraes Holschuh
2008-11-03 16:42 ` [PATCH 1/2] rfkill: preserve state across suspend Henrique de Moraes Holschuh
2008-11-03 17:20 ` Ivo van Doorn
2008-11-03 16:42 ` [PATCH 2/2] rfkill: always call get_state() hook on resume Henrique de Moraes Holschuh
2008-11-03 17:20 ` Ivo van Doorn [this message]
2008-11-03 16:47 ` [GIT PATCH] rfkill fixes for 2.6.28-rc3 Ivo van Doorn
2008-11-03 17:02 ` Henrique de Moraes Holschuh
2008-11-03 17:20 ` Ivo van Doorn
2008-11-12 21:15 ` John W. Linville
2008-11-14 0:16 ` Henrique de Moraes Holschuh
2008-11-20 2:00 ` John W. Linville
2008-11-20 10:51 ` Henrique de Moraes Holschuh
2008-11-20 15:03 ` John W. Linville
2008-11-21 22:40 ` [PATCH 1/2] rfkill: preserve state across suspend Henrique de Moraes Holschuh
2008-11-21 22:40 ` [PATCH 2/2] rfkill: always call get_state() hook on resume Henrique de Moraes Holschuh
2008-11-20 16:27 ` [GIT PATCH] rfkill fixes for 2.6.28-rc3 drago01
2008-11-20 16:31 ` Matthew Garrett
2008-11-20 16:54 ` drago01
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=200811031820.18533.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=alan-jenkins@tuffmail.co.uk \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mjg59@srcf.ucam.org \
/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;
as well as URLs for NNTP newsgroup(s).