diff mbox series

[v2,1/2] platform/x86/amd/pmc: Fix SMU command submission path on new AMD platform

Message ID 20240822095357.395808-1-Shyam-sundar.S-k@amd.com (mailing list archive)
State Accepted, archived
Headers show
Series [v2,1/2] platform/x86/amd/pmc: Fix SMU command submission path on new AMD platform | expand

Commit Message

Shyam Sundar S K Aug. 22, 2024, 9:53 a.m. UTC
The commit 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for
new AMD platform") was introduced to enable sending mailbox commands to
PMFW on newer platforms. However, it was later discovered that the commit
did not configure the correct message port ID (i.e., S2D or PMC). Without
this configuration, all command submissions to PMFW are treated as
invalid, leading to command failures.

To address this issue, the CPU ID association for the new platform needs
to be added in amd_pmc_get_ip_info(). This ensures that the correct SMU
port IDs are selected.

Fixes: 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for new AMD platform")
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>
---
v2:
 - Split v1 into two patches to address a fix and addition of CPU ID
   support

 drivers/platform/x86/amd/pmc/pmc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Shyam Sundar S K Aug. 22, 2024, 9:55 a.m. UTC | #1
+ Mario

On 8/22/2024 15:23, Shyam Sundar S K wrote:
> The commit 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for
> new AMD platform") was introduced to enable sending mailbox commands to
> PMFW on newer platforms. However, it was later discovered that the commit
> did not configure the correct message port ID (i.e., S2D or PMC). Without
> this configuration, all command submissions to PMFW are treated as
> invalid, leading to command failures.
> 
> To address this issue, the CPU ID association for the new platform needs
> to be added in amd_pmc_get_ip_info(). This ensures that the correct SMU
> port IDs are selected.
> 
> Fixes: 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for new AMD platform")
> 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>
> ---
> v2:
>  - Split v1 into two patches to address a fix and addition of CPU ID
>    support
> 
>  drivers/platform/x86/amd/pmc/pmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index c3e51f0a5c33..f0d389cf1ecb 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -359,6 +359,7 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
>  		dev->smu_msg = 0x538;
>  		break;
>  	case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
> +	case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
>  		dev->num_ips = 22;
>  		dev->s2d_msg_id = 0xDE;
>  		dev->smu_msg = 0x938;
Mario Limonciello Aug. 22, 2024, 1 p.m. UTC | #2
On 8/22/2024 04:53, Shyam Sundar S K wrote:
> The commit 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for
> new AMD platform") was introduced to enable sending mailbox commands to
> PMFW on newer platforms. However, it was later discovered that the commit
> did not configure the correct message port ID (i.e., S2D or PMC). Without
> this configuration, all command submissions to PMFW are treated as
> invalid, leading to command failures.
> 
> To address this issue, the CPU ID association for the new platform needs
> to be added in amd_pmc_get_ip_info(). This ensures that the correct SMU
> port IDs are selected.
> 
> Fixes: 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for new AMD platform")
> 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>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2:
>   - Split v1 into two patches to address a fix and addition of CPU ID
>     support
> 
>   drivers/platform/x86/amd/pmc/pmc.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index c3e51f0a5c33..f0d389cf1ecb 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -359,6 +359,7 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
>   		dev->smu_msg = 0x538;
>   		break;
>   	case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
> +	case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
>   		dev->num_ips = 22;
>   		dev->s2d_msg_id = 0xDE;
>   		dev->smu_msg = 0x938;
Ilpo Järvinen Aug. 23, 2024, 2:19 p.m. UTC | #3
On Thu, 22 Aug 2024, Shyam Sundar S K wrote:

> The commit 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for
> new AMD platform") was introduced to enable sending mailbox commands to
> PMFW on newer platforms. However, it was later discovered that the commit
> did not configure the correct message port ID (i.e., S2D or PMC). Without
> this configuration, all command submissions to PMFW are treated as
> invalid, leading to command failures.
> 
> To address this issue, the CPU ID association for the new platform needs
> to be added in amd_pmc_get_ip_info(). This ensures that the correct SMU
> port IDs are selected.
> 
> Fixes: 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for new AMD platform")
> 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>
> ---

Hi,

I've applied both of these patches to review-ilpo now. The above doesn't 
inspire much confidence though as that sounded like nothing worked with 
426463d94d45 so it probably wasn't tested at all before sending. :-(
Shyam Sundar S K Aug. 23, 2024, 2:29 p.m. UTC | #4
On 8/23/2024 19:49, Ilpo Järvinen wrote:
> On Thu, 22 Aug 2024, Shyam Sundar S K wrote:
> 
>> The commit 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for
>> new AMD platform") was introduced to enable sending mailbox commands to
>> PMFW on newer platforms. However, it was later discovered that the commit
>> did not configure the correct message port ID (i.e., S2D or PMC). Without
>> this configuration, all command submissions to PMFW are treated as
>> invalid, leading to command failures.
>>
>> To address this issue, the CPU ID association for the new platform needs
>> to be added in amd_pmc_get_ip_info(). This ensures that the correct SMU
>> port IDs are selected.
>>
>> Fixes: 426463d94d45 ("platform/x86/amd/pmc: Send OS_HINT command for new AMD platform")
>> 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>
>> ---
> 
> Hi,
> 
> I've applied both of these patches to review-ilpo now. The above doesn't 
> inspire much confidence though as that sounded like nothing worked with 
> 426463d94d45 so it probably wasn't tested at all before sending. :-(
> 

Hi Ilpo,

I apologize for the oversight. The SMU message ID was hardcoded in my
bring-up environment during testing, which is why I didn't consider
adding the CPU ID check in amd_pmc_get_ip_info().

But surely will take of this in future.

Thanks,
Shyam
diff mbox series

Patch

diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index c3e51f0a5c33..f0d389cf1ecb 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -359,6 +359,7 @@  static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
 		dev->smu_msg = 0x538;
 		break;
 	case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
+	case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT:
 		dev->num_ips = 22;
 		dev->s2d_msg_id = 0xDE;
 		dev->smu_msg = 0x938;