]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: platform_profile: Notify class device from platform_profile_notify()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Dec 2024 03:19:15 +0000 (21:19 -0600)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 10 Dec 2024 17:18:16 +0000 (19:18 +0200)
When a driver has called platform_profile_notify() both the legacy sysfs
interface and the class device should be notified as userspace may listen
to either.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20241206031918.1537-20-mario.limonciello@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/acpi/platform_profile.c

index a1fdc56537baf37db071984c3db317ed7bcbff1a..e105ef48409ec8c15e9a091141470533bce06816 100644 (file)
@@ -412,6 +412,9 @@ void platform_profile_notify(struct platform_profile_handler *pprof)
 {
        if (!cur_profile)
                return;
+       scoped_cond_guard(mutex_intr, return, &profile_lock) {
+               _notify_class_profile(pprof->class_dev, NULL);
+       }
        sysfs_notify(acpi_kobj, NULL, "platform_profile");
 }
 EXPORT_SYMBOL_GPL(platform_profile_notify);