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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull ACPI fixes from Rafael Wysocki:
"These revert a recent IRQ resources handling modification that turned
out to be problematic, fix suspend-to-idle handling on AMD platforms
to take upcoming systems into account properly and fix the retrieval
of the DPTF attributes of the PCH FIVR.

Specifics:

- Revert recent change of the ACPI IRQ resources handling that
attempted to improve the ACPI IRQ override selection logic, but
introduced serious regressions on some systems (Hui Wang).

- Fix up quirks for AMD platforms in the suspend-to-idle support code
so as to take upcoming systems using uPEP HID AMDI007 into account
as appropriate (Mario Limonciello).

- Fix the code retrieving DPTF attributes of the PCH FIVR so that it
agrees on the return data type with the ACPI control method
evaluated for this purpose (Srinivas Pandruvada)"

* tag 'acpi-5.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: DPTF: Fix reading of attributes
Revert "ACPI: resources: Add checks for ACPI IRQ override"
ACPI: PM: Add support for upcoming AMD uPEP HID AMDI007

+52 -18
+43 -8
drivers/acpi/dptf/dptf_pch_fivr.c
··· 9 9 #include <linux/module.h> 10 10 #include <linux/platform_device.h> 11 11 12 + struct pch_fivr_resp { 13 + u64 status; 14 + u64 result; 15 + }; 16 + 17 + static int pch_fivr_read(acpi_handle handle, char *method, struct pch_fivr_resp *fivr_resp) 18 + { 19 + struct acpi_buffer resp = { sizeof(struct pch_fivr_resp), fivr_resp}; 20 + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 21 + struct acpi_buffer format = { sizeof("NN"), "NN" }; 22 + union acpi_object *obj; 23 + acpi_status status; 24 + int ret = -EFAULT; 25 + 26 + status = acpi_evaluate_object(handle, method, NULL, &buffer); 27 + if (ACPI_FAILURE(status)) 28 + return ret; 29 + 30 + obj = buffer.pointer; 31 + if (!obj || obj->type != ACPI_TYPE_PACKAGE) 32 + goto release_buffer; 33 + 34 + status = acpi_extract_package(obj, &format, &resp); 35 + if (ACPI_FAILURE(status)) 36 + goto release_buffer; 37 + 38 + if (fivr_resp->status) 39 + goto release_buffer; 40 + 41 + ret = 0; 42 + 43 + release_buffer: 44 + kfree(buffer.pointer); 45 + return ret; 46 + } 47 + 12 48 /* 13 49 * Presentation of attributes which are defined for INT1045 14 50 * They are: ··· 59 23 char *buf)\ 60 24 {\ 61 25 struct acpi_device *acpi_dev = dev_get_drvdata(dev);\ 62 - unsigned long long val;\ 63 - acpi_status status;\ 26 + struct pch_fivr_resp fivr_resp;\ 27 + int status;\ 64 28 \ 65 - status = acpi_evaluate_integer(acpi_dev->handle, #method,\ 66 - NULL, &val);\ 67 - if (ACPI_SUCCESS(status))\ 68 - return sprintf(buf, "%d\n", (int)val);\ 69 - else\ 70 - return -EINVAL;\ 29 + status = pch_fivr_read(acpi_dev->handle, #method, &fivr_resp);\ 30 + if (status)\ 31 + return status;\ 32 + \ 33 + return sprintf(buf, "%llu\n", fivr_resp.result);\ 71 34 } 72 35 73 36 #define PCH_FIVR_STORE(name, method) \
+1 -8
drivers/acpi/resource.c
··· 423 423 } 424 424 } 425 425 426 - static bool irq_is_legacy(struct acpi_resource_irq *irq) 427 - { 428 - return irq->triggering == ACPI_EDGE_SENSITIVE && 429 - irq->polarity == ACPI_ACTIVE_HIGH && 430 - irq->shareable == ACPI_EXCLUSIVE; 431 - } 432 - 433 426 /** 434 427 * acpi_dev_resource_interrupt - Extract ACPI interrupt resource information. 435 428 * @ares: Input ACPI resource object. ··· 461 468 } 462 469 acpi_dev_get_irqresource(res, irq->interrupts[index], 463 470 irq->triggering, irq->polarity, 464 - irq->shareable, irq_is_legacy(irq)); 471 + irq->shareable, true); 465 472 break; 466 473 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 467 474 ext_irq = &ares->data.extended_irq;
+8 -2
drivers/acpi/x86/s2idle.c
··· 378 378 * AMDI0006: 379 379 * - should use rev_id 0x0 380 380 * - function mask = 0x3: Should use Microsoft method 381 + * AMDI0007: 382 + * - Should use rev_id 0x2 383 + * - Should only use AMD method 381 384 */ 382 385 const char *hid = acpi_device_hid(adev); 383 - rev_id = 0; 386 + rev_id = strcmp(hid, "AMDI0007") ? 0 : 2; 384 387 lps0_dsm_func_mask = validate_dsm(adev->handle, 385 388 ACPI_LPS0_DSM_UUID_AMD, rev_id, &lps0_dsm_guid); 386 389 lps0_dsm_func_mask_microsoft = validate_dsm(adev->handle, 387 - ACPI_LPS0_DSM_UUID_MICROSOFT, rev_id, 390 + ACPI_LPS0_DSM_UUID_MICROSOFT, 0, 388 391 &lps0_dsm_guid_microsoft); 389 392 if (lps0_dsm_func_mask > 0x3 && (!strcmp(hid, "AMD0004") || 390 393 !strcmp(hid, "AMDI0005"))) { 391 394 lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; 392 395 acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", 393 396 ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); 397 + } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) { 398 + lps0_dsm_func_mask_microsoft = -EINVAL; 399 + acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); 394 400 } 395 401 } else { 396 402 rev_id = 1;