Commit 82e180598b54873553fb1d285fb0c90fc54f8f23

Authored by Rafael J. Wysocki

Merge branches 'acpi-processor', 'acpi-hotplug', 'acpi-init', 'acpi-pm' and 'acpica'

* acpi-processor:
  ACPI / scan: reduce log level of "ACPI: \_PR_.CPU4: failed to get CPU APIC ID"
  ACPI / processor: Return specific error value when mapping lapic id

* acpi-hotplug:
  ACPI / scan: Clear match_driver flag in acpi_bus_trim()

* acpi-init:
  ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API

* acpi-pm:
  ACPI / PM: Use ACPI_COMPANION() to get ACPI companions of devices

* acpica:
  ACPICA: Remove bool usage from ACPICA.

Showing 8 changed files Side-by-side Diff

drivers/acpi/acpi_processor.c
... ... @@ -261,7 +261,7 @@
261 261  
262 262 apic_id = acpi_get_apicid(pr->handle, device_declaration, pr->acpi_id);
263 263 if (apic_id < 0) {
264   - acpi_handle_err(pr->handle, "failed to get CPU APIC ID.\n");
  264 + acpi_handle_debug(pr->handle, "failed to get CPU APIC ID.\n");
265 265 return -ENODEV;
266 266 }
267 267 pr->apic_id = apic_id;
drivers/acpi/acpica/acglobal.h
... ... @@ -108,7 +108,7 @@
108 108 /*
109 109 * Optionally enable output from the AML Debug Object.
110 110 */
111   -bool ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
  111 +u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_aml_debug_object, FALSE);
112 112  
113 113 /*
114 114 * Optionally copy the entire DSDT to local memory (instead of simply
... ... @@ -33,6 +33,7 @@
33 33 #include <linux/proc_fs.h>
34 34 #include <linux/acpi.h>
35 35 #include <linux/slab.h>
  36 +#include <linux/regulator/machine.h>
36 37 #ifdef CONFIG_X86
37 38 #include <asm/mpspec.h>
38 39 #endif
... ... @@ -508,6 +509,14 @@
508 509 printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
509 510 goto error0;
510 511 }
  512 +
  513 + /*
  514 + * If the system is using ACPI then we can be reasonably
  515 + * confident that any regulators are managed by the firmware
  516 + * so tell the regulator core it has everything it needs to
  517 + * know.
  518 + */
  519 + regulator_has_full_constraints();
511 520  
512 521 return;
513 522  
drivers/acpi/device_pm.c
... ... @@ -727,18 +727,6 @@
727 727 #endif /* CONFIG_PM_SLEEP */
728 728  
729 729 /**
730   - * acpi_dev_pm_get_node - Get ACPI device node for the given physical device.
731   - * @dev: Device to get the ACPI node for.
732   - */
733   -struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
734   -{
735   - acpi_handle handle = ACPI_HANDLE(dev);
736   - struct acpi_device *adev;
737   -
738   - return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
739   -}
740   -
741   -/**
742 730 * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
743 731 * @dev: Device to put into a low-power state.
744 732 * @adev: ACPI device node corresponding to @dev.
... ... @@ -778,7 +766,7 @@
778 766 */
779 767 int acpi_dev_runtime_suspend(struct device *dev)
780 768 {
781   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  769 + struct acpi_device *adev = ACPI_COMPANION(dev);
782 770 bool remote_wakeup;
783 771 int error;
784 772  
... ... @@ -809,7 +797,7 @@
809 797 */
810 798 int acpi_dev_runtime_resume(struct device *dev)
811 799 {
812   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  800 + struct acpi_device *adev = ACPI_COMPANION(dev);
813 801 int error;
814 802  
815 803 if (!adev)
... ... @@ -862,7 +850,7 @@
862 850 */
863 851 int acpi_dev_suspend_late(struct device *dev)
864 852 {
865   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  853 + struct acpi_device *adev = ACPI_COMPANION(dev);
866 854 u32 target_state;
867 855 bool wakeup;
868 856 int error;
... ... @@ -894,7 +882,7 @@
894 882 */
895 883 int acpi_dev_resume_early(struct device *dev)
896 884 {
897   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  885 + struct acpi_device *adev = ACPI_COMPANION(dev);
898 886 int error;
899 887  
900 888 if (!adev)
... ... @@ -985,7 +973,7 @@
985 973 */
986 974 int acpi_dev_pm_attach(struct device *dev, bool power_on)
987 975 {
988   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  976 + struct acpi_device *adev = ACPI_COMPANION(dev);
989 977  
990 978 if (!adev)
991 979 return -ENODEV;
... ... @@ -1017,7 +1005,7 @@
1017 1005 */
1018 1006 void acpi_dev_pm_detach(struct device *dev, bool power_off)
1019 1007 {
1020   - struct acpi_device *adev = acpi_dev_pm_get_node(dev);
  1008 + struct acpi_device *adev = ACPI_COMPANION(dev);
1021 1009  
1022 1010 if (adev && dev->pm_domain == &acpi_general_pm_domain) {
1023 1011 dev->pm_domain = NULL;
drivers/acpi/processor_core.c
... ... @@ -44,13 +44,13 @@
44 44 (struct acpi_madt_local_apic *)entry;
45 45  
46 46 if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
47   - return 0;
  47 + return -ENODEV;
48 48  
49 49 if (lapic->processor_id != acpi_id)
50   - return 0;
  50 + return -EINVAL;
51 51  
52 52 *apic_id = lapic->id;
53   - return 1;
  53 + return 0;
54 54 }
55 55  
56 56 static int map_x2apic_id(struct acpi_subtable_header *entry,
57 57  
58 58  
... ... @@ -60,14 +60,14 @@
60 60 (struct acpi_madt_local_x2apic *)entry;
61 61  
62 62 if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
63   - return 0;
  63 + return -ENODEV;
64 64  
65 65 if (device_declaration && (apic->uid == acpi_id)) {
66 66 *apic_id = apic->local_apic_id;
67   - return 1;
  67 + return 0;
68 68 }
69 69  
70   - return 0;
  70 + return -EINVAL;
71 71 }
72 72  
73 73 static int map_lsapic_id(struct acpi_subtable_header *entry,
74 74  
75 75  
76 76  
... ... @@ -77,16 +77,16 @@
77 77 (struct acpi_madt_local_sapic *)entry;
78 78  
79 79 if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
80   - return 0;
  80 + return -ENODEV;
81 81  
82 82 if (device_declaration) {
83 83 if ((entry->length < 16) || (lsapic->uid != acpi_id))
84   - return 0;
  84 + return -EINVAL;
85 85 } else if (lsapic->processor_id != acpi_id)
86   - return 0;
  86 + return -EINVAL;
87 87  
88 88 *apic_id = (lsapic->id << 8) | lsapic->eid;
89   - return 1;
  89 + return 0;
90 90 }
91 91  
92 92 static int map_madt_entry(int type, u32 acpi_id)
93 93  
94 94  
... ... @@ -116,13 +116,13 @@
116 116 struct acpi_subtable_header *header =
117 117 (struct acpi_subtable_header *)entry;
118 118 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
119   - if (map_lapic_id(header, acpi_id, &apic_id))
  119 + if (!map_lapic_id(header, acpi_id, &apic_id))
120 120 break;
121 121 } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
122   - if (map_x2apic_id(header, type, acpi_id, &apic_id))
  122 + if (!map_x2apic_id(header, type, acpi_id, &apic_id))
123 123 break;
124 124 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
125   - if (map_lsapic_id(header, type, acpi_id, &apic_id))
  125 + if (!map_lsapic_id(header, type, acpi_id, &apic_id))
126 126 break;
127 127 }
128 128 entry += header->length;
... ... @@ -2105,6 +2105,7 @@
2105 2105 list_for_each_entry_reverse(child, &adev->children, node)
2106 2106 acpi_bus_trim(child);
2107 2107  
  2108 + adev->flags.match_driver = false;
2108 2109 if (handler) {
2109 2110 if (handler->detach)
2110 2111 handler->detach(adev);
drivers/acpi/sysfs.c
... ... @@ -226,7 +226,7 @@
226 226 /* /sys/modules/acpi/parameters/aml_debug_output */
227 227  
228 228 module_param_named(aml_debug_output, acpi_gbl_enable_aml_debug_object,
229   - bool, 0644);
  229 + byte, 0644);
230 230 MODULE_PARM_DESC(aml_debug_output,
231 231 "To enable/disable the ACPI Debug Object output.");
232 232  
include/acpi/acpixf.h
... ... @@ -77,7 +77,7 @@
77 77 extern u8 acpi_gbl_disable_auto_repair;
78 78 extern u8 acpi_gbl_disable_ssdt_table_load;
79 79 extern u8 acpi_gbl_do_not_use_xsdt;
80   -extern bool acpi_gbl_enable_aml_debug_object;
  80 +extern u8 acpi_gbl_enable_aml_debug_object;
81 81 extern u8 acpi_gbl_enable_interpreter_slack;
82 82 extern u32 acpi_gbl_trace_flags;
83 83 extern acpi_name acpi_gbl_trace_method_name;