[PATCH v2 00/16] Introduce PMF Smart PC Solution Builder Feature

2023-09-30 Thread Shyam Sundar S K
Smart PC Solutions Builder allows for OEM to define a large number of custom system states to dynamically switch to. The system states are referred to as policies, and multiple policies can be loaded onto the system at any given time, however only one policy can be active at a given time. Policy i

[PATCH v2 02/16] platform/x86/amd/pmf: Add support PMF-TA interaction

2023-09-30 Thread Shyam Sundar S K
PMF TA (Trusted Application) loads via the TEE environment into the AMD ASP. PMF-TA supports two commands: 1) Init: Initialize the TA with the PMF Smart PC policy binary and start the policy engine. A policy is a combination of inputs and outputs, where; - the inputs are the changing dynamics of

[PATCH v2 01/16] platform/x86/amd/pmf: Add PMF TEE interface

2023-09-30 Thread Shyam Sundar S K
AMD PMF driver loads the PMF TA (Trusted Application) into the AMD ASP's (AMD Security Processor) TEE (Trusted Execution Environment). PMF Trusted Application is a secured firmware placed under /lib/firmware/amdtee gets loaded only when the TEE environment is initialized. Add the initial code path

[PATCH v2 03/16] platform/x86/amd/pmf: Change return type of amd_pmf_set_dram_addr()

2023-09-30 Thread Shyam Sundar S K
In the current code, the metrics table information was required only for auto-mode or CnQF at a given time. Hence keeping the return type of amd_pmf_set_dram_addr() as static made sense. But with the addition of Smart PC builder feature, the metrics table information has to be shared by the Smart

[PATCH v2 04/16] platform/x86/amd/pmf: Add support for PMF Policy Binary

2023-09-30 Thread Shyam Sundar S K
PMF Policy binary is a encrypted and signed binary that will be part of the BIOS. PMF driver via the ACPI interface checks the existence of Smart PC bit. If the advertised bit is found, PMF driver walks the acpi namespace to find out the policy binary size and the address which has to be passed to

[PATCH v2 05/16] platform/x86/amd/pmf: change amd_pmf_init_features() call sequence

2023-09-30 Thread Shyam Sundar S K
To sideload pmf policy binaries, the Smart PC Solution Builder provides a debugfs file called "update_policy"; that gets created under a new debugfs directory called "pb" and this new directory has to be associated with existing parent directory for PMF driver called "amd_pmf". In the current code

[PATCH v2 06/16] platform/x86/amd/pmf: Add support to get inputs from other subsystems

2023-09-30 Thread Shyam Sundar S K
PMF driver sends changing inputs from each subystem to TA for evaluating the conditions in the policy binary. Add initial support of plumbing in the PMF driver for Smart PC to get information from other subsystems in the kernel. Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmf/M

[PATCH v2 07/16] platform/x86/amd/pmf: Add support update p3t limit

2023-09-30 Thread Shyam Sundar S K
P3T (Peak Package Power Limit) is a metric within the SMU controller that can influence the power limits. Add support from the driver to update P3T limits accordingly. Reviewed-by: Mario Limonciello Signed-off-by: Shyam Sundar S K --- drivers/platform/x86/amd/pmf/pmf.h| 3 +++ drivers/platf

[PATCH v2 08/16] platform/x86/amd/pmf: Add support to update system state

2023-09-30 Thread Shyam Sundar S K
PMF driver based on the output actions from the TA can request to update the system states like entering s0i3, lock screen etc. by generating an uevent. Based on the udev rules set in the userspace the event id matching the uevent shall get updated accordingly using the systemctl. Sample udev rule

[PATCH v2 09/16] platform/x86/amd/pmf: Add facility to dump TA inputs

2023-09-30 Thread Shyam Sundar S K
PMF driver sends constant inputs to TA which its gets via the other subsystems in the kernel. To debug certain TA issues knowing what inputs being sent to TA becomes critical. Add debug facility to the driver which can isolate Smart PC and TA related issues. Also, make source_as_str() as non-stati

[PATCH v2 10/16] platform/x86/amd/pmf: Add capability to sideload of policy binary

2023-09-30 Thread Shyam Sundar S K
A policy binary is OS agnostic, and the same policies are expected to work across the OSes. At times it becomes difficult to debug when the policies inside the policy binaries starts to misbehave. Add a way to sideload such policies independently to debug them via a debugfs entry. Reported-by: ke

[PATCH v2 11/16] platform/x86/amd/pmf: dump policy binary data

2023-09-30 Thread Shyam Sundar S K
Sometimes policy binary retrieved from the BIOS maybe incorrect that can end up in failing to enable the Smart PC solution feature. Use print_hex_dump_debug() to dump the policy binary in hex, so that we debug the issues related to the binary even before sending that to TA. Signed-off-by: Shyam S

[PATCH v2 12/16] platform/x86/amd/pmf: Add PMF-AMDGPU get interface

2023-09-30 Thread Shyam Sundar S K
In order to provide GPU inputs to TA for the Smart PC solution to work, we need to have interface between the PMF driver and the AMDGPU driver. Add the initial code path for get interface from AMDGPU. Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Shyam Sunda

[PATCH v2 13/16] platform/x86/amd/pmf: Add PMF-AMDGPU set interface

2023-09-30 Thread Shyam Sundar S K
For the Smart PC Solution to fully work, it has to enact to the actions coming from TA. Add the initial code path for set interface to AMDGPU. Change amd_pmf_apply_policies() return type, so that it can return errors when the call to retrieve information from amdgpu fails. Co-developed-by: Mario

[PATCH v2 15/16] platform/x86/amd/pmf: Add PMF-AMDSFH interface for HPD

2023-09-30 Thread Shyam Sundar S K
From: Basavaraj Natikar AMDSFH has information about the User presence information via the Human Presence Detection (HPD) sensor which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K S

[PATCH v2 14/16] HID: amd_sfh: rename float_to_int() to amd_sfh_float_to_int()

2023-09-30 Thread Shyam Sundar S K
From: Basavaraj Natikar Current amd_sfh driver has float_to_int() to convert units from float to int. This is fine until this function gets called outside of the current scope of file. Add a prefix "amd_sfh" to float_to_int() so that function represents the driver name. This function will be cal

[PATCH v2 16/16] platform/x86/amd/pmf: Add PMF-AMDSFH interface for ALS

2023-09-30 Thread Shyam Sundar S K
From: Basavaraj Natikar AMDSFH has information about the Ambient light via the Ambient Light Sensor (ALS) which is part of the AMD sensor fusion hub. Add PMF and AMDSFH interface to get this information. make amd_sfh_float_to_int() as non-static function so that this can be called outside of the

Re: [PATCH 06/15] platform/x86/amd/pmf: Add support to get inputs from other subsystems

2023-09-30 Thread Shyam Sundar S K
On 9/26/2023 10:38 PM, Ilpo Järvinen wrote: > On Fri, 22 Sep 2023, Shyam Sundar S K wrote: > >> PMF driver sends changing inputs from each subystem to TA for evaluating >> the conditions in the policy binary. >> >> Add initial support of plumbing in the PMF driver for Smart PC to get >> informa

Re: [PATCH 2/3] power: supply: Don't count 'unknown' scope power supplies

2023-09-30 Thread Sebastian Reichel
Hi, On Tue, Sep 26, 2023 at 05:59:54PM -0500, Mario Limonciello wrote: > On some systems AMD Navi3x dGPU triggers RAS errors on startup; but > only if the amdgpu kernel module is not part of the initramfs. > This is because the hardware is not properly programmed for the > AC/DC state of the syste