Re: Suspending with keypad bug (RFC)

Juha Yrjölä
2006-08-06T19:25:51Z

andrzej zaborowski wrote:

> I came up with a different fix, in the keypad driver but it's a bit
> more intrusive. With this the device sleeps peacefully until another
> key-press is detected. What should be the correct behavior?
> I'm attaching both changes.

This approach is better; the generic PM code should not have to care
that much about different wakeup sources.

I'm not exactly sure in which state the system is when the suspend
function is called. Can there still be timer activity, for example?
Nevertheless, you're safer doing a spin_lock_irqsave() in the suspend
function first, and releasing the lock only after setting the suspended
variable and re-enabling the interrupt.

You should also check whether you're actually running on OMAP1 before
you write to the register.

In the IRQ handler, you should also do a spin_lock_irqsave() before
accessing the suspended variable.

Cheers,
Juha