wakeup: Use irqsave/irqrestore for events_lock
authorJohn Stultz <john.stultz@linaro.org>
Thu, 6 Sep 2012 18:07:37 +0000 (14:07 -0400)
committerVarun Wadekar <vwadekar@nvidia.com>
Tue, 18 Sep 2012 08:29:39 +0000 (13:29 +0530)
commit77dc9066d81029b6a28d5676cd32236cc3495657
treeca2810ccfa592b340ef559b4dd63f07cee944918
parent6b258ba13e7e1358e9161ad345f928201d04150c
wakeup: Use irqsave/irqrestore for events_lock

Jon Medhurst (Tixy) recently noticed a problem with the
events_lock usage. One of the Android patches that uses
wakeup_sources calls wakeup_source_add() with irqs disabled.
However, the event_lock usage in wakeup_source_add() uses
spin_lock_irq()/spin_unlock_irq(), which reenables interrupts.
This results in lockdep warnings.

The fix is to use spin_lock_irqsave()/spin_lock_irqrestore()
instead for the events_lock.

Full bug report here:
https://bugs.launchpad.net/linaro-landing-team-arm/+bug/1037565

Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Android Team <kernel-team@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Jon Medhurst (Tixy) <tixy@linaro.org>
Reported-and-debugged-by: Jon Medhurst (Tixy) <tixy@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Id455188931229f04e353969af389e49b069cb34c
drivers/base/power/wakeup.c