Skip to content

Commit 8fbd6c1

Browse files
superm1rafaeljw
authored andcommitted
ACPI: PM: Adjust behavior for field problems on AMD systems
Some AMD Systems with uPEP _HID AMD004/AMDI005 have an off by one bug in their function mask return. This means that they will call entrance but not exit for matching functions. Other AMD systems with this HID should use the Microsoft generic UUID. AMD systems with uPEP HID AMDI006 should be using the Microsoft method. Signed-off-by: Mario Limonciello <[email protected]> Tested-by: Julian Sikorski <[email protected]> Tested-by: Kai-Heng Feng <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5dbf509 commit 8fbd6c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/acpi/x86/s2idle.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,27 @@ static int lps0_device_attach(struct acpi_device *adev,
371371
return 0;
372372

373373
if (acpi_s2idle_vendor_amd()) {
374+
/* AMD0004, AMDI0005:
375+
* - Should use rev_id 0x0
376+
* - function mask > 0x3: Should use AMD method, but has off by one bug
377+
* - function mask = 0x3: Should use Microsoft method
378+
* AMDI0006:
379+
* - should use rev_id 0x0
380+
* - function mask = 0x3: Should use Microsoft method
381+
*/
382+
const char *hid = acpi_device_hid(adev);
374383
rev_id = 0;
375384
lps0_dsm_func_mask = validate_dsm(adev->handle,
376385
ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
377386
lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle,
378387
ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id,
379388
&lps0_dsm_guid_microsoft);
389+
if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") ||
390+
!strcmp(hid, "AMDI0005"))) {
391+
lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
392+
acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
393+
ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
394+
}
380395
} else {
381396
rev_id = 1;
382397
lps0_dsm_func_mask = validate_dsm(adev->handle,

0 commit comments

Comments
 (0)