Thermal: x86_pkg_temp: change spin lock
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 24 Sep 2013 18:05:16 +0000 (11:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2013 20:31:38 +0000 (12:31 -0800)
commit583d15959df1bfc179a83b1b53a49ab72455e128
tree0c579d58aa5dbf3076d0cbae0a1cd1b46d5822cf
parentedd644711b563f7c5732c1c05afa0a280c85b547
Thermal: x86_pkg_temp: change spin lock

commit 7bed1b3caaedd5918f0820b29f3b7a2ddc812922 upstream.

x86_pkg_temp receives thermal notifications via a callback from a
therm_throt driver, where thermal interrupts are processed.
This callback is pkg_temp_thermal_platform_thermal_notify. Here to
avoid multiple interrupts from cores in a package, we disable the
source and also set a variable to avoid scheduling delayed work function.
This variable is protected via spin_lock_irqsave. On one buggy platform,
we still receiving interrupts even if the source is disabled. This
can cause deadlock/lockdep warning, when interrupt is generated while under
spinlock in work function.
Change spin_lock to spin_lock_irqsave and spin_unlock to
spin_unlock_irqrestore as the data it is trying to protect can also
be modified in a notification call called from interrupt handler.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Cc: Jonghwan Choi <jhbird.choi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thermal/x86_pkg_temp_thermal.c