Merge tag 'acpi-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fixes from Rafael Wysocki:
"These are new ACPI IRQ override quirks, low-power S0 idle (S0ix)
support adjustments and ACPI backlight handling fixes, mostly for
platforms using AMD chips.

Specifics:

- Add ACPI IRQ override quirks for Asus ExpertBook B2502, Lenovo
14ALC7, and XMG Core 15 (Hans de Goede, Adrian Freund, Erik
Schumacher).

- Adjust ACPI video detection fallback path to prevent
non-operational ACPI backlight devices from being created on
systems where the native driver does not detect a suitable panel
(Mario Limonciello).

- Fix Apple GMUX backlight detection (Hans de Goede).

- Add a low-power S0 idle (S0ix) handling quirk for HP Elitebook 865
and stop using AMD-specific low-power S0 idle code path for systems
with Rembrandt chips and newer (Mario Limonciello)"

* tag 'acpi-6.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: x86: s2idle: Stop using AMD specific codepath for Rembrandt+
ACPI: x86: s2idle: Force AMD GUID/_REV 2 on HP Elitebook 865
ACPI: video: Fix Apple GMUX backlight detection
ACPI: resource: Add Asus ExpertBook B2502 to Asus quirks
ACPI: resource: do IRQ override on Lenovo 14ALC7
ACPI: resource: do IRQ override on XMG Core 15
ACPI: video: Don't enable fallback path for creating ACPI backlight by default
drm/amd/display: Report to ACPI video if no panels were found
ACPI: video: Allow GPU drivers to report no panels

+82 -83
+12 -5
drivers/acpi/acpi_video.c
··· 70 70 static int only_lcd = -1; 71 71 module_param(only_lcd, int, 0444); 72 72 73 - /* 74 - * Display probing is known to take up to 5 seconds, so delay the fallback 75 - * backlight registration by 5 seconds + 3 seconds for some extra margin. 76 - */ 77 - static int register_backlight_delay = 8; 73 + static int register_backlight_delay; 78 74 module_param(register_backlight_delay, int, 0444); 79 75 MODULE_PARM_DESC(register_backlight_delay, 80 76 "Delay in seconds before doing fallback (non GPU driver triggered) " ··· 2171 2175 2172 2176 return false; 2173 2177 } 2178 + 2179 + /* 2180 + * At least one graphics driver has reported that no LCD is connected 2181 + * via the native interface. cancel the registration for fallback acpi_video0. 2182 + * If another driver still deems this necessary, it can explicitly register it. 2183 + */ 2184 + void acpi_video_report_nolcd(void) 2185 + { 2186 + cancel_delayed_work(&video_bus_register_backlight_work); 2187 + } 2188 + EXPORT_SYMBOL(acpi_video_report_nolcd); 2174 2189 2175 2190 int acpi_video_register(void) 2176 2191 {
+29 -3
drivers/acpi/resource.c
··· 432 432 DMI_MATCH(DMI_BOARD_NAME, "S5602ZA"), 433 433 }, 434 434 }, 435 + { 436 + .ident = "Asus ExpertBook B2502", 437 + .matches = { 438 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 439 + DMI_MATCH(DMI_BOARD_NAME, "B2502CBA"), 440 + }, 441 + }, 435 442 { } 436 443 }; 437 444 438 - static const struct dmi_system_id lenovo_82ra[] = { 445 + static const struct dmi_system_id lenovo_laptop[] = { 446 + { 447 + .ident = "LENOVO IdeaPad Flex 5 14ALC7", 448 + .matches = { 449 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 450 + DMI_MATCH(DMI_PRODUCT_NAME, "82R9"), 451 + }, 452 + }, 439 453 { 440 454 .ident = "LENOVO IdeaPad Flex 5 16ALC7", 441 455 .matches = { 442 456 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 443 457 DMI_MATCH(DMI_PRODUCT_NAME, "82RA"), 458 + }, 459 + }, 460 + { } 461 + }; 462 + 463 + static const struct dmi_system_id schenker_gm_rg[] = { 464 + { 465 + .ident = "XMG CORE 15 (M22)", 466 + .matches = { 467 + DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), 468 + DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"), 444 469 }, 445 470 }, 446 471 { } ··· 483 458 static const struct irq_override_cmp override_table[] = { 484 459 { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, 485 460 { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, 486 - { lenovo_82ra, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, 487 - { lenovo_82ra, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, 461 + { lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, 462 + { lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, 463 + { schenker_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, 488 464 }; 489 465 490 466 static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
+22 -1
drivers/acpi/video_detect.c
··· 34 34 #include <linux/module.h> 35 35 #include <linux/pci.h> 36 36 #include <linux/platform_data/x86/nvidia-wmi-ec-backlight.h> 37 + #include <linux/pnp.h> 37 38 #include <linux/types.h> 38 39 #include <linux/workqueue.h> 39 40 #include <acpi/video.h> ··· 105 104 return false; 106 105 } 107 106 #endif 107 + 108 + static bool apple_gmux_backlight_present(void) 109 + { 110 + struct acpi_device *adev; 111 + struct device *dev; 112 + 113 + adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1); 114 + if (!adev) 115 + return false; 116 + 117 + dev = acpi_get_first_physical_node(adev); 118 + if (!dev) 119 + return false; 120 + 121 + /* 122 + * drivers/platform/x86/apple-gmux.c only supports old style 123 + * Apple GMUX with an IO-resource. 124 + */ 125 + return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL; 126 + } 108 127 109 128 /* Force to use vendor driver when the ACPI device is known to be 110 129 * buggy */ ··· 788 767 if (nvidia_wmi_ec_present) 789 768 return acpi_backlight_nvidia_wmi_ec; 790 769 791 - if (apple_gmux_present()) 770 + if (apple_gmux_backlight_present()) 792 771 return acpi_backlight_apple_gmux; 793 772 794 773 /* Use ACPI video if available, except when native should be preferred. */
+13 -74
drivers/acpi/x86/s2idle.c
··· 28 28 module_param(sleep_no_lps0, bool, 0644); 29 29 MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface"); 30 30 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 - 35 31 static const struct acpi_device_id lps0_device_ids[] = { 36 32 {"PNP0D80", }, 37 33 {"", }, ··· 365 369 } 366 370 367 371 struct amd_lps0_hid_device_data { 368 - const unsigned int rev_id; 369 372 const bool check_off_by_one; 370 - const bool prefer_amd_guid; 371 373 }; 372 374 373 375 static const struct amd_lps0_hid_device_data amd_picasso = { 374 - .rev_id = 0, 375 376 .check_off_by_one = true, 376 - .prefer_amd_guid = false, 377 377 }; 378 378 379 379 static const struct amd_lps0_hid_device_data amd_cezanne = { 380 - .rev_id = 0, 381 380 .check_off_by_one = false, 382 - .prefer_amd_guid = false, 383 - }; 384 - 385 - static const struct amd_lps0_hid_device_data amd_rembrandt = { 386 - .rev_id = 2, 387 - .check_off_by_one = false, 388 - .prefer_amd_guid = true, 389 381 }; 390 382 391 383 static const struct acpi_device_id amd_hid_ids[] = { ··· 381 397 {"AMD0005", (kernel_ulong_t)&amd_picasso, }, 382 398 {"AMDI0005", (kernel_ulong_t)&amd_picasso, }, 383 399 {"AMDI0006", (kernel_ulong_t)&amd_cezanne, }, 384 - {"AMDI0007", (kernel_ulong_t)&amd_rembrandt, }, 385 400 {} 386 401 }; 387 402 388 - static int lps0_prefer_microsoft(const struct dmi_system_id *id) 403 + static int lps0_prefer_amd(const struct dmi_system_id *id) 389 404 { 390 - pr_debug("Preferring Microsoft GUID.\n"); 391 - prefer_microsoft_dsm_guid = true; 405 + pr_debug("Using AMD GUID w/ _REV 2.\n"); 406 + rev_id = 2; 392 407 return 0; 393 408 } 394 - 395 409 static const struct dmi_system_id s2idle_dmi_table[] __initconst = { 396 410 { 397 411 /* 398 - * ASUS TUF Gaming A17 FA707RE 399 - * https://bugzilla.kernel.org/show_bug.cgi?id=216101 412 + * AMD Rembrandt based HP EliteBook 835/845/865 G9 413 + * Contains specialized AML in AMD/_REV 2 path to avoid 414 + * triggering a bug in Qualcomm WLAN firmware. This may be 415 + * removed in the future if that firmware is fixed. 400 416 */ 401 - .callback = lps0_prefer_microsoft, 417 + .callback = lps0_prefer_amd, 402 418 .matches = { 403 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 404 - DMI_MATCH(DMI_PRODUCT_NAME, "ASUS TUF Gaming A17"), 405 - }, 406 - }, 407 - { 408 - /* ASUS ROG Zephyrus G14 (2022) */ 409 - .callback = lps0_prefer_microsoft, 410 - .matches = { 411 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 412 - DMI_MATCH(DMI_PRODUCT_NAME, "ROG Zephyrus G14 GA402"), 413 - }, 414 - }, 415 - { 416 - /* 417 - * Lenovo Yoga Slim 7 Pro X 14ARH7 418 - * https://bugzilla.kernel.org/show_bug.cgi?id=216473 : 82V2 419 - * https://bugzilla.kernel.org/show_bug.cgi?id=216438 : 82TL 420 - */ 421 - .callback = lps0_prefer_microsoft, 422 - .matches = { 423 - DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 424 - DMI_MATCH(DMI_PRODUCT_NAME, "82"), 425 - }, 426 - }, 427 - { 428 - /* 429 - * ASUSTeK COMPUTER INC. ROG Flow X13 GV301RE_GV301RE 430 - * https://gitlab.freedesktop.org/drm/amd/-/issues/2148 431 - */ 432 - .callback = lps0_prefer_microsoft, 433 - .matches = { 434 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 435 - DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X13 GV301"), 436 - }, 437 - }, 438 - { 439 - /* 440 - * ASUSTeK COMPUTER INC. ROG Flow X16 GV601RW_GV601RW 441 - * https://gitlab.freedesktop.org/drm/amd/-/issues/2148 442 - */ 443 - .callback = lps0_prefer_microsoft, 444 - .matches = { 445 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 446 - DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow X16 GV601"), 419 + DMI_MATCH(DMI_BOARD_VENDOR, "HP"), 420 + DMI_MATCH(DMI_BOARD_NAME, "8990"), 447 421 }, 448 422 }, 449 423 {} ··· 426 484 if (dev_id->id[0]) 427 485 data = (const struct amd_lps0_hid_device_data *) dev_id->driver_data; 428 486 else 429 - data = &amd_rembrandt; 430 - rev_id = data->rev_id; 487 + data = &amd_cezanne; 431 488 lps0_dsm_func_mask = validate_dsm(adev->handle, 432 489 ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); 433 490 if (lps0_dsm_func_mask > 0x3 && data->check_off_by_one) { 434 491 lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; 435 492 acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", 436 493 ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); 437 - } else if (lps0_dsm_func_mask_microsoft > 0 && data->prefer_amd_guid && 438 - !prefer_microsoft_dsm_guid) { 494 + } else if (lps0_dsm_func_mask_microsoft > 0 && rev_id) { 439 495 lps0_dsm_func_mask_microsoft = -EINVAL; 440 496 acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); 441 497 } ··· 441 501 rev_id = 1; 442 502 lps0_dsm_func_mask = validate_dsm(adev->handle, 443 503 ACPI_LPS0_DSM_UUID, rev_id, &lps0_dsm_guid); 444 - if (!prefer_microsoft_dsm_guid) 445 - lps0_dsm_func_mask_microsoft = -EINVAL; 504 + lps0_dsm_func_mask_microsoft = -EINVAL; 446 505 } 447 506 448 507 if (lps0_dsm_func_mask < 0 && lps0_dsm_func_mask_microsoft < 0)
+4
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 4361 4361 amdgpu_set_panel_orientation(&aconnector->base); 4362 4362 } 4363 4363 4364 + /* If we didn't find a panel, notify the acpi video detection */ 4365 + if (dm->adev->flags & AMD_IS_APU && dm->num_of_edps == 0) 4366 + acpi_video_report_nolcd(); 4367 + 4364 4368 /* Software is initialized. Now we can register interrupt handlers. */ 4365 4369 switch (adev->asic_type) { 4366 4370 #if defined(CONFIG_DRM_AMD_DC_SI)
+2
include/acpi/video.h
··· 53 53 }; 54 54 55 55 #if IS_ENABLED(CONFIG_ACPI_VIDEO) 56 + extern void acpi_video_report_nolcd(void); 56 57 extern int acpi_video_register(void); 57 58 extern void acpi_video_unregister(void); 58 59 extern void acpi_video_register_backlight(void); ··· 70 69 struct acpi_video_device_brightness **dev_br, 71 70 int *pmax_level); 72 71 #else 72 + static inline void acpi_video_report_nolcd(void) { return; }; 73 73 static inline int acpi_video_register(void) { return -ENODEV; } 74 74 static inline void acpi_video_unregister(void) { return; } 75 75 static inline void acpi_video_register_backlight(void) { return; }