* [PATCH v1] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write()
@ 2025-09-09 11:41 Rafael J. Wysocki
2025-09-10 20:38 ` Mario Limonciello
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-09-09 11:41 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Linux ACPI, Viresh Kumar, Mario Limonciello,
Gautham R . Shenoy
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Make drv_write() call on_each_cpu_mask() instead of using an open-coded
equivalent of the latter.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/cpufreq/acpi-cpufreq.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -335,14 +335,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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write()
2025-09-09 11:41 [PATCH v1] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write() Rafael J. Wysocki
@ 2025-09-10 20:38 ` Mario Limonciello
2025-09-11 9:01 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2025-09-10 20:38 UTC (permalink / raw)
To: Rafael J. Wysocki, Linux PM
Cc: LKML, Linux ACPI, Viresh Kumar, Gautham R . Shenoy
On 9/9/25 6:41 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Make drv_write() call on_each_cpu_mask() instead of using an open-coded
> equivalent of the latter.
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
I feel you should also update the comment before do_drv_write() to
mention it's called with a NULL conditional to
smp_call_function_many_cond(), or just drop that comment.
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> drivers/cpufreq/acpi-cpufreq.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -335,14 +335,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)
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write()
2025-09-10 20:38 ` Mario Limonciello
@ 2025-09-11 9:01 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2025-09-11 9:01 UTC (permalink / raw)
To: Mario Limonciello
Cc: Rafael J. Wysocki, Linux PM, LKML, Linux ACPI, Viresh Kumar,
Gautham R . Shenoy
On Wed, Sep 10, 2025 at 10:38 PM Mario Limonciello <superm1@kernel.org> wrote:
>
> On 9/9/25 6:41 AM, Rafael J. Wysocki wrote:
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > Make drv_write() call on_each_cpu_mask() instead of using an open-coded
> > equivalent of the latter.
> >
> > No intentional functional impact.
> >
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > ---
>
> I feel you should also update the comment before do_drv_write() to
> mention it's called with a NULL conditional to
> smp_call_function_many_cond(), or just drop that comment.
I'll drop it.
> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Thanks!
> > drivers/cpufreq/acpi-cpufreq.c | 8 +-------
> > 1 file changed, 1 insertion(+), 7 deletions(-)
> >
> > --- a/drivers/cpufreq/acpi-cpufreq.c
> > +++ b/drivers/cpufreq/acpi-cpufreq.c
> > @@ -335,14 +335,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)
> >
> >
> >
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-11 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-09 11:41 [PATCH v1] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write() Rafael J. Wysocki
2025-09-10 20:38 ` Mario Limonciello
2025-09-11 9:01 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox