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 branches 'acpi-pm', 'acpi-sysfs', 'acpi-pci' and 'acpi-resource'

Merge ACPI power management updates, ACPI sysfs interface updates, an
ACPI support update related to PCI, and an ACPI device resources
management update for 6.20-rc1/7.0-rc1:

- Rework ACPI PM notification setup for PCI root buses and modify the
ACPI PM setup for devices to register wakeup source objects under
physical (that is, PCI, platform, etc.) devices instead of doing that
under their ACPI companions (Rafael Wysocki)

- Adjust debug messages regarding postponed ACPI PM printed during
system resume to be more accurate (Rafael Wysocki)

- Remove dead code from lps0_device_attach() (Gergo Koteles)

- Start to invoke Microsoft Function 9 (Turn On Display) of the Low-
Power S0 Idle (LPS0) _DSM in the suspend-to-idle resume flow on
systems with ACPI LPS0 support to address a functional issue on
Lenovo Yoga Slim 7i Aura (15ILL9), where system fans and keyboard
backlights fail to resume after suspend (Jakob Riemenschneider)

- Add sysfs attribute cid for exposing _CID lists under ACPI device
objects (Rafael Wysocki)

- Replace sprintf() with sysfs_emit() in all of the core ACPI sysfs
interface code (Sumeet Pawnikar)

- Use acpi_get_local_u64_address() in the code implementing ACPI
support for PCI to evaluate _ADR instead of evaluating that object
directly (Andy Shevchenko)

- Add JWIPC JVC9100 to irq1_level_low_skip_override[] to unbreak
serial IRQs on that system (Ai Chao)

* acpi-pm:
ACPI: x86: s2idle: Invoke Microsoft _DSM Function 9 (Turn On Display)
ACPI: PM: Adjust messages regarding postponed ACPI PM
ACPI: x86: s2idle: Remove dead code in lps0_device_attach()
ACPI: PM: Register wakeup sources under physical devices
ACPI: PCI: PM: Rework root bus notification setup

* acpi-sysfs:
ACPI: sysfs: Replace sprintf() with sysfs_emit()
ACPI: sysfs: Add device cid attribute for exposing _CID lists

* acpi-pci:
ACPI: PCI: simplify code with acpi_get_local_u64_address()

* acpi-resource:
ACPI: resource: Add JWIPC JVC9100 to irq1_level_low_skip_override[]

+87 -48
+3 -4
drivers/acpi/device_pm.c
··· 586 586 goto out; 587 587 588 588 mutex_lock(&acpi_pm_notifier_lock); 589 - adev->wakeup.ws = wakeup_source_register(&adev->dev, 590 - dev_name(&adev->dev)); 589 + adev->wakeup.ws = wakeup_source_register(dev, dev_name(&adev->dev)); 591 590 adev->wakeup.context.dev = dev; 592 591 adev->wakeup.context.func = func; 593 592 adev->wakeup.flags.notifier_present = true; ··· 1251 1252 return 0; 1252 1253 1253 1254 if (pm && !pm->resume_early) { 1254 - dev_dbg(dev, "postponing D0 transition to normal resume stage\n"); 1255 + dev_dbg(dev, "Postponing ACPI PM to normal resume stage\n"); 1255 1256 return 0; 1256 1257 } 1257 1258 ··· 1273 1274 int ret = 0; 1274 1275 1275 1276 if (!dev_pm_skip_resume(dev) && pm && !pm->resume_early) { 1276 - dev_dbg(dev, "executing postponed D0 transition\n"); 1277 + dev_dbg(dev, "Applying postponed ACPI PM\n"); 1277 1278 ret = acpi_dev_resume(dev); 1278 1279 } 1279 1280
+41 -10
drivers/acpi/device_sysfs.c
··· 27 27 if (result) 28 28 return result; 29 29 30 - result = sprintf(buf, "%s\n", (char *)path.pointer); 30 + result = sysfs_emit(buf, "%s\n", (char *)path.pointer); 31 31 kfree(path.pointer); 32 32 return result; 33 33 } ··· 347 347 if (ret) 348 348 return ret; 349 349 350 - return sprintf(buf, "%s\n", acpi_power_state_string(state)); 350 + return sysfs_emit(buf, "%s\n", acpi_power_state_string(state)); 351 351 } 352 352 353 353 static DEVICE_ATTR_RO(real_power_state); ··· 357 357 { 358 358 struct acpi_device *adev = to_acpi_device(dev); 359 359 360 - return sprintf(buf, "%s\n", acpi_power_state_string(adev->power.state)); 360 + return sysfs_emit(buf, "%s\n", acpi_power_state_string(adev->power.state)); 361 361 } 362 362 363 363 static DEVICE_ATTR_RO(power_state); ··· 399 399 { 400 400 struct acpi_device *acpi_dev = to_acpi_device(dev); 401 401 402 - return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev)); 402 + return sysfs_emit(buf, "%s\n", acpi_device_hid(acpi_dev)); 403 403 } 404 404 static DEVICE_ATTR_RO(hid); 405 + 406 + static ssize_t cid_show(struct device *dev, struct device_attribute *attr, 407 + char *buf) 408 + { 409 + struct acpi_device *acpi_dev = to_acpi_device(dev); 410 + struct acpi_device_info *info = NULL; 411 + ssize_t len = 0; 412 + 413 + acpi_get_object_info(acpi_dev->handle, &info); 414 + if (!info) 415 + return 0; 416 + 417 + if (info->valid & ACPI_VALID_CID) { 418 + struct acpi_pnp_device_id_list *cid_list = &info->compatible_id_list; 419 + int i; 420 + 421 + for (i = 0; i < cid_list->count - 1; i++) 422 + len += sysfs_emit_at(buf, len, "%s,", cid_list->ids[i].string); 423 + 424 + len += sysfs_emit_at(buf, len, "%s\n", cid_list->ids[i].string); 425 + } 426 + 427 + kfree(info); 428 + 429 + return len; 430 + } 431 + static DEVICE_ATTR_RO(cid); 405 432 406 433 static ssize_t uid_show(struct device *dev, 407 434 struct device_attribute *attr, char *buf) 408 435 { 409 436 struct acpi_device *acpi_dev = to_acpi_device(dev); 410 437 411 - return sprintf(buf, "%s\n", acpi_device_uid(acpi_dev)); 438 + return sysfs_emit(buf, "%s\n", acpi_device_uid(acpi_dev)); 412 439 } 413 440 static DEVICE_ATTR_RO(uid); 414 441 ··· 445 418 struct acpi_device *acpi_dev = to_acpi_device(dev); 446 419 447 420 if (acpi_dev->pnp.bus_address > U32_MAX) 448 - return sprintf(buf, "0x%016llx\n", acpi_dev->pnp.bus_address); 421 + return sysfs_emit(buf, "0x%016llx\n", acpi_dev->pnp.bus_address); 449 422 else 450 - return sprintf(buf, "0x%08llx\n", acpi_dev->pnp.bus_address); 423 + return sysfs_emit(buf, "0x%08llx\n", acpi_dev->pnp.bus_address); 451 424 } 452 425 static DEVICE_ATTR_RO(adr); 453 426 ··· 509 482 if (ACPI_FAILURE(status)) 510 483 return -EIO; 511 484 512 - return sprintf(buf, "%llu\n", sun); 485 + return sysfs_emit(buf, "%llu\n", sun); 513 486 } 514 487 static DEVICE_ATTR_RO(sun); 515 488 ··· 525 498 if (ACPI_FAILURE(status)) 526 499 return -EIO; 527 500 528 - return sprintf(buf, "%llu\n", hrv); 501 + return sysfs_emit(buf, "%llu\n", hrv); 529 502 } 530 503 static DEVICE_ATTR_RO(hrv); 531 504 ··· 540 513 if (ACPI_FAILURE(status)) 541 514 return -EIO; 542 515 543 - return sprintf(buf, "%llu\n", sta); 516 + return sysfs_emit(buf, "%llu\n", sta); 544 517 } 545 518 static DEVICE_ATTR_RO(status); 546 519 547 520 static struct attribute *acpi_attrs[] = { 548 521 &dev_attr_path.attr, 549 522 &dev_attr_hid.attr, 523 + &dev_attr_cid.attr, 550 524 &dev_attr_modalias.attr, 551 525 &dev_attr_description.attr, 552 526 &dev_attr_adr.attr, ··· 589 561 590 562 if (attr == &dev_attr_status) 591 563 return acpi_has_method(dev->handle, "_STA"); 564 + 565 + if (attr == &dev_attr_cid) 566 + return acpi_has_method(dev->handle, "_CID"); 592 567 593 568 /* 594 569 * If device has _EJ0, 'eject' file is created that is used to trigger
+1 -1
drivers/acpi/pci_root.c
··· 738 738 if (no_aspm) 739 739 pcie_no_aspm(); 740 740 741 - pci_acpi_add_bus_pm_notifier(device); 741 + pci_acpi_add_root_pm_notifier(device, root); 742 742 device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid); 743 743 744 744 if (hotadd) {
+5 -5
drivers/acpi/pci_slot.c
··· 42 42 check_slot(acpi_handle handle, unsigned long long *sun) 43 43 { 44 44 int device = -1; 45 - unsigned long long adr, sta; 45 + unsigned long long sta; 46 46 acpi_status status; 47 + u64 adr; 47 48 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 48 49 49 50 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); ··· 57 56 goto out; 58 57 } 59 58 60 - status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); 61 - if (ACPI_FAILURE(status)) { 62 - pr_debug("_ADR returned %d on %s\n", 63 - status, (char *)buffer.pointer); 59 + if (acpi_get_local_u64_address(handle, &adr)) { 60 + pr_debug("_ADR returned with failure on %s\n", 61 + (char *)buffer.pointer); 64 62 goto out; 65 63 } 66 64
+8
drivers/acpi/resource.c
··· 532 532 DMI_MATCH(DMI_BOARD_NAME, "16T90SP"), 533 533 }, 534 534 }, 535 + { 536 + /* JWIPC JVC9100 */ 537 + .matches = { 538 + DMI_MATCH(DMI_BOARD_NAME, "JVC9100"), 539 + }, 540 + }, 535 541 { } 536 542 }; 537 543 ··· 712 706 713 707 static const struct irq_override_cmp override_table[] = { 714 708 { irq1_level_low_skip_override, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, 709 + { irq1_level_low_skip_override, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false }, 710 + { irq1_level_low_skip_override, 11, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 1, false }, 715 711 { irq1_edge_low_force_override, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, 716 712 }; 717 713
+15 -15
drivers/acpi/sysfs.c
··· 687 687 acpi_irq_not_handled; 688 688 all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count = 689 689 acpi_gpe_count; 690 - size = sprintf(buf, "%8u", all_counters[index].count); 690 + size = sysfs_emit(buf, "%8u", all_counters[index].count); 691 691 692 692 /* "gpe_all" or "sci" */ 693 693 if (index >= num_gpes + ACPI_NUM_FIXED_EVENTS) ··· 698 698 goto end; 699 699 700 700 if (status & ACPI_EVENT_FLAG_ENABLE_SET) 701 - size += sprintf(buf + size, " EN"); 701 + size += sysfs_emit_at(buf, size, " EN"); 702 702 else 703 - size += sprintf(buf + size, " "); 703 + size += sysfs_emit_at(buf, size, " "); 704 704 if (status & ACPI_EVENT_FLAG_STATUS_SET) 705 - size += sprintf(buf + size, " STS"); 705 + size += sysfs_emit_at(buf, size, " STS"); 706 706 else 707 - size += sprintf(buf + size, " "); 707 + size += sysfs_emit_at(buf, size, " "); 708 708 709 709 if (!(status & ACPI_EVENT_FLAG_HAS_HANDLER)) 710 - size += sprintf(buf + size, " invalid "); 710 + size += sysfs_emit_at(buf, size, " invalid "); 711 711 else if (status & ACPI_EVENT_FLAG_ENABLED) 712 - size += sprintf(buf + size, " enabled "); 712 + size += sysfs_emit_at(buf, size, " enabled "); 713 713 else if (status & ACPI_EVENT_FLAG_WAKE_ENABLED) 714 - size += sprintf(buf + size, " wake_enabled"); 714 + size += sysfs_emit_at(buf, size, " wake_enabled"); 715 715 else 716 - size += sprintf(buf + size, " disabled "); 716 + size += sysfs_emit_at(buf, size, " disabled "); 717 717 if (status & ACPI_EVENT_FLAG_MASKED) 718 - size += sprintf(buf + size, " masked "); 718 + size += sysfs_emit_at(buf, size, " masked "); 719 719 else 720 - size += sprintf(buf + size, " unmasked"); 720 + size += sysfs_emit_at(buf, size, " unmasked"); 721 721 722 722 end: 723 - size += sprintf(buf + size, "\n"); 723 + size += sysfs_emit_at(buf, size, "\n"); 724 724 return result ? result : size; 725 725 } 726 726 ··· 937 937 938 938 static ssize_t pm_profile_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) 939 939 { 940 - return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile); 940 + return sysfs_emit(buf, "%d\n", acpi_gbl_FADT.preferred_profile); 941 941 } 942 942 943 943 static const struct kobj_attribute pm_profile_attr = __ATTR_RO(pm_profile); ··· 946 946 { 947 947 struct acpi_hotplug_profile *hotplug = to_acpi_hotplug_profile(kobj); 948 948 949 - return sprintf(buf, "%d\n", hotplug->enabled); 949 + return sysfs_emit(buf, "%d\n", hotplug->enabled); 950 950 } 951 951 952 952 static ssize_t enabled_store(struct kobject *kobj, struct kobj_attribute *attr, ··· 1000 1000 static ssize_t force_remove_show(struct kobject *kobj, 1001 1001 struct kobj_attribute *attr, char *buf) 1002 1002 { 1003 - return sprintf(buf, "%d\n", 0); 1003 + return sysfs_emit(buf, "%d\n", 0); 1004 1004 } 1005 1005 1006 1006 static ssize_t force_remove_store(struct kobject *kobj,
+6 -3
drivers/acpi/x86/s2idle.c
··· 49 49 #define ACPI_LPS0_EXIT 6 50 50 #define ACPI_LPS0_MS_ENTRY 7 51 51 #define ACPI_LPS0_MS_EXIT 8 52 + #define ACPI_MS_TURN_ON_DISPLAY 9 52 53 53 54 /* AMD */ 54 55 #define ACPI_LPS0_DSM_UUID_AMD "e3f32452-febc-43ce-9039-932122d37721" ··· 357 356 return "lps0 ms entry"; 358 357 case ACPI_LPS0_MS_EXIT: 359 358 return "lps0 ms exit"; 359 + case ACPI_MS_TURN_ON_DISPLAY: 360 + return "lps0 ms turn on display"; 360 361 } 361 362 } else { 362 363 switch (state) { ··· 466 463 lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1; 467 464 acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n", 468 465 ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask); 469 - } else if (lps0_dsm_func_mask_microsoft > 0 && rev_id) { 470 - lps0_dsm_func_mask_microsoft = -EINVAL; 471 - acpi_handle_debug(adev->handle, "_DSM Using AMD method\n"); 472 466 } 473 467 } else { 474 468 rev_id = 1; ··· 616 616 617 617 if (lps0_dsm_func_mask_microsoft > 0) { 618 618 acpi_sleep_run_lps0_dsm(ACPI_LPS0_EXIT, 619 + lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft); 620 + /* Intent to turn on display */ 621 + acpi_sleep_run_lps0_dsm(ACPI_MS_TURN_ON_DISPLAY, 619 622 lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft); 620 623 /* Modern Standby exit */ 621 624 acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
+6 -9
drivers/pci/pci-acpi.c
··· 847 847 */ 848 848 static void pci_acpi_wake_bus(struct acpi_device_wakeup_context *context) 849 849 { 850 - struct acpi_device *adev; 851 - struct acpi_pci_root *root; 852 - 853 - adev = container_of(context, struct acpi_device, wakeup.context); 854 - root = acpi_driver_data(adev); 855 - pci_pme_wakeup_bus(root->bus); 850 + pci_pme_wakeup_bus(to_pci_host_bridge(context->dev)->bus); 856 851 } 857 852 858 853 /** ··· 880 885 } 881 886 882 887 /** 883 - * pci_acpi_add_bus_pm_notifier - Register PM notifier for root PCI bus. 888 + * pci_acpi_add_root_pm_notifier - Register PM notifier for root PCI bus. 884 889 * @dev: PCI root bridge ACPI device. 890 + * @root: PCI root corresponding to @dev. 885 891 */ 886 - acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev) 892 + acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev, 893 + struct acpi_pci_root *root) 887 894 { 888 - return acpi_add_pm_notifier(dev, NULL, pci_acpi_wake_bus); 895 + return acpi_add_pm_notifier(dev, root->bus->bridge, pci_acpi_wake_bus); 889 896 } 890 897 891 898 /**
+2 -1
include/linux/pci-acpi.h
··· 12 12 #include <linux/acpi.h> 13 13 14 14 #ifdef CONFIG_ACPI 15 - extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev); 15 + extern acpi_status pci_acpi_add_root_pm_notifier(struct acpi_device *dev, 16 + struct acpi_pci_root *pci_root); 16 17 static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev) 17 18 { 18 19 return acpi_remove_pm_notifier(dev);