Hi, On Fri, Aug 26, 2011 at 3:45 PM, Rafael J. Wysocki <rjw@xxxxxxx> 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. _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm