Thermal: Introduce locking for cdev.thermal_instances list.
authorZhang Rui <rui.zhang@intel.com>
Tue, 24 Jul 2012 08:56:21 +0000 (16:56 +0800)
committerSimone Willett <swillett@nvidia.com>
Mon, 5 Nov 2012 18:10:28 +0000 (10:10 -0800)
commitbcd76726363464fbcb35642a55a01c529bd74ec0
tree00851ac145b8f72eeac56b08519243a0e6168d71
parent8fd0f84cee147f0249f306046c1057fcf90b35df
Thermal: Introduce locking for cdev.thermal_instances list.

we need to go over all the thermal_instance list of a cooling device
to decide which cooling state to put the cooling device to.

But at this time, as a cooling device may be referenced in multiple
thermal zones, we need to lock the list first in case
another thermal zone is updating this cooling device.

bug 1059470

Change-Id: I9dfbfc397886e837d47c61ba019e5ca938aeb9f0
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
Reviewed-on: http://git-master/r/160235
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Joshua Primero <jprimero@nvidia.com>
Tested-by: Joshua Primero <jprimero@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
drivers/thermal/thermal_sys.c
include/linux/thermal.h