* Function to tell S1 standby from STR
@ 2011-08-26 22:32 Maksim Rayskiy
2011-08-26 22:45 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Maksim Rayskiy @ 2011-08-26 22:32 UTC (permalink / raw)
To: linux-pm
Hi,
How can a driver in a suspend/resume call tell if the request is for
STR or S1? On SoCs I am working with drivers need to take some extra
steps to preserve context when STR is requested.
I had to add platform-dependent api to do that, but I figured I am not
the only one having to deal with this. There are some comments in
arch/arm/mach-at91/pm.c regarding having to treat S1 and S3
differently because of wakeup source dependency on clock.
And unfortunately these differences has to be taken care of in the
drivers, not platform code, because in some cases only device driver
knows what represents the hardware context that needs to be saved.
Regards,
Maksim.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Function to tell S1 standby from STR
2011-08-26 22:32 Function to tell S1 standby from STR Maksim Rayskiy
@ 2011-08-26 22:45 ` Rafael J. Wysocki
2011-08-26 23:00 ` Maksim Rayskiy
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-08-26 22:45 UTC (permalink / raw)
To: Maksim Rayskiy; +Cc: linux-pm
Hi,
On Saturday, August 27, 2011, Maksim Rayskiy wrote:
> Hi,
>
> How can a driver in a suspend/resume call tell if the request is for
> STR or S1? On SoCs I am working with drivers need to take some extra
> steps to preserve context when STR is requested.
>
> I had to add platform-dependent api to do that, but I figured I am not
> the only one having to deal with this. There are some comments in
> arch/arm/mach-at91/pm.c regarding having to treat S1 and S3
> differently because of wakeup source dependency on clock.
>
> And unfortunately these differences has to be taken care of in the
> drivers, not platform code, because in some cases only device driver
> knows what represents the hardware context that needs to be saved.
Why not to save the same stuff for "S1" and "S3"?
Rafael
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Function to tell S1 standby from STR
2011-08-26 22:45 ` Rafael J. Wysocki
@ 2011-08-26 23:00 ` Maksim Rayskiy
0 siblings, 0 replies; 3+ messages in thread
From: Maksim Rayskiy @ 2011-08-26 23:00 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-pm
Hi,
On Fri, Aug 26, 2011 at 3:45 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> Hi,
>
> On Saturday, August 27, 2011, Maksim Rayskiy wrote:
>> Hi,
>>
>> How can a driver in a suspend/resume call tell if the request is for
>> STR or S1? On SoCs I am working with drivers need to take some extra
>> steps to preserve context when STR is requested.
>>
>> I had to add platform-dependent api to do that, but I figured I am not
>> the only one having to deal with this. There are some comments in
>> arch/arm/mach-at91/pm.c regarding having to treat S1 and S3
>> differently because of wakeup source dependency on clock.
>>
>> And unfortunately these differences has to be taken care of in the
>> drivers, not platform code, because in some cases only device driver
>> knows what represents the hardware context that needs to be saved.
>
> Why not to save the same stuff for "S1" and "S3"?
One of the reasons is speed - you want recovery from S1 be as fast as
possible, restoring S3 context would slow things down.
The other reason is that device comes up in entirely different states,
so it has to be treated differently. It is not only a
matter of saving stuff, you may have to go through different
re-initialization sequence.
If you look at PCI EHCI resume code, you will see that it treats
complete power down and suspend not in the same way. Unfortunately,
for some devices it is hard to tell for sure where it is coming from -
S1 or S3.
Maksim.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-08-26 23:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-26 22:32 Function to tell S1 standby from STR Maksim Rayskiy
2011-08-26 22:45 ` Rafael J. Wysocki
2011-08-26 23:00 ` Maksim Rayskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox