lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5044667.31r3eYUQgx@rafael.j.wysocki>
Date: Thu, 11 Sep 2025 14:04:53 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Linux PM <linux-pm@...r.kernel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
 Linux ACPI <linux-acpi@...r.kernel.org>,
 Viresh Kumar <viresh.kumar@...aro.org>,
 Mario Limonciello <mario.limonciello@....com>,
 "Shenoy, Gautham Ranjal" <gautham.shenoy@....com>
Subject: [PATCH v2] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write()

From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

Make drv_write() call on_each_cpu_mask() instead of using an open-coded
equivalent of the latter.

Also remove a comment mentioning the smp_call_function_many() usage
which is not particularly useful anyway.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@...nel.org>
---

v1 -> v2:
   * Drop a comment mentioning smp_call_function_many() usage (Mario)
   * Update changelog

---
 drivers/cpufreq/acpi-cpufreq.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -318,7 +318,6 @@ static u32 drv_read(struct acpi_cpufreq_
 	return cmd.val;
 }
 
-/* Called via smp_call_function_many(), on the target CPUs */
 static void do_drv_write(void *_cmd)
 {
 	struct drv_cmd *cmd = _cmd;
@@ -335,14 +334,8 @@ static void drv_write(struct acpi_cpufre
 		.val = val,
 		.func.write = data->cpu_freq_write,
 	};
-	int this_cpu;
 
-	this_cpu = get_cpu();
-	if (cpumask_test_cpu(this_cpu, mask))
-		do_drv_write(&cmd);
-
-	smp_call_function_many(mask, do_drv_write, &cmd, 1);
-	put_cpu();
+	on_each_cpu_mask(mask, do_drv_write, &cmd, true);
 }
 
 static u32 get_cur_val(const struct cpumask *mask, struct acpi_cpufreq_data *data)




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ