All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007
@ 2021-07-18  4:11 Mario Limonciello
  2021-07-19 12:09 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Mario Limonciello @ 2021-07-18  4:11 UTC (permalink / raw)
  To: Rafael J . Wysocki, linux-acpi
  Cc: Shyam-sundar.S-k, Mario Limonciello, stable

AMD systems with uPEP HID AMDI007 should be using revision 2 and
the AMD method.

CC: stable@kernel.org # v5.14
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/acpi/x86/s2idle.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 1c507804fb10..fbdbef0ab552 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -378,19 +378,25 @@ static int lps0_device_attach(struct acpi_device *adev,
 		 * AMDI0006:
 		 * - should use rev_id 0x0
 		 * - function mask = 0x3: Should use Microsoft method
+		 * AMDI0007:
+		 * - Should use rev_id 0x2
+		 * - Should only use AMD method
 		 */
 		const char *hid = acpi_device_hid(adev);
-		rev_id = 0;
+		rev_id = strcmp(hid, "AMDI0007") ? 0 : 2;
 		lps0_dsm_func_mask = validate_dsm(adev->handle,
 					ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
 		lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
-					ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
+					ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
 					&lps0_dsm_guid_microsoft);
 		if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
 						 !strcmp(hid, "AMDI0005"))) {
 			lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
 			acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
 					  ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
+		} else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
+			lps0_dsm_func_mask_microsoft = -EINVAL;
+			acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
 		}
 	} else {
 		rev_id = 1;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007
  2021-07-18  4:11 [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007 Mario Limonciello
@ 2021-07-19 12:09 ` Rafael J. Wysocki
  2021-07-19 13:35   ` Limonciello, Mario
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-07-19 12:09 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Rafael J . Wysocki, ACPI Devel Maling List, Shyam Sundar S K, stable

On Sun, Jul 18, 2021 at 6:11 AM Mario Limonciello
<mario.limonciello@amd.com> wrote:
>
> AMD systems with uPEP HID AMDI007 should be using revision 2 and
> the AMD method.
>
> CC: stable@kernel.org # v5.14

Well, what do you mean?

5.14 is still under development.


> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>  drivers/acpi/x86/s2idle.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
> index 1c507804fb10..fbdbef0ab552 100644
> --- a/drivers/acpi/x86/s2idle.c
> +++ b/drivers/acpi/x86/s2idle.c
> @@ -378,19 +378,25 @@ static int lps0_device_attach(struct acpi_device *adev,
>                  * AMDI0006:
>                  * - should use rev_id 0x0
>                  * - function mask = 0x3: Should use Microsoft method
> +                * AMDI0007:
> +                * - Should use rev_id 0x2
> +                * - Should only use AMD method
>                  */
>                 const char *hid = acpi_device_hid(adev);
> -               rev_id = 0;
> +               rev_id = strcmp(hid, "AMDI0007") ? 0 : 2;
>                 lps0_dsm_func_mask = validate_dsm(adev->handle,
>                                         ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
>                 lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
> -                                       ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
> +                                       ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
>                                         &lps0_dsm_guid_microsoft);
>                 if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
>                                                  !strcmp(hid, "AMDI0005"))) {
>                         lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
>                         acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
>                                           ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
> +               } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
> +                       lps0_dsm_func_mask_microsoft = -EINVAL;
> +                       acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
>                 }
>         } else {
>                 rev_id = 1;
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007
  2021-07-19 12:09 ` Rafael J. Wysocki
@ 2021-07-19 13:35   ` Limonciello, Mario
  2021-07-23 15:30     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Limonciello, Mario @ 2021-07-19 13:35 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Rafael J . Wysocki, ACPI Devel Maling List, Shyam Sundar S K, stable

On 7/19/2021 07:09, Rafael J. Wysocki wrote:
> On Sun, Jul 18, 2021 at 6:11 AM Mario Limonciello
> <mario.limonciello@amd.com> wrote:
>>
>> AMD systems with uPEP HID AMDI007 should be using revision 2 and
>> the AMD method.
>>
>> CC: stable@kernel.org # v5.14
> 
> Well, what do you mean?
> 
> 5.14 is still under development.

I didn't want to presume the timing or target that you would accept 
this.  If it's still viable for 5.14, then yes that would be preferable.
Can you just remove that line from commit message?

Thanks,

> 
> 
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/acpi/x86/s2idle.c | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
>> index 1c507804fb10..fbdbef0ab552 100644
>> --- a/drivers/acpi/x86/s2idle.c
>> +++ b/drivers/acpi/x86/s2idle.c
>> @@ -378,19 +378,25 @@ static int lps0_device_attach(struct acpi_device *adev,
>>                   * AMDI0006:
>>                   * - should use rev_id 0x0
>>                   * - function mask = 0x3: Should use Microsoft method
>> +                * AMDI0007:
>> +                * - Should use rev_id 0x2
>> +                * - Should only use AMD method
>>                   */
>>                  const char *hid = acpi_device_hid(adev);
>> -               rev_id = 0;
>> +               rev_id = strcmp(hid, "AMDI0007") ? 0 : 2;
>>                  lps0_dsm_func_mask = validate_dsm(adev->handle,
>>                                          ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
>>                  lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
>> -                                       ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
>> +                                       ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
>>                                          &lps0_dsm_guid_microsoft);
>>                  if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
>>                                                   !strcmp(hid, "AMDI0005"))) {
>>                          lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
>>                          acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
>>                                            ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
>> +               } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
>> +                       lps0_dsm_func_mask_microsoft = -EINVAL;
>> +                       acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
>>                  }
>>          } else {
>>                  rev_id = 1;
>> --
>> 2.25.1
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007
  2021-07-19 13:35   ` Limonciello, Mario
@ 2021-07-23 15:30     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2021-07-23 15:30 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Rafael J. Wysocki, Rafael J . Wysocki, ACPI Devel Maling List,
	Shyam Sundar S K, stable

On Mon, Jul 19, 2021 at 3:35 PM Limonciello, Mario
<mario.limonciello@amd.com> wrote:
>
> On 7/19/2021 07:09, Rafael J. Wysocki wrote:
> > On Sun, Jul 18, 2021 at 6:11 AM Mario Limonciello
> > <mario.limonciello@amd.com> wrote:
> >>
> >> AMD systems with uPEP HID AMDI007 should be using revision 2 and
> >> the AMD method.
> >>
> >> CC: stable@kernel.org # v5.14
> >
> > Well, what do you mean?
> >
> > 5.14 is still under development.
>
> I didn't want to presume the timing or target that you would accept
> this.  If it's still viable for 5.14, then yes that would be preferable.
> Can you just remove that line from commit message?

I've applied it as 5.14-rc material with a Fixes tag pointing to
commit 8fbd6c15ea0a "ACPI: PM: Adjust behavior for field problems on
AMD systems".

Thanks!


> >> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> >> ---
> >>   drivers/acpi/x86/s2idle.c | 10 ++++++++--
> >>   1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
> >> index 1c507804fb10..fbdbef0ab552 100644
> >> --- a/drivers/acpi/x86/s2idle.c
> >> +++ b/drivers/acpi/x86/s2idle.c
> >> @@ -378,19 +378,25 @@ static int lps0_device_attach(struct acpi_device *adev,
> >>                   * AMDI0006:
> >>                   * - should use rev_id 0x0
> >>                   * - function mask = 0x3: Should use Microsoft method
> >> +                * AMDI0007:
> >> +                * - Should use rev_id 0x2
> >> +                * - Should only use AMD method
> >>                   */
> >>                  const char *hid = acpi_device_hid(adev);
> >> -               rev_id = 0;
> >> +               rev_id = strcmp(hid, "AMDI0007") ? 0 : 2;
> >>                  lps0_dsm_func_mask = validate_dsm(adev->handle,
> >>                                          ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
> >>                  lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
> >> -                                       ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
> >> +                                       ACPI_LPS0_DSM_UUID_MICROSOFT, 0,
> >>                                          &lps0_dsm_guid_microsoft);
> >>                  if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
> >>                                                   !strcmp(hid, "AMDI0005"))) {
> >>                          lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
> >>                          acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
> >>                                            ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
> >> +               } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
> >> +                       lps0_dsm_func_mask_microsoft = -EINVAL;
> >> +                       acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
> >>                  }
> >>          } else {
> >>                  rev_id = 1;
> >> --
> >> 2.25.1
> >>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-23 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-18  4:11 [PATCH] ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007 Mario Limonciello
2021-07-19 12:09 ` Rafael J. Wysocki
2021-07-19 13:35   ` Limonciello, Mario
2021-07-23 15:30     ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.