Re: [PATCH] ARM: pxa: fix suspend on PXA3XX

From: Eric Miao
Date: Thu Jan 27 2011 - 09:47:21 EST


On Wed, Jan 26, 2011 at 4:10 PM, Sven Neumann <s.neumann@xxxxxxxxxxxx> wrote:
> On Wed, 2011-01-26 at 05:06 +0800, Eric Miao wrote:
>> How about this instead?
>>
>> diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
>> index 978e1b2..1807c9a 100644
>> --- a/arch/arm/mach-pxa/pm.c
>> +++ b/arch/arm/mach-pxa/pm.c
>> @@ -33,7 +33,7 @@ int pxa_pm_enter(suspend_state_t state)
>> Â#endif
>>
>> Â Â Â /* skip registers saving for standby */
>> - Â Â if (state != PM_SUSPEND_STANDBY) {
>> + Â Â if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->save) {
>> Â Â Â Â Â Â Â pxa_cpu_pm_fns->save(sleep_save);
>> Â Â Â Â Â Â Â /* before sleeping, calculate and save a checksum */
>> Â Â Â Â Â Â Â for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
>> @@ -44,7 +44,7 @@ int pxa_pm_enter(suspend_state_t state)
>> Â Â Â pxa_cpu_pm_fns->enter(state);
>> Â Â Â cpu_init();
>>
>> - Â Â if (state != PM_SUSPEND_STANDBY) {
>> + Â Â if (state != PM_SUSPEND_STANDBY && pxa_cpu_pm_fns->restore) {
>> Â Â Â Â Â Â Â /* after sleeping, validate the checksum */
>> Â Â Â Â Â Â Â for (i = 0; i < pxa_cpu_pm_fns->save_count - 1; i++)
>> Â Â Â Â Â Â Â Â Â Â Â checksum += sleep_save[i];
>>
>
> Not sure if that will work as well. With this change the code is
> skipping more than just the calls to pxa_cpu_pm_fns->save() and
> pxa_cpu_pm_fns->restore(). In particular it doesn't call
> pxa_cpu_pm_fns->enter(state).
>

Nah, that ->enable() is called if the checksum is incorrect. Please compare
with the original code?

>
> Thanks,
> Sven
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/