From: Arnaud Faucher <arnaud.faucher@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>, Frans Pop <elendil@planet.nl>,
Manuel Lauss <manuel.lauss@gmail.com>, Erik Ekman <erik@kryo.se>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops
Date: Sun, 26 Jul 2009 18:51:03 -0400 [thread overview]
Message-ID: <1248648663.3718.7.camel@green> (raw)
In-Reply-To: <EF5CB084-D774-49E3-9E9F-6803ECB9862C@gmail.com>
On dim, 2009-07-26 at 14:33 -0700, Dmitry Torokhov wrote:
> On Jul 26, 2009, at 1:28 PM, Arnaud Faucher <arnaud.faucher@gmail.com>
> wrote:
>
> > On dim, 2009-07-26 at 19:35 +0100, Carlos Corbacho wrote:
> >> On Sunday 26 July 2009 19:08:09 Dmitry Torokhov wrote:
> >>> On Sun, Jul 26, 2009 at 03:23:29PM +0100, Carlos Corbacho wrote:
> >>>> [Removing linux-mips from CC - I don't know why they'd be
> >>>> interested in
> >>>> an x86 only platform driver...]
> >>>>
> >>>> On Sunday 26 July 2009 14:53:33 Arnaud Faucher wrote:
> >>>>> Gets rid of the following warning:
> >>>>> Platform driver 'acer-wmi' needs updating - please use dev_pm_ops
> >>>>>
> >>>>> Take 2, thanks to Dmitry, Rafael and Frans for pointing out PM
> >>>>> issue on
> >>>>> hibernation when using dev_pm_ops blindly.
> >>>>>
> >>>>> This patch was tested against suspendand hibernation (Acer mail
> >>>>> led
> >>>>> status).
> >>>>>
> >>>>> Signed-off-by: Arnaud Faucher <arnaud.faucher@gmail.com>
> >>>>> ---
> >>>>> drivers/platform/x86/acer-wmi.c | 17 ++++++++++++-----
> >>>>> 1 files changed, 12 insertions(+), 5 deletions(-)
> >>>>>
> >>>>> diff --git a/drivers/platform/x86/acer-wmi.c
> >>>>> b/drivers/platform/x86/acer-wmi.c
> >>>>> index be2fd6f..29374bc 100644
> >>>>> --- a/drivers/platform/x86/acer-wmi.c
> >>>>> +++ b/drivers/platform/x86/acer-wmi.c
> >>>>> @@ -1152,8 +1152,7 @@ static int acer_platform_remove(struct
> >>>>> platform_device *device)
> >>>>> return 0;
> >>>>> }
> >>>>>
> >>>>> -static int acer_platform_suspend(struct platform_device *dev,
> >>>>> -pm_message_t state)
> >>>>> +static int acer_platform_suspend(struct device *dev)
> >>>>> {
> >>>>> u32 value;
> >>>>> struct acer_data *data = &interface->data;
> >>>>> @@ -1174,7 +1173,7 @@ pm_message_t state)
> >>>>> return 0;
> >>>>> }
> >>>>>
> >>>>> -static int acer_platform_resume(struct platform_device *device)
> >>>>> +static int acer_platform_resume(struct device *dev)
> >>>>> {
> >>>>> struct acer_data *data = &interface->data;
> >>>>>
> >>>>> @@ -1190,15 +1189,23 @@ static int acer_platform_resume(struct
> >>>>> platform_device *device)
> >>>>> return 0;
> >>>>> }
> >>>>>
> >>>>> +static struct dev_pm_ops acer_platform_pm_ops = {
> >>>>> + .suspend = acer_platform_suspend,
> >>>>> + .resume = acer_platform_resume,
> >>>>
> >>>> Are these necessary? For suspend-to-RAM, I've never needed these.
> >>>> The old
> >>>> callbacks here were just for suspend-to-disk.
> >>>
> >>> That is not correct. Old suspend and resume callbacks were called
> >>> for
> >>> both S2R and S2D. Whether it is actually needed for S2R I don't
> >>> know but
> >>> looking at the code they should not hurt.
> >>
> >> I'm aware they were called for S2RAM as well, but that was just a
> >> limitation
> >> of the old calls - as I say, they're not needed for it (at least on
> >> my
> >> hardware anyway).
> >>
> >
> > I was looking for similar functionality.
> >
> >>>>> + .freeze = acer_platform_suspend,
> >>>>> + .thaw = acer_platform_resume,
> >>>>
> >>>> If we only need these callbacks for freeze & thaw, they should be
> >>>> rebamed.
> >>>>
> >>>>> + .poweroff = acer_platform_suspend,
> >>>>> + .restore = acer_platform_resume,
> >>>>
> >>>> What do poweroff and restore mean in this context. Do my comments
> >>>> above
> >>>> apply again (i.e. are the callbacks necessary here)?
> >>>
> >>> I don't think poweroff handler is needed.
> >
> > After testing many combinations, I observed that I had to use that
> > much
> > callbacks. For example, when omitting to wire .poweroff/.restore,
> > with .freeze/.thaw linked to suspend()/resume(), the state (of the
> > mail
> > led) is not restored correctly after S2D.
>
>
> Have you tried with just 3 - freeze, thaw and restore?
>
State restoration seems to be OK with only those three ones (tested
against both S2RAM and S2D on my Acer Aspire 5680).
BTW, in the "struct dev_pm_ops" documentation, it would be interesting
to know which callback sequence occurs in case of S2RAM and S2D events.
next prev parent reply other threads:[~2009-07-26 22:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-25 13:04 [PATCH 1/1] acer-wmi: switch driver to dev_pm_ops Arnaud Faucher
2009-07-25 17:43 ` Dmitry Torokhov
2009-07-25 20:04 ` Rafael J. Wysocki
2009-07-26 13:53 ` Arnaud Faucher
2009-07-26 14:23 ` Carlos Corbacho
2009-07-26 18:08 ` Dmitry Torokhov
2009-07-26 18:35 ` Carlos Corbacho
2009-07-26 20:28 ` Arnaud Faucher
2009-07-26 21:33 ` Dmitry Torokhov
2009-07-26 22:51 ` Arnaud Faucher [this message]
2009-07-28 23:39 ` Arnaud Faucher
2009-07-29 20:49 ` Rafael J. Wysocki
2009-07-29 21:03 ` Dmitry Torokhov
2009-07-29 22:53 ` Arnaud Faucher
2009-07-30 22:05 ` Arnaud Faucher
2009-07-31 11:56 ` Rafael J. Wysocki
2009-07-29 23:27 ` Rafael J. Wysocki
2009-07-25 20:10 ` Arnaud Faucher
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=1248648663.3718.7.camel@green \
--to=arnaud.faucher@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=carlos@strangeworlds.co.uk \
--cc=dmitry.torokhov@gmail.com \
--cc=elendil@planet.nl \
--cc=erik@kryo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=manuel.lauss@gmail.com \
--cc=rjw@sisk.pl \
/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