Re: [PATCH v4 1/2] thermal/debugfs: Add thermal cooling device debugfs information

From: Daniel Lezcano
Date: Wed Dec 27 2023 - 05:47:50 EST


On 27/12/2023 11:26, Daniel Lezcano wrote:

[ ... ]

+void thermal_set_delay_jiffies(unsigned long *delay_jiffies, int delay_ms)
{
- if (cdev->ops->set_cur_state(cdev, target))
- return;
+ *delay_jiffies = msecs_to_jiffies(delay_ms);
+ if (delay_ms > 1000)
+ *delay_jiffies = round_jiffies(*delay_jiffies);
+}

Please ignore this version. I forgot to remove this unrelated change from a previous test.

+
+static int thermal_cdev_set_cur_state(struct thermal_cooling_device *cdev, int state)
+{
+ int ret;
- thermal_notify_cdev_state_update(cdev->id, target);
- thermal_cooling_device_stats_update(cdev, target);
+ /*
+ * No check is needed for the ops->set_cur_state as the
+ * registering function checked the ops are correctly set
+ */
+ ret = cdev->ops->set_cur_state(cdev, state);
+ if (!ret) {
+ thermal_notify_cdev_state_update(cdev->id, state);
+ thermal_cooling_device_stats_update(cdev, state);
+ thermal_debug_cdev_state_update(cdev, state);
+ }
+
+ return ret;

[ ... ]

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog