From: Stephen Rothwell Date: Fri, 24 Aug 2012 05:42:37 +0000 (+1000) Subject: Merge remote-tracking branch 'workqueues/for-next' X-Git-Tag: next-20120824~25 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6479daccb01cbc8ab520d3554628734389a4bd6b;p=karo-tx-linux.git Merge remote-tracking branch 'workqueues/for-next' Conflicts: drivers/hid/hid-picolcd.c --- 6479daccb01cbc8ab520d3554628734389a4bd6b diff --cc drivers/thermal/thermal_sys.c index 47498b871903,67789b8345d2..d552a96f08cd --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@@ -703,19 -694,84 +703,16 @@@ thermal_remove_hwmon_sysfs(struct therm static void thermal_zone_device_set_polling(struct thermal_zone_device *tz, int delay) { - cancel_delayed_work(&(tz->poll_queue)); - - if (!delay) - return; - if (delay > 1000) - queue_delayed_work(system_freezable_wq, &(tz->poll_queue), - round_jiffies(msecs_to_jiffies(delay))); + mod_delayed_work(system_freezable_wq, &tz->poll_queue, + round_jiffies(msecs_to_jiffies(delay))); + else if (delay) + mod_delayed_work(system_freezable_wq, &tz->poll_queue, + msecs_to_jiffies(delay)); else - queue_delayed_work(system_freezable_wq, &(tz->poll_queue), - msecs_to_jiffies(delay)); + cancel_delayed_work(&tz->poll_queue); } -static void thermal_zone_device_passive(struct thermal_zone_device *tz, - int temp, int trip_temp, int trip) -{ - int trend = 0; - struct thermal_cooling_device_instance *instance; - struct thermal_cooling_device *cdev; - long state, max_state; - - /* - * Above Trip? - * ----------- - * Calculate the thermal trend (using the passive cooling equation) - * and modify the performance limit for all passive cooling devices - * accordingly. Note that we assume symmetry. - */ - if (temp >= trip_temp) { - tz->passive = true; - - trend = (tz->tc1 * (temp - tz->last_temperature)) + - (tz->tc2 * (temp - trip_temp)); - - /* Heating up? */ - if (trend > 0) { - list_for_each_entry(instance, &tz->cooling_devices, - node) { - if (instance->trip != trip) - continue; - cdev = instance->cdev; - cdev->ops->get_cur_state(cdev, &state); - cdev->ops->get_max_state(cdev, &max_state); - if (state++ < max_state) - cdev->ops->set_cur_state(cdev, state); - } - } else if (trend < 0) { /* Cooling off? */ - list_for_each_entry(instance, &tz->cooling_devices, - node) { - if (instance->trip != trip) - continue; - cdev = instance->cdev; - cdev->ops->get_cur_state(cdev, &state); - cdev->ops->get_max_state(cdev, &max_state); - if (state > 0) - cdev->ops->set_cur_state(cdev, --state); - } - } - return; - } - - /* - * Below Trip? - * ----------- - * Implement passive cooling hysteresis to slowly increase performance - * and avoid thrashing around the passive trip point. Note that we - * assume symmetry. - */ - list_for_each_entry(instance, &tz->cooling_devices, node) { - if (instance->trip != trip) - continue; - cdev = instance->cdev; - cdev->ops->get_cur_state(cdev, &state); - cdev->ops->get_max_state(cdev, &max_state); - if (state > 0) - cdev->ops->set_cur_state(cdev, --state); - if (state == 0) - tz->passive = false; - } -} - static void thermal_zone_device_check(struct work_struct *work) { struct thermal_zone_device *tz = container_of(work, struct