Re: please help with intermittent s2idle problem on AMD laptop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2024-10-22 23:09, Shyam Sundar S K wrote:
Would it be valid to have the driver check for this, as in the
following (untested) patch?


diff --git a/drivers/platform/x86/amd/pmc/pmc.c
b/drivers/platform/x86/amd/pmc/pmc.c
index 6ca497473d78..148d57fc7b95 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -1001,6 +1001,11 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev
*dev)
         amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low,
dev->s2d_msg_id, true);
         amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi,
dev->s2d_msg_id, true);
+       if (!phys_addr_hi && !phys_addr_low) {
+               printk(KERN_WARNING "amd_pmc: STB is not enabled on
the system; disable enable_stb or contact system vendor\n");
+               return -ENOMEM;
+       }
+
         stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
        /* Clear msg_port for other SMU operation */


Something like that could have helped me understand the situation is
better. If a patch like that would be welcome, I can test and submit
it.

Sorry I missed this thread. Yes, please submit this change for review.

Instead of returning -ENOMEM, just return -EINVAL (as the address
obtained from PMFW is incorrect).

No problem. I adjusted the patch a bit, tested it, and sent it to you and platform-driver-x86@xxxxxxxxxxxxxxx as:

[PATCH] platform/x86/amd/pmc: Detect when STB is not available

Please note that I do not have any system where STB is available, so I cannot test the "working" path.

I think I followed the appropriate patch submission guidelines; if not, please let me know.

Thank you,
Corey




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux