X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	platform-driver-x86@vger.kernel.org,  Patil.Reddy@amd.com,
	mario.limonciello@amd.com, Yijun.Shen@dell.com,
	 Sanket Goswami <Sanket.Goswami@amd.com>
Subject: Re: [PATCH v2 3/9] platform/x86/amd/pmf: Extend custom BIOS inputs for more policies
Date: Mon, 30 Jun 2025 16:18:14 +0300 (EEST)	[thread overview]
Message-ID: <4fd24ae7-e74a-ece9-eb31-b80702799219@linux.intel.com> (raw)
In-Reply-To: <20250617071413.3906284-4-Shyam-sundar.S-k@amd.com>

On Tue, 17 Jun 2025, Shyam Sundar S K wrote:

> The existing amd_pmf driver is limited to supporting just two custom BIOS
> inputs. However, with the updates to the latest PMF TA, there's a
> requirement to broaden this capacity to handle 10 inputs, aligning with
> the TA firmware's capabilities.
> 
> The necessary logic should be implemented to facilitate this expansion of
> functionality.
> 
> Cc: Patil Rajesh Reddy <Patil.Reddy@amd.com>
> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
>  drivers/platform/x86/amd/pmf/pmf.h | 12 +++++++++++-
>  drivers/platform/x86/amd/pmf/spc.c | 13 ++++++++++++-
>  2 files changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index 696b170255e0..10d658dd66cf 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -631,6 +631,14 @@ struct amd_pmf_pb_bitmap {
>  static const struct amd_pmf_pb_bitmap custom_bios_inputs[] __used = {
>  	{"NOTIFY_CUSTOM_BIOS_INPUT1",     BIT(5)},
>  	{"NOTIFY_CUSTOM_BIOS_INPUT2",     BIT(6)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT3",     BIT(7)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT4",     BIT(8)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT5",     BIT(9)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT6",     BIT(10)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT7",     BIT(11)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT8",     BIT(12)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT9",     BIT(13)},
> +	{"NOTIFY_CUSTOM_BIOS_INPUT10",    BIT(14)},
>  };
>  
>  enum platform_type {
> @@ -715,7 +723,9 @@ struct ta_pmf_condition_info {
>  	u32 workload_type;
>  	u32 display_type;
>  	u32 display_state;
> -	u32 rsvd5[150];
> +	u32 rsvd5_1[17];
> +	u32 bios_input[8];
> +	u32 rsvd5[125];
>  };
>  
>  struct ta_pmf_load_policy_table {
> diff --git a/drivers/platform/x86/amd/pmf/spc.c b/drivers/platform/x86/amd/pmf/spc.c
> index e72c11aba31d..167b7455d6b0 100644
> --- a/drivers/platform/x86/amd/pmf/spc.c
> +++ b/drivers/platform/x86/amd/pmf/spc.c
> @@ -92,6 +92,14 @@ void amd_pmf_dump_ta_inputs(struct amd_pmf_dev *dev, struct ta_pmf_enact_table *
>  		laptop_placement_as_str(in->ev_info.device_state));
>  	dev_dbg(dev->dev, "Custom BIOS input1: %u\n", in->ev_info.bios_input1);
>  	dev_dbg(dev->dev, "Custom BIOS input2: %u\n", in->ev_info.bios_input2);
> +	dev_dbg(dev->dev, "Custom BIOS input3: %u\n", in->ev_info.bios_input[0]);
> +	dev_dbg(dev->dev, "Custom BIOS input4: %u\n", in->ev_info.bios_input[1]);
> +	dev_dbg(dev->dev, "Custom BIOS input5: %u\n", in->ev_info.bios_input[2]);
> +	dev_dbg(dev->dev, "Custom BIOS input6: %u\n", in->ev_info.bios_input[3]);
> +	dev_dbg(dev->dev, "Custom BIOS input7: %u\n", in->ev_info.bios_input[4]);
> +	dev_dbg(dev->dev, "Custom BIOS input8: %u\n", in->ev_info.bios_input[5]);
> +	dev_dbg(dev->dev, "Custom BIOS input9: %u\n", in->ev_info.bios_input[6]);
> +	dev_dbg(dev->dev, "Custom BIOS input10: %u\n", in->ev_info.bios_input[7]);

You know, this can use loop. :-D

If you do a similar getter that abstracts the discontinuity from the 
caller as I suggested for the setter side in the other patch, this too can
become a single loop.

>  	dev_dbg(dev->dev, "==== TA inputs END ====\n");
>  }
>  #else
> @@ -101,7 +109,10 @@ void amd_pmf_dump_ta_inputs(struct amd_pmf_dev *dev, struct ta_pmf_enact_table *
>  static void amd_pmf_get_custom_bios_inputs(struct amd_pmf_dev *pdev,
>  					   struct ta_pmf_enact_table *in)
>  {
> -	u32 *bios_inputs[] = {&in->ev_info.bios_input1, &in->ev_info.bios_input2};
> +	u32 *bios_inputs[] = {&in->ev_info.bios_input1, &in->ev_info.bios_input2,
> +		&in->ev_info.bios_input[0], &in->ev_info.bios_input[1], &in->ev_info.bios_input[2],
> +		&in->ev_info.bios_input[3], &in->ev_info.bios_input[4], &in->ev_info.bios_input[5],
> +		&in->ev_info.bios_input[6], &in->ev_info.bios_input[7]};
>  	int i;
>  
>  	if (!pdev->req.pending_req)
> 

-- 
 i.


  reply	other threads:[~2025-06-30 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17  7:14 [PATCH v2 0/9] Enhancements to PMF Driver for Improved Custom BIOS Input Handling Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 1/9] platform/x86/amd/pmf: Add support for adjusting PMF PPT and PPT APU thresholds Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 2/9] platform/x86/amd/pmf: Fix the custom bios input handling mechanism Shyam Sundar S K
2025-06-30 13:16   ` Ilpo Järvinen
2025-07-23  6:48     ` Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 3/9] platform/x86/amd/pmf: Extend custom BIOS inputs for more policies Shyam Sundar S K
2025-06-30 13:18   ` Ilpo Järvinen [this message]
2025-06-17  7:14 ` [PATCH v2 4/9] platform/x86/amd/pmf: Update ta_pmf_action structure member Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 5/9] platform/x86/amd/pmf: Add helper to verify BIOS input notifications are enable/disable Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 6/9] platform/x86/amd/pmf: Add custom BIOS input support for AMD_CPU_ID_PS Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 7/9] platform/x86/amd/pmf: Preserve custom BIOS inputs for evaluating the policies Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 8/9] platform/x86/amd/pmf: Call enact function sooner to process early pending requests Shyam Sundar S K
2025-06-17  7:14 ` [PATCH v2 9/9] platform/x86/amd/pmf: Add debug logs for pending requests and custom BIOS inputs Shyam Sundar S K

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=4fd24ae7-e74a-ece9-eb31-b80702799219@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Patil.Reddy@amd.com \
    --cc=Sanket.Goswami@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=Yijun.Shen@dell.com \
    --cc=hdegoede@redhat.com \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.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