1 |
From: Mario Limonciello <mario.limonciello@amd.com> |
2 |
Subject: [PATCH 5.15.y] Revert "ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007" |
3 |
Date: Thu, 5 Jan 2023 14:10:50 -0600 |
4 |
|
5 |
A number of AMD based Rembrandt laptops are not working properly in |
6 |
suspend/resume. This has been root caused to be from the BIOS |
7 |
implementation not populating code for the AMD GUID in uPEP, but |
8 |
instead only the Microsoft one. |
9 |
|
10 |
In later kernels this has been fixed by using the Microsoft GUID |
11 |
instead. |
12 |
|
13 |
The following series of patches has fixed it in newer kernels: |
14 |
|
15 |
commit ed470febf837 ("ACPI: PM: s2idle: Add support for upcoming AMD uPEP HID AMDI008") |
16 |
commit 1a2dcab517cb ("ACPI: PM: s2idle: Use LPS0 idle if ACPI_FADT_LOW_POWER_S0 is unset") |
17 |
commit 100a57379380 ("ACPI: x86: s2idle: Move _HID handling for AMD systems into structures") |
18 |
commit fd894f05cf30 ("ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt") |
19 |
commit a0bc002393d4 ("ACPI: x86: s2idle: Add module parameter to prefer Microsoft GUID") |
20 |
commit d0f61e89f08d ("ACPI: x86: s2idle: Add a quirk for ASUS TUF Gaming A17 FA707RE") |
21 |
commit ddeea2c3cb88 ("ACPI: x86: s2idle: Add a quirk for ASUS ROG Zephyrus G14") |
22 |
commit 888ca9c7955e ("ACPI: x86: s2idle: Add a quirk for Lenovo Slim 7 Pro 14ARH7") |
23 |
commit 631b54519e8e ("ACPI: x86: s2idle: Add a quirk for ASUSTeK COMPUTER INC. ROG Flow X13") |
24 |
commit 39f81776c680 ("ACPI: x86: s2idle: Fix a NULL pointer dereference") |
25 |
commit 54bd1e548701 ("ACPI: x86: s2idle: Add another ID to s2idle_dmi_table") |
26 |
commit 577821f756cf ("ACPI: x86: s2idle: Force AMD GUID/_REV 2 on HP Elitebook 865") |
27 |
commit e6d180a35bc0 ("ACPI: x86: s2idle: Stop using AMD specific codepath for Rembrandt+") |
28 |
|
29 |
This is needlessly complex for 5.15.y though. To accomplish the same |
30 |
effective result revert commit f0c6225531e4 ("ACPI: PM: Add support for |
31 |
upcoming AMD uPEP HID AMDI007") instead. |
32 |
|
33 |
Link: https://lore.kernel.org/stable/MN0PR12MB61015DB3D6EDBFD841157918E2F59@MN0PR12MB6101.namprd12.prod.outlook.com/ |
34 |
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> |
35 |
--- |
36 |
drivers/acpi/x86/s2idle.c | 10 ++-------- |
37 |
1 file changed, 2 insertions(+), 8 deletions(-) |
38 |
|
39 |
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c |
40 |
index e0185e841b2a..2af1ae172102 100644 |
41 |
--- a/drivers/acpi/x86/s2idle.c |
42 |
+++ b/drivers/acpi/x86/s2idle.c |
43 |
@@ -378,16 +378,13 @@ static int lps0_device_attach(struct acpi_device *adev, |
44 |
* AMDI0006: |
45 |
* - should use rev_id 0x0 |
46 |
* - function mask = 0x3: Should use Microsoft method |
47 |
- * AMDI0007: |
48 |
- * - Should use rev_id 0x2 |
49 |
- * - Should only use AMD method |
50 |
*/ |
51 |
const char *hid = acpi_device_hid(adev); |
52 |
- rev_id = strcmp(hid, "AMDI0007") ? 0 : 2; |
53 |
+ rev_id = 0; |
54 |
lps0_dsm_func_mask = validate_dsm(adev->handle, |
55 |
ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); |
56 |
lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, |
57 |
- ACPI_LPS0_DSM_UUID_MICROSOFT, 0, |
58 |
+ ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id, |
59 |
&lps0_dsm_guid_microsoft); |
60 |
if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") || |
61 |
!strcmp(hid, "AMD0005") || |
62 |
@@ -395,9 +392,6 @@ static int lps0_device_attach(struct acpi_device *adev, |
63 |
lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; |
64 |
acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", |
65 |
ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); |
66 |
- } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) { |
67 |
- lps0_dsm_func_mask_microsoft = -EINVAL; |
68 |
- acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); |
69 |
} |
70 |
} else { |
71 |
rev_id = 1; |
72 |
-- |
73 |
2.34.1 |