From f4a821ce6ed41970d0155f55067fb07009974fbe Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Tue, 24 Jul 2012 16:56:21 +0800 Subject: 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. Signed-off-by: Zhang Rui Reviewed-by: Rafael J. Wysocki Reviewed-by: Eduardo Valentin --- include/linux/thermal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 76d0fe88eb1..91b34812cd8 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -95,6 +95,7 @@ struct thermal_cooling_device { void *devdata; const struct thermal_cooling_device_ops *ops; bool updated; /* true if the cooling device does not need update */ + struct mutex lock; /* protect thermal_instances list */ struct list_head thermal_instances; struct list_head node; }; -- cgit v1.2.3