Skip to content

Commit e555c85

Browse files
superm1rafaeljw
authored andcommitted
ACPI: x86: s2idle: Stop using AMD specific codepath for Rembrandt+
After we introduced a module parameter and quirk infrastructure for picking the Microsoft GUID over the SOC vendor GUID we discovered that lots and lots of systems are getting this wrong. The table continues to grow, and is becoming unwieldy. We don't really have any benefit to forcing vendors to populate the AMD GUID. This is just extra work, and more and more vendors seem to mess it up. As the Microsoft GUID is used by Windows as well, it's very likely that it won't be messed up like this. So drop all the quirks forcing it and the Rembrandt behavior. This means that Cezanne or later effectively only run the Microsoft GUID codepath with the exception of HP Elitebook 8*5 G9. Fixes: fd894f0 ("ACPI: x86: s2idle: If a new AMD _HID is missing assume Rembrandt") Cc: stable@vger.kernel.org # 6.1 Reported-by: Benjamin Cheng <ben@bcheng.me> Reported-by: bilkow@tutanota.com Reported-by: Paul <paul@zogpog.com> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2292 Link: https://bugzilla.kernel.org/show_bug.cgi?id=216768 Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Philipp Zabel <philipp.zabel@gmail.com> Tested-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 3ea4539 commit e555c85

File tree

1 file changed

+3
-84
lines changed

1 file changed

+3
-84
lines changed

drivers/acpi/x86/s2idle.c

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ static bool sleep_no_lps0 __read_mostly;
2828
module_param(sleep_no_lps0, bool, 0644);
2929
MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface");
3030

31-
static bool prefer_microsoft_dsm_guid __read_mostly;
32-
module_param(prefer_microsoft_dsm_guid, bool, 0644);
33-
MODULE_PARM_DESC(prefer_microsoft_dsm_guid, "Prefer using Microsoft GUID in LPS0 device _DSM evaluation");
34-
3531
static const struct acpi_device_id lps0_device_ids[] = {
3632
{"PNP0D80", },
3733
{"", },
@@ -369,35 +365,22 @@ static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *d
369365
}
370366

371367
struct amd_lps0_hid_device_data {
372-
const unsigned int rev_id;
373368
const bool check_off_by_one;
374-
const bool prefer_amd_guid;
375369
};
376370

377371
static const struct amd_lps0_hid_device_data amd_picasso = {
378-
.rev_id = 0,
379372
.check_off_by_one = true,
380-
.prefer_amd_guid = false,
381373
};
382374

383375
static const struct amd_lps0_hid_device_data amd_cezanne = {
384-
.rev_id = 0,
385376
.check_off_by_one = false,
386-
.prefer_amd_guid = false,
387-
};
388-
389-
static const struct amd_lps0_hid_device_data amd_rembrandt = {
390-
.rev_id = 2,
391-
.check_off_by_one = false,
392-
.prefer_amd_guid = true,
393377
};
394378

395379
static const struct acpi_device_id amd_hid_ids[] = {
396380
{"AMD0004", (kernel_ulong_t)&amd_picasso, },
397381
{"AMD0005", (kernel_ulong_t)&amd_picasso, },
398382
{"AMDI0005", (kernel_ulong_t)&amd_picasso, },
399383
{"AMDI0006", (kernel_ulong_t)&amd_cezanne, },
400-
{"AMDI0007", (kernel_ulong_t)&amd_rembrandt, },
401384
{}
402385
};
403386

@@ -407,68 +390,7 @@ static int lps0_prefer_amd(const struct dmi_system_id *id)
407390
rev_id = 2;
408391
return 0;
409392
}
410-
411-
static int lps0_prefer_microsoft(const struct dmi_system_id *id)
412-
{
413-
pr_debug("Preferring Microsoft GUID.\n");
414-
prefer_microsoft_dsm_guid = true;
415-
return 0;
416-
}
417-
418393
static const struct dmi_system_id s2idle_dmi_table[] __initconst = {
419-
{
420-
/*
421-
* ASUS TUF Gaming A17 FA707RE
422-
* https://bugzilla.kernel.org/show_bug.cgi?id=216101
423-
*/
424-
.callback = lps0_prefer_microsoft,
425-
.matches = {
426-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
427-
DMI_MATCH(DMI_PRODUCT_NAME, "ASUS TUF Gaming A17"),
428-
},
429-
},
430-
{
431-
/* ASUS ROG Zephyrus G14 (2022) */
432-
.callback = lps0_prefer_microsoft,
433-
.matches = {
434-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
435-
DMI_MATCH(DMI_PRODUCT_NAME, "ROG Zephyrus G14 GA402"),
436-
},
437-
},
438-
{
439-
/*
440-
* Lenovo Yoga Slim 7 Pro X 14ARH7
441-
* https://bugzilla.kernel.org/show_bug.cgi?id=216473 : 82V2
442-
* https://bugzilla.kernel.org/show_bug.cgi?id=216438 : 82TL
443-
*/
444-
.callback = lps0_prefer_microsoft,
445-
.matches = {
446-
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
447-
DMI_MATCH(DMI_PRODUCT_NAME, "82"),
448-
},
449-
},
450-
{
451-
/*
452-
* ASUSTeK COMPUTER INC. ROG Flow X13 GV301RE_GV301RE
453-
* https://gitlab.freedesktop.org/drm/amd/-/issues/2148
454-
*/
455-
.callback = lps0_prefer_microsoft,
456-
.matches = {
457-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
458-
DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X13 GV301"),
459-
},
460-
},
461-
{
462-
/*
463-
* ASUSTeK COMPUTER INC. ROG Flow X16 GV601RW_GV601RW
464-
* https://gitlab.freedesktop.org/drm/amd/-/issues/2148
465-
*/
466-
.callback = lps0_prefer_microsoft,
467-
.matches = {
468-
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
469-
DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X16 GV601"),
470-
},
471-
},
472394
{
473395
/*
474396
* AMD Rembrandt based HP EliteBook 835/845/865 G9
@@ -504,25 +426,22 @@ static int lps0_device_attach(struct acpi_device *adev,
504426
if (dev_id->id[0])
505427
data = (const struct amd_lps0_hid_device_data *) dev_id->driver_data;
506428
else
507-
data = &amd_rembrandt;
508-
rev_id = data->rev_id;
429+
data = &amd_cezanne;
509430
lps0_dsm_func_mask = validate_dsm(adev->handle,
510431
ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid);
511432
if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) {
512433
lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
513434
acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
514435
ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
515-
} else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid &&
516-
!prefer_microsoft_dsm_guid) {
436+
} else if (lps0_dsm_func_mask_microsoft > 0 && rev_id) {
517437
lps0_dsm_func_mask_microsoft = -EINVAL;
518438
acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
519439
}
520440
} else {
521441
rev_id = 1;
522442
lps0_dsm_func_mask = validate_dsm(adev->handle,
523443
ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid);
524-
if (!prefer_microsoft_dsm_guid)
525-
lps0_dsm_func_mask_microsoft = -EINVAL;
444+
lps0_dsm_func_mask_microsoft = -EINVAL;
526445
}
527446

528447
if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0)

0 commit comments

Comments
 (0)