[RFC PATCH for 6.13 v1 18/20] thermal: core: Call __thermal_cdev_update() on cdev unbind

Rafael J. Wysocki posted 1 patch 2 months, 2 weeks ago
drivers/thermal/thermal_core.c |    6 ++++++
1 file changed, 6 insertions(+)
[RFC PATCH for 6.13 v1 18/20] thermal: core: Call __thermal_cdev_update() on cdev unbind
Posted by Rafael J. Wysocki 2 months, 2 weeks ago
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

When deleting a thermal instance from a cooling device's list of thermal
instances, update it in case its state has been determined by the thermal
instance going away.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/thermal/thermal_core.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -864,6 +864,12 @@ static void thermal_instance_delete(stru
 	guard(cooling_dev)(instance->cdev);
 
 	list_del(&instance->cdev_node);
+
+	/*
+	 * Update the cdev in case its state has been determined by the thermal
+	 * instance going away.
+	 */
+	__thermal_cdev_update(instance->cdev);
 }
 
 /**