From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Hans de Goede <hansg@kernel.org>,
platform-driver-x86@vger.kernel.org, Patil.Reddy@amd.com,
Mario Limonciello <superm1@kernel.org>,
Yijun Shen <Yijun.Shen@Dell.com>
Subject: Re: [PATCH v3 1/2] platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
Date: Tue, 18 Nov 2025 12:18:06 +0200 (EET) [thread overview]
Message-ID: <42ca4926-2d23-c1f8-c999-b7746cc33b16@linux.intel.com> (raw)
In-Reply-To: <20251107110105.4010694-1-Shyam-sundar.S-k@amd.com>
[-- Attachment #1: Type: text/plain, Size: 2354 bytes --]
On Fri, 7 Nov 2025, Shyam Sundar S K wrote:
> Define a new macro BIOS_INPUTS_MAX, to represent the maximum number of
> BIOS input values. Replace hardcoded array sizes in relevant structures
> with this macro to improve readability and maintainability.
>
> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> Tested-by: Yijun Shen <Yijun.Shen@Dell.com>
> Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
> v3:
> - No change
>
> v2:
> - New patch spinned from v1
> - Add new BIOS_INPUTS_MAX macro and replace hardcoded values
>
> drivers/platform/x86/amd/pmf/pmf.h | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index bd19f2a6bc78..2145df4128cd 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -119,6 +119,7 @@ struct cookie_header {
>
> #define APTS_MAX_STATES 16
> #define CUSTOM_BIOS_INPUT_BITS GENMASK(16, 7)
> +#define BIOS_INPUTS_MAX 10
>
> typedef void (*apmf_event_handler_t)(acpi_handle handle, u32 event, void *data);
>
> @@ -204,7 +205,7 @@ struct apmf_sbios_req_v1 {
> u8 skin_temp_apu;
> u8 skin_temp_hs2;
> u8 enable_cnqf;
> - u32 custom_policy[10];
> + u32 custom_policy[BIOS_INPUTS_MAX];
> } __packed;
>
> struct apmf_sbios_req_v2 {
> @@ -216,7 +217,7 @@ struct apmf_sbios_req_v2 {
> u32 stt_min_limit;
> u8 skin_temp_apu;
> u8 skin_temp_hs2;
> - u32 custom_policy[10];
> + u32 custom_policy[BIOS_INPUTS_MAX];
> } __packed;
>
> struct apmf_fan_idx {
> @@ -355,7 +356,7 @@ enum power_modes_v2 {
> };
>
> struct pmf_bios_inputs_prev {
> - u32 custom_bios_inputs[10];
> + u32 custom_bios_inputs[BIOS_INPUTS_MAX];
> };
>
> struct amd_pmf_dev {
> @@ -451,7 +452,7 @@ struct os_power_slider {
> struct amd_pmf_notify_smart_pc_update {
> u16 size;
> u32 pending_req;
> - u32 custom_bios[10];
> + u32 custom_bios[BIOS_INPUTS_MAX];
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Unrelated to the patch, I'm not entirely sure though why the naming
differs for custom_bios_inputs vs custom_bios.
--
i.
prev parent reply other threads:[~2025-11-18 10:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-07 11:01 [PATCH v3 1/2] platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size Shyam Sundar S K
2025-11-07 11:01 ` [PATCH v3 2/2] platform/x86/amd/pmf: Use ring buffer to store custom BIOS input values Shyam Sundar S K
2025-11-18 10:15 ` Ilpo Järvinen
2025-11-19 5:59 ` Shyam Sundar S K
2025-11-18 10:18 ` Ilpo Järvinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42ca4926-2d23-c1f8-c999-b7746cc33b16@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Patil.Reddy@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Yijun.Shen@Dell.com \
--cc=hansg@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=superm1@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).