]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PM: EM: Notify an event when the performance domain changes
authorChangwoo Min <changwoo@igalia.com>
Mon, 20 Oct 2025 22:09:14 +0000 (07:09 +0900)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 22 Oct 2025 19:44:38 +0000 (21:44 +0200)
Send an event to userspace when a performance domain is created or deleted,
or its energy model is updated.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://patch.msgid.link/20251020220914.320832-11-changwoo@igalia.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/energy_model.c

index 9e35aba4b1139b42bda16ff237fcf365cee9085a..e669d5057fca6da9612575a1c626474e60e7f7c4 100644 (file)
@@ -352,6 +352,8 @@ int em_dev_update_perf_domain(struct device *dev,
        em_table_free(old_table);
 
        mutex_unlock(&em_pd_mutex);
+
+       em_notify_pd_updated(pd);
        return 0;
 }
 EXPORT_SYMBOL_GPL(em_dev_update_perf_domain);
@@ -696,6 +698,7 @@ unlock:
        list_add_tail(&dev->em_pd->node, &em_pd_list);
        mutex_unlock(&em_pd_list_mutex);
 
+       em_notify_pd_created(dev->em_pd);
        return ret;
 }
 EXPORT_SYMBOL_GPL(em_dev_register_pd_no_update);
@@ -718,6 +721,8 @@ void em_dev_unregister_perf_domain(struct device *dev)
        list_del_init(&dev->em_pd->node);
        mutex_unlock(&em_pd_list_mutex);
 
+       em_notify_pd_deleted(dev->em_pd);
+
        /*
         * The mutex separates all register/unregister requests and protects
         * from potential clean-up/setup issues in the debugfs directories.