Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Pull ACPI fixes from Rafael Wysocki:
"These fix a recent regression in the ACPI EC driver and make system
suspend work on multiple platforms where StorageD3Enable _DSD is
missing in the ACPI tables.

Specifics:

- Make the ACPI EC driver directly evaluate an "orphan" _REG method
under the EC device, if present, which stopped being evaluated
after the driver had started to install its EC address space
handler at the root of the ACPI namespace (Rafael Wysocki)

- Make more devices put NVMe storage devices into D3 at suspend to
work around missing StorageD3Enable _DSD in the BIOS (Mario
Limonciello)"

* tag 'acpi-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: EC: Evaluate orphan _REG under EC device
ACPI: x86: Force StorageD3Enable on more products

+76 -19
+4
drivers/acpi/acpica/acevents.h
··· 191 191 acpi_ev_execute_reg_methods(struct acpi_namespace_node *node, 192 192 acpi_adr_space_type space_id, u32 function); 193 193 194 + void 195 + acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *node, 196 + acpi_adr_space_type space_id); 197 + 194 198 acpi_status 195 199 acpi_ev_execute_reg_method(union acpi_operand_object *region_obj, u32 function); 196 200
+1 -5
drivers/acpi/acpica/evregion.c
··· 20 20 21 21 /* Local prototypes */ 22 22 23 - static void 24 - acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *device_node, 25 - acpi_adr_space_type space_id); 26 - 27 23 static acpi_status 28 24 acpi_ev_reg_run(acpi_handle obj_handle, 29 25 u32 level, void *context, void **return_value); ··· 814 818 * 815 819 ******************************************************************************/ 816 820 817 - static void 821 + void 818 822 acpi_ev_execute_orphan_reg_method(struct acpi_namespace_node *device_node, 819 823 acpi_adr_space_type space_id) 820 824 {
+54
drivers/acpi/acpica/evxfregn.c
··· 306 306 } 307 307 308 308 ACPI_EXPORT_SYMBOL(acpi_execute_reg_methods) 309 + 310 + /******************************************************************************* 311 + * 312 + * FUNCTION: acpi_execute_orphan_reg_method 313 + * 314 + * PARAMETERS: device - Handle for the device 315 + * space_id - The address space ID 316 + * 317 + * RETURN: Status 318 + * 319 + * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI 320 + * device. This is a _REG method that has no corresponding region 321 + * within the device's scope. 322 + * 323 + ******************************************************************************/ 324 + acpi_status 325 + acpi_execute_orphan_reg_method(acpi_handle device, acpi_adr_space_type space_id) 326 + { 327 + struct acpi_namespace_node *node; 328 + acpi_status status; 329 + 330 + ACPI_FUNCTION_TRACE(acpi_execute_orphan_reg_method); 331 + 332 + /* Parameter validation */ 333 + 334 + if (!device) { 335 + return_ACPI_STATUS(AE_BAD_PARAMETER); 336 + } 337 + 338 + status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); 339 + if (ACPI_FAILURE(status)) { 340 + return_ACPI_STATUS(status); 341 + } 342 + 343 + /* Convert and validate the device handle */ 344 + 345 + node = acpi_ns_validate_handle(device); 346 + if (node) { 347 + 348 + /* 349 + * If an "orphan" _REG method is present in the device's scope 350 + * for the given address space ID, run it. 351 + */ 352 + 353 + acpi_ev_execute_orphan_reg_method(node, space_id); 354 + } else { 355 + status = AE_BAD_PARAMETER; 356 + } 357 + 358 + (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 359 + return_ACPI_STATUS(status); 360 + } 361 + 362 + ACPI_EXPORT_SYMBOL(acpi_execute_orphan_reg_method)
+3
drivers/acpi/ec.c
··· 1507 1507 1508 1508 if (call_reg && !test_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags)) { 1509 1509 acpi_execute_reg_methods(scope_handle, ACPI_ADR_SPACE_EC); 1510 + if (scope_handle != ec->handle) 1511 + acpi_execute_orphan_reg_method(ec->handle, ACPI_ADR_SPACE_EC); 1512 + 1510 1513 set_bit(EC_FLAGS_EC_REG_CALLED, &ec->flags); 1511 1514 } 1512 1515
+10 -14
drivers/acpi/x86/utils.c
··· 206 206 } 207 207 208 208 /* 209 - * AMD systems from Renoir and Lucienne *require* that the NVME controller 209 + * AMD systems from Renoir onwards *require* that the NVME controller 210 210 * is put into D3 over a Modern Standby / suspend-to-idle cycle. 211 211 * 212 212 * This is "typically" accomplished using the `StorageD3Enable` 213 213 * property in the _DSD that is checked via the `acpi_storage_d3` function 214 - * but this property was introduced after many of these systems launched 215 - * and most OEM systems don't have it in their BIOS. 214 + * but some OEM systems still don't have it in their BIOS. 216 215 * 217 216 * The Microsoft documentation for StorageD3Enable mentioned that Windows has 218 - * a hardcoded allowlist for D3 support, which was used for these platforms. 217 + * a hardcoded allowlist for D3 support as well as a registry key to override 218 + * the BIOS, which has been used for these cases. 219 219 * 220 220 * This allows quirking on Linux in a similar fashion. 221 221 * ··· 228 228 * https://bugzilla.kernel.org/show_bug.cgi?id=216773 229 229 * https://bugzilla.kernel.org/show_bug.cgi?id=217003 230 230 * 2) On at least one HP system StorageD3Enable is missing on the second NVME 231 - disk in the system. 231 + * disk in the system. 232 + * 3) On at least one HP Rembrandt system StorageD3Enable is missing on the only 233 + * NVME device. 232 234 */ 233 - static const struct x86_cpu_id storage_d3_cpu_ids[] = { 234 - X86_MATCH_VENDOR_FAM_MODEL(AMD, 23, 24, NULL), /* Picasso */ 235 - X86_MATCH_VENDOR_FAM_MODEL(AMD, 23, 96, NULL), /* Renoir */ 236 - X86_MATCH_VENDOR_FAM_MODEL(AMD, 23, 104, NULL), /* Lucienne */ 237 - X86_MATCH_VENDOR_FAM_MODEL(AMD, 25, 80, NULL), /* Cezanne */ 238 - {} 239 - }; 240 - 241 235 bool force_storage_d3(void) 242 236 { 243 - return x86_match_cpu(storage_d3_cpu_ids); 237 + if (!cpu_feature_enabled(X86_FEATURE_ZEN)) 238 + return false; 239 + return acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0; 244 240 } 245 241 246 242 /*
+4
include/acpi/acpixf.h
··· 663 663 acpi_adr_space_type 664 664 space_id)) 665 665 ACPI_EXTERNAL_RETURN_STATUS(acpi_status 666 + acpi_execute_orphan_reg_method(acpi_handle device, 667 + acpi_adr_space_type 668 + space_id)) 669 + ACPI_EXTERNAL_RETURN_STATUS(acpi_status 666 670 acpi_remove_address_space_handler(acpi_handle 667 671 device, 668 672 acpi_adr_space_type