From nobody Thu Oct 2 20:27:35 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C870E3128D4; Thu, 11 Sep 2025 12:04:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757592296; cv=none; b=SPx5QsHjuIcfjuSrO739i0VkbHYTACJGPQ2rpbO4yOO/FxSUJXWCwQSyLxxIdbVLikN+eRJE8kFcecyJkB0xc44lVbtUYRbPyx3zXuQ1QkFE11CW4CDx2suBE6U+a0h/+BVDzSv5VNh1+Rotn5kIJRI8iH/C9BWuYdOLGF1vJQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757592296; c=relaxed/simple; bh=PfSG7J+D1YXvousTbGjSna3BrbXANzA+C2Uksj373fI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pYxHYmv79ovHTxpOU6U8rXaA66/E8KuUvTTmdMTo2BjsfdWott7BYB/Ziv/9IIcrU9bFPI9eO/CPanenqjbGG9TaMHbf69Z4YFxx2cOO00KgfHcqkapVtMAkVdquzLypx3UCcCqBTCHOANOXGGJaeIEyaUydLJzOyBVwzTSwkyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=psZsUwZt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="psZsUwZt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63C91C4CEF0; Thu, 11 Sep 2025 12:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757592296; bh=PfSG7J+D1YXvousTbGjSna3BrbXANzA+C2Uksj373fI=; h=From:To:Cc:Subject:Date:From; b=psZsUwZtyah2SCutNeT6o8/7OoRfHDDNXdZ3AJk3u1T4sfHQQJIO8PpovNfJYMsmU 0SiopT3PTQRlVuebAYQGIOkXsb/gqSNEmFv5KS3bWHaPzV+gyVKolMNepRSB0R/YDa oiQDJboMN4GwDkCuQRHE1UpKGa00Wi78J0CsnteBdJb/CWRaLiPK/MZqLnsOxDtwsP OsbkR8xukRqU8h6bn4lm/EG1DnZwFhB05tN8PxSjKIuNO5ttOE9HGUTsJeYuhT5fTq xTgf3uNHpj/aHTfL7UzLHDHrHYBokbSO6txAOrnYug6OW9IbhQtCKt4eya8TUf4ER4 7mWLhwZmxXUaw== From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Linux ACPI , Viresh Kumar , Mario Limonciello , "Shenoy, Gautham Ranjal" Subject: [PATCH v2] cpufreq: ACPI: Use on_each_cpu_mask() in drv_write() Date: Thu, 11 Sep 2025 14:04:53 +0200 Message-ID: <5044667.31r3eYUQgx@rafael.j.wysocki> Organization: Linux Kernel Development Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Rafael J. Wysocki 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 Reviewed-by: Mario Limonciello (AMD) --- 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; } =20 -/* Called via smp_call_function_many(), on the target CPUs */ static void do_drv_write(void *_cmd) { struct drv_cmd *cmd =3D _cmd; @@ -335,14 +334,8 @@ static void drv_write(struct acpi_cpufre .val =3D val, .func.write =3D data->cpu_freq_write, }; - int this_cpu; =20 - this_cpu =3D 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); } =20 static u32 get_cur_val(const struct cpumask *mask, struct acpi_cpufreq_dat= a *data)