Re: Suspending with keypad bug (RFC)

Juha Yrjölä
2006-08-13T09:36:41Z

Hi,

On Thu, Aug 10, 2006 at 06:55:26AM +0200, andrzej zaborowski wrote:

> Thanks for help! I'm attaching the corrected version, it works nicely.

+ unsigned long flags;
+ spin_lock_irqsave(&omap_kp->suspend_lock, flags);
+
+ if (omap_kp->suspended)
+ return IRQ_HANDLED;
+
+ spin_unlock_irqrestore(&omap_kp->suspend_lock, flags);

Here you are returning with the lock held and IRQs disabled. It should be
like this:

spin_lock_irqsave(&omap_kp->suspend_lock, flags);
if (omap_kp->suspended) {
spin_unlock_irqrestore(&omap_kp->suspend_lock, flags);
return IRQ_HANDLED;
}
spin_unlock_irqrestore(&omap_kp->suspend_lock, flags);

Cheers,
Juha