handle_thermal_trip(tz, count);
if (event != THERMAL_DEVICE_POWER_CAPABILITY_CHANGED) {
- if (tz->ops->throttle_hotplug)
+ if (tz->ops->throttle_hotplug && tz->cdev_bound)
tz->ops->throttle_hotplug(tz);
}
}
mutex_lock(&thermal_list_lock);
list_for_each_entry(pos, &thermal_tz_list, node)
- if (atomic_cmpxchg(&pos->need_update, 1, 0))
+ if (atomic_cmpxchg(&pos->need_update, 1, 0)) {
+ pos->cdev_bound = true;
thermal_zone_device_update(pos,
THERMAL_EVENT_UNSPECIFIED);
+ }
mutex_unlock(&thermal_list_lock);
return cdev;
* @node: node in thermal_tz_list (in thermal_core.c)
* @poll_queue: delayed work for polling
* @notify_event: Last notification event
+ * @cdev_bound: cooling device bind done
*/
struct thermal_zone_device {
int id;
struct list_head node;
struct delayed_work poll_queue;
enum thermal_notify_event notify_event;
+ bool cdev_bound;
};
/**