2020-12-20 21:21:49

by Alexander Monakov

[permalink] [raw]
Subject: amd-pmc s2idle driver issues

Hi folks,

I've tried the "platform/x86: amd-pmc: Add AMD platform support for S2Idle"
patch on my Acer Swift SF314-42 laptop (Renoir SoC, Ryzen 4500U CPU) and hit
the following issues:

1. The driver doesn't bind to any device. It has the following binding table:

+static const struct acpi_device_id amd_pmc_acpi_ids[] = {
+ {"AMDI0005", 0},
+ {"AMD0004", 0},
+ { }
+};

This laptop has "AMD0005" instead. Adding it to the list allows the driver to
successfully probe.

2. The debugfs interface does not seem to be very helpful. It shows

SMU FW Info: ffffffff

It's not very informative. The code seems to be fetching SMU version from mmio,
so I guess the file should be saying "FW version" rather than "FW Info", and
then, I think version number is not supposed to be "-1".


(and I'm afraid I cannot use the driver, as there seems to be an issue with
GPU resume: sometimes the screen is frozen or black after resume, so I need
to reboot the laptop :( )

Alexander


2020-12-22 14:18:27

by Deucher, Alexander

[permalink] [raw]
Subject: RE: amd-pmc s2idle driver issues

[AMD Public Use]

> -----Original Message-----
> From: Alexander Monakov <[email protected]>
> Sent: Sunday, December 20, 2020 4:12 PM
> To: [email protected]
> Cc: S-k, Shyam-sundar <[email protected]>; Hans de Goede
> <[email protected]>; Deucher, Alexander
> <[email protected]>; [email protected]
> Subject: amd-pmc s2idle driver issues
>
> Hi folks,
>
> I've tried the "platform/x86: amd-pmc: Add AMD platform support for
> S2Idle"
> patch on my Acer Swift SF314-42 laptop (Renoir SoC, Ryzen 4500U CPU) and
> hit the following issues:
>
> 1. The driver doesn't bind to any device. It has the following binding table:
>
> +static const struct acpi_device_id amd_pmc_acpi_ids[] = {
> + {"AMDI0005", 0},
> + {"AMD0004", 0},
> + { }
> +};
>
> This laptop has "AMD0005" instead. Adding it to the list allows the driver to
> successfully probe.
>
> 2. The debugfs interface does not seem to be very helpful. It shows
>
> SMU FW Info: ffffffff
>
> It's not very informative. The code seems to be fetching SMU version from
> mmio, so I guess the file should be saying "FW version" rather than "FW
> Info", and then, I think version number is not supposed to be "-1".
>

Does your platform support modern standby? You may have to select between legacy S3 and modern standby in the sbios.

>
> (and I'm afraid I cannot use the driver, as there seems to be an issue with
> GPU resume: sometimes the screen is frozen or black after resume, so I
> need to reboot the laptop :( )

We are still working through various platform specific sbios issues on some renoir platforms. We'll be sending out the appropriate quirks to handle them once we've sorted them all out.

Alex

2020-12-22 14:48:39

by Alexander Monakov

[permalink] [raw]
Subject: RE: amd-pmc s2idle driver issues

On Tue, 22 Dec 2020, Deucher, Alexander wrote:

> > I've tried the "platform/x86: amd-pmc: Add AMD platform support for
> > S2Idle"
> > patch on my Acer Swift SF314-42 laptop (Renoir SoC, Ryzen 4500U CPU) and
> > hit the following issues:
> >
> > 1. The driver doesn't bind to any device. It has the following binding table:
> >
> > +static const struct acpi_device_id amd_pmc_acpi_ids[] = {
> > + {"AMDI0005", 0},
> > + {"AMD0004", 0},
> > + { }
> > +};
> >
> > This laptop has "AMD0005" instead. Adding it to the list allows the driver to
> > successfully probe.
> >
> > 2. The debugfs interface does not seem to be very helpful. It shows
> >
> > SMU FW Info: ffffffff
> >
> > It's not very informative. The code seems to be fetching SMU version from
> > mmio, so I guess the file should be saying "FW version" rather than "FW
> > Info", and then, I think version number is not supposed to be "-1".
> >
>
> Does your platform support modern standby? You may have to select between
> legacy S3 and modern standby in the sbios.

Yes. Out-of-the-box it's a "modern standby" laptop. There's a "hidden"
bios menu with extra settings that apparently allows to select legacy S3.
I did not change it, so I'm testing the "modern" mode.

Note that this driver fetches SMU version from MMIO, which looks odd to me:
elsewhere (i.e. in the amdgpu driver) SMU version is retrieved by issuing
the corresponding SMU command, as far as I can tell.

Alexander

2020-12-22 15:22:11

by Deucher, Alexander

[permalink] [raw]
Subject: RE: amd-pmc s2idle driver issues

[AMD Public Use]

> -----Original Message-----
> From: Alexander Monakov <[email protected]>
> Sent: Tuesday, December 22, 2020 9:45 AM
> To: Deucher, Alexander <[email protected]>
> Cc: [email protected]; S-k, Shyam-sundar <Shyam-
> [email protected]>; Hans de Goede <[email protected]>; linux-
> [email protected]
> Subject: RE: amd-pmc s2idle driver issues
>
> On Tue, 22 Dec 2020, Deucher, Alexander wrote:
>
> > > I've tried the "platform/x86: amd-pmc: Add AMD platform support for
> > > S2Idle"
> > > patch on my Acer Swift SF314-42 laptop (Renoir SoC, Ryzen 4500U CPU)
> > > and hit the following issues:
> > >
> > > 1. The driver doesn't bind to any device. It has the following binding table:
> > >
> > > +static const struct acpi_device_id amd_pmc_acpi_ids[] = {
> > > + {"AMDI0005", 0},
> > > + {"AMD0004", 0},
> > > + { }
> > > +};
> > >
> > > This laptop has "AMD0005" instead. Adding it to the list allows the
> > > driver to successfully probe.
> > >
> > > 2. The debugfs interface does not seem to be very helpful. It shows
> > >
> > > SMU FW Info: ffffffff
> > >
> > > It's not very informative. The code seems to be fetching SMU version
> > > from mmio, so I guess the file should be saying "FW version" rather
> > > than "FW Info", and then, I think version number is not supposed to be "-
> 1".
> > >
> >
> > Does your platform support modern standby? You may have to select
> > between legacy S3 and modern standby in the sbios.
>
> Yes. Out-of-the-box it's a "modern standby" laptop. There's a "hidden"
> bios menu with extra settings that apparently allows to select legacy S3.
> I did not change it, so I'm testing the "modern" mode.
>
> Note that this driver fetches SMU version from MMIO, which looks odd to
> me:
> elsewhere (i.e. in the amdgpu driver) SMU version is retrieved by issuing the
> corresponding SMU command, as far as I can tell.

There are multiple interfaces to the SMU. It's shared by the entire SoC on APUs.

Alex

2020-12-22 15:59:43

by Alexander Monakov

[permalink] [raw]
Subject: RE: amd-pmc s2idle driver issues

On Tue, 22 Dec 2020, Deucher, Alexander wrote:

> > Yes. Out-of-the-box it's a "modern standby" laptop. There's a "hidden"
> > bios menu with extra settings that apparently allows to select legacy S3.
> > I did not change it, so I'm testing the "modern" mode.
> >
> > Note that this driver fetches SMU version from MMIO, which looks odd to
> > me:
> > elsewhere (i.e. in the amdgpu driver) SMU version is retrieved by issuing the
> > corresponding SMU command, as far as I can tell.
>
> There are multiple interfaces to the SMU. It's shared by the entire SoC on
> APUs.

Just pointing that out because evidently this interface does not work on this
laptop, producing all-ones instead of something resembling a version number.

Which APU generations does this driver support? If it does not support Renoir
(yet?) it should be documented in the Kconfig text. Is Renoir support related
to missing AMD0005 ACPI id binding, and borked version number info?

Alexander

2020-12-22 16:48:04

by Deucher, Alexander

[permalink] [raw]
Subject: RE: amd-pmc s2idle driver issues

[AMD Public Use]

> -----Original Message-----
> From: Alexander Monakov <[email protected]>
> Sent: Tuesday, December 22, 2020 10:57 AM
> To: Deucher, Alexander <[email protected]>
> Cc: [email protected]; S-k, Shyam-sundar <Shyam-
> [email protected]>; Hans de Goede <[email protected]>; linux-
> [email protected]
> Subject: RE: amd-pmc s2idle driver issues
>
> On Tue, 22 Dec 2020, Deucher, Alexander wrote:
>
> > > Yes. Out-of-the-box it's a "modern standby" laptop. There's a "hidden"
> > > bios menu with extra settings that apparently allows to select legacy S3.
> > > I did not change it, so I'm testing the "modern" mode.
> > >
> > > Note that this driver fetches SMU version from MMIO, which looks odd
> > > to
> > > me:
> > > elsewhere (i.e. in the amdgpu driver) SMU version is retrieved by
> > > issuing the corresponding SMU command, as far as I can tell.
> >
> > There are multiple interfaces to the SMU. It's shared by the entire
> > SoC on APUs.
>
> Just pointing that out because evidently this interface does not work on this
> laptop, producing all-ones instead of something resembling a version
> number.
>
> Which APU generations does this driver support? If it does not support
> Renoir
> (yet?) it should be documented in the Kconfig text. Is Renoir support related
> to missing AMD0005 ACPI id binding, and borked version number info?

The current code supports both Raven/Picasso and Renoir parts. At least some Renoir parts are supported as that is what we are mainly testing now. I'm not sure why some boards have AMDI0005 vs AMD0005. We'll have to check with the sbios or windows teams.

Alex

2020-12-22 17:28:05

by Shyam Sundar S K

[permalink] [raw]
Subject: Re: amd-pmc s2idle driver issues



On 12/22/2020 10:14 PM, Deucher, Alexander wrote:
> [AMD Public Use]
>
>> -----Original Message-----
>> From: Alexander Monakov <[email protected]>
>> Sent: Tuesday, December 22, 2020 10:57 AM
>> To: Deucher, Alexander <[email protected]>
>> Cc: [email protected]; S-k, Shyam-sundar <Shyam-
>> [email protected]>; Hans de Goede <[email protected]>; linux-
>> [email protected]
>> Subject: RE: amd-pmc s2idle driver issues
>>
>> On Tue, 22 Dec 2020, Deucher, Alexander wrote:
>>
>>>> Yes. Out-of-the-box it's a "modern standby" laptop. There's a "hidden"
>>>> bios menu with extra settings that apparently allows to select legacy S3.
>>>> I did not change it, so I'm testing the "modern" mode.
>>>>
>>>> Note that this driver fetches SMU version from MMIO, which looks odd
>>>> to
>>>> me:
>>>> elsewhere (i.e. in the amdgpu driver) SMU version is retrieved by
>>>> issuing the corresponding SMU command, as far as I can tell.
>>>
>>> There are multiple interfaces to the SMU. It's shared by the entire
>>> SoC on APUs.
>>
>> Just pointing that out because evidently this interface does not work on this
>> laptop, producing all-ones instead of something resembling a version
>> number.
>>
>> Which APU generations does this driver support? If it does not support
>> Renoir
>> (yet?) it should be documented in the Kconfig text. Is Renoir support related
>> to missing AMD0005 ACPI id binding, and borked version number info?
>
> The current code supports both Raven/Picasso and Renoir parts. At least some Renoir parts are supported as that is what we are mainly testing now. I'm not sure why some boards have AMDI0005 vs AMD0005. We'll have to check with the sbios or windows teams.
>

I think newer sbios'es have the AMDI0005 for Renior also. So, I am guessing you might be running an older BIOS. This driver is supposed to work for all generations of RYZEN starting from Picasso (provided you the right bios which supports modern standby).

You can keep an eye if some of the devices are not entering the lowest device state if your kernel is built with this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=146f1ed852a87b802ed6e71c31e189c64871383c

Also, on my reference platform I see the debugfs giving some valid information. Since you have a sbios with AMD0005, I cannot comment much on it.

Thanks,
Shyam