| 0b39ce8f | 19-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use devm_mutex_init() for mutex initialization
Replace mutex_init() with the devm_mutex_init(), to ensure proper mutex cleanup during probe failure and driver removal.
Signed-
platform/x86/amd/pmf: Use devm_mutex_init() for mutex initialization
Replace mutex_init() with the devm_mutex_init(), to ensure proper mutex cleanup during probe failure and driver removal.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20251119085813.546813-2-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 2bd038de | 19-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
Define a new macro BIOS_INPUTS_MAX, to represent the maximum number of BIOS input values. Replace hardcoded array size
platform/x86/amd/pmf: Add BIOS_INPUTS_MAX macro to replace hardcoded array size
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> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251119085813.546813-1-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 278ff704 | 27-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Refactor repetitive BIOS output handling
Replace repetitive switch-case statements for PMF_POLICY_BIOS_OUTPUT_* with a helper function and consolidated case handling. This redu
platform/x86/amd/pmf: Refactor repetitive BIOS output handling
Replace repetitive switch-case statements for PMF_POLICY_BIOS_OUTPUT_* with a helper function and consolidated case handling. This reduces code duplication and improves maintainability.
The 10 BIOS output policies (PMF_POLICY_BIOS_OUTPUT_1 through PMF_POLICY_BIOS_OUTPUT_10) previously each had individual case statements with identical logic. This patch introduces amd_pmf_get_bios_output_idx() to map policy values to array indices, consolidating the handling into a single case block with fallthrough. Also, add a new function amd_pmf_update_bios_output() to simplify the code handling.
This approach handles non-sequential policy enum values gracefully and makes future additions easier to implement.
No functional changes.
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20251127091038.2088387-1-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 7ec374c6 | 20-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Replace magic table id with METRICS_TABLE_ID
Add METRICS_TABLE_ID (7) and use it when requesting the metrics transfer table instead of the hard-coded literal. This clarifies th
platform/x86/amd/pmf: Replace magic table id with METRICS_TABLE_ID
Add METRICS_TABLE_ID (7) and use it when requesting the metrics transfer table instead of the hard-coded literal. This clarifies the meaning of the argument to amd_pmf_send_cmd() and centralizes the table ID definition for easier maintenance.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://patch.msgid.link/20251120105210.3945710-4-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 83f0442a | 20-Nov-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd()
Add SET_CMD and GET_CMD constants and replace boolean values passed as the get/set argument to amd_pmf_send_cmd() with
platform/x86/amd/pmf: Use explicit SET_CMD/GET_CMD flags in amd_pmf_send_cmd()
Add SET_CMD and GET_CMD constants and replace boolean values passed as the get/set argument to amd_pmf_send_cmd() with the new explicit flags. This improves readability, avoids ambiguity around true/false and 0/1 usage. There is no functional change.
Reviewed-by: Mario Limonciello <mario.limonciello@amd.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> Link: https://patch.msgid.link/20251120105210.3945710-3-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 2ab7713d | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add debug logs for pending requests and custom BIOS inputs
This patch adds debug logging capabilities to monitor early pending requests and their associated custom BIOS inputs
platform/x86/amd/pmf: Add debug logs for pending requests and custom BIOS inputs
This patch adds debug logging capabilities to monitor early pending requests and their associated custom BIOS inputs during runtime.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-10-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 62214d94 | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Call enact function sooner to process early pending requests
Call the amd_pmf_invoke_cmd_enact() function to manage early pending requests and their associated custom BIOS inpu
platform/x86/amd/pmf: Call enact function sooner to process early pending requests
Call the amd_pmf_invoke_cmd_enact() function to manage early pending requests and their associated custom BIOS inputs. Add a return statement for cases of failure.
The PMF driver will adjust power settings according to custom BIOS inputs after assessing the policy conditions.
Also, add a new common routine amd_pmf_handle_early_preq() to handle early BIOS pending requests for both v1 and v2 variants.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-9-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| b21ec883 | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Preserve custom BIOS inputs for evaluating the policies
The current code fails to send multiple BIOS input data to the PMF-TA for policy condition evaluation. Only the most rec
platform/x86/amd/pmf: Preserve custom BIOS inputs for evaluating the policies
The current code fails to send multiple BIOS input data to the PMF-TA for policy condition evaluation. Only the most recent BIOS input data is properly sent to the PMF-TA, while previous inputs are overwritten with the zeros.
To address this issue, the BIOS input data should be stored and passed on to the PMF-TA.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-8-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 04199ef4 | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add custom BIOS input support for AMD_CPU_ID_PS
The PMF ACPI Specification (APMF) has been revised to version 1.3 to allow for additional custom BIOS inputs, enabling OEMs to h
platform/x86/amd/pmf: Add custom BIOS input support for AMD_CPU_ID_PS
The PMF ACPI Specification (APMF) has been revised to version 1.3 to allow for additional custom BIOS inputs, enabling OEMs to have more precise thermal management of the system. This update includes adding support to the driver using the new data structure received from the BIOS through the existing APMF interfaces.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-7-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 4389d380 | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add helper to verify BIOS input notifications are enable/disable
Implement a helper function to check if BIOS input notifications are enabled or disabled.
Co-developed-by: Pat
platform/x86/amd/pmf: Add helper to verify BIOS input notifications are enable/disable
Implement a helper function to check if BIOS input notifications are enabled or disabled.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-6-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 37336ecb | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Update ta_pmf_action structure member
The latest PMF TA has been updated with the additional structure members for internal evaluation. Since this same structure is utilized in
platform/x86/amd/pmf: Update ta_pmf_action structure member
The latest PMF TA has been updated with the additional structure members for internal evaluation. Since this same structure is utilized in the driver, it also needs to be updated on the driver side. Otherwise, there will be a mismatch in the byte sizes when copying data from shared memory.
Suggested-by: Yijun Shen <Yijun.Shen@dell.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-5-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| ebc68a34 | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Extend custom BIOS inputs for more policies
The existing amd_pmf driver is limited to supporting just two custom BIOS inputs. However, with the updates to the latest PMF TA, th
platform/x86/amd/pmf: Extend custom BIOS inputs for more policies
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.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-4-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| d82e3d2d | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Fix the custom bios input handling mechanism
Originally, the 'amd_pmf_get_custom_bios_inputs()' function was written under the assumption that the BIOS would only send a single
platform/x86/amd/pmf: Fix the custom bios input handling mechanism
Originally, the 'amd_pmf_get_custom_bios_inputs()' function was written under the assumption that the BIOS would only send a single pending request for the driver to process. However, following OEM enablement, it became clear that multiple pending requests for custom BIOS inputs might be sent at the same time, a scenario that the current code logic does not support when it comes to handling multiple custom BIOS inputs.
To address this, the code logic needs to be improved to not only manage multiple simultaneous custom BIOS inputs but also to ensure it is scalable for future additional inputs.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-3-Shyam-sundar.S-k@amd.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| f10ea2df | 01-Sep-2025 |
Shyam Sundar S K <Shyam-sundar.S-k@amd.com> |
platform/x86/amd/pmf: Add support for adjusting PMF PPT and PPT APU thresholds
The most recent PMF Trusted Application includes enhanced features that allow for modifications to PMF thermal paramete
platform/x86/amd/pmf: Add support for adjusting PMF PPT and PPT APU thresholds
The most recent PMF Trusted Application includes enhanced features that allow for modifications to PMF thermal parameters such as PPT and PPT APU.
This update introduces the necessary driver support to utilize these capabilities.
Co-developed-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Signed-off-by: Patil Rajesh Reddy <Patil.Reddy@amd.com> Tested-by: Yijun Shen <Yijun.Shen@Dell.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Link: https://patch.msgid.link/20250901110140.2519072-2-Shyam-sundar.S-k@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| d7186dfd | 22-May-2025 |
Mario Limonciello <mario.limonciello@amd.com> |
platform/x86/amd: pmf: Simplify error flow in amd_pmf_init_smart_pc()
commit 5b1122fc4995f ("platform/x86/amd/pmf: fix cleanup in amd_pmf_init_smart_pc()") adjusted the error handling flow to use a
platform/x86/amd: pmf: Simplify error flow in amd_pmf_init_smart_pc()
commit 5b1122fc4995f ("platform/x86/amd/pmf: fix cleanup in amd_pmf_init_smart_pc()") adjusted the error handling flow to use a ladder but this isn't actually needed because work is only scheduled in amd_pmf_start_policy_engine() and with device managed cleanups pointers for allocations don't need to be freed.
Adjust the error flow to a single call to amd_pmf_deinit_smart_pc() for the cases that need to clean up.
Cc: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20250512211154.2510397-4-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20250522003457.1516679-4-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 93103d56 | 22-May-2025 |
Mario Limonciello <mario.limonciello@amd.com> |
platform/x86/amd: pmf: Prevent amd_pmf_tee_deinit() from running twice
If any of the tee init fails, pass up the errors and clear the tee_ctx pointer. This will prevent cleaning up multiple times.
platform/x86/amd: pmf: Prevent amd_pmf_tee_deinit() from running twice
If any of the tee init fails, pass up the errors and clear the tee_ctx pointer. This will prevent cleaning up multiple times.
Fixes: ac052d8c08f9d ("platform/x86/amd/pmf: Add PMF TEE interface") Suggested-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20250512211154.2510397-3-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20250522003457.1516679-3-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
| 8e81b9cd | 23-Apr-2025 |
Mario Limonciello <mario.limonciello@amd.com> |
drivers/platform/x86/amd: pmf: Check for invalid Smart PC Policies
commit 376a8c2a14439 ("platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA") added support for platforms that
drivers/platform/x86/amd: pmf: Check for invalid Smart PC Policies
commit 376a8c2a14439 ("platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA") added support for platforms that support an updated TA, however it also exposed a number of platforms that although they have support for the updated TA don't actually populate a policy binary.
Add an explicit check that the policy binary isn't empty before initializing the TA.
Reported-by: Christian Heusel <christian@heusel.eu> Closes: https://lore.kernel.org/platform-driver-x86/ae644428-5bf2-4b30-81ba-0b259ed3449b@heusel.eu/ Fixes: 376a8c2a14439 ("platform/x86/amd/pmf: Update PMF Driver for Compatibility with new PMF-TA") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Christian Heusel <christian@heusel.eu> Link: https://lore.kernel.org/r/20250423132002.3984997-3-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|