History

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

Pull ACPI updates from Rafael Wysocki: "These eliminate significant AML processing overhead related to using operation regions in system memory, update the ACPICA code in the kernel to upstream revision 20200717 (including a fix to prevent operation region reference counts from overflowing in some cases), remove the last bits of the (long deprecated) ACPI procfs interface and do some assorted cleanups. Specifics: - Eliminate significant AML processing overhead related to using operation regions in system memory by reworking the management of memory mappings in the ACPI code to defer unmap operations (to do them outside of the ACPICA locks, among other things) and making the memory operation reagion handler avoid releasing memory mappings created by it too early (Rafael Wysocki). - Update the ACPICA code in the kernel to upstream revision 20200717: * Prevent operation region reference counts from overflowing in some cases (Erik Kaneda). * Replace one-element array with flexible-array (Gustavo A. R. Silva). - Fix ACPI PCI hotplug reference counting (Rafael Wysocki). - Drop last bits of the ACPI procfs interface (Thomas Renninger). - Drop some redundant checks from the code parsing ACPI tables related to NUMA (Hanjun Guo). - Avoid redundant object evaluation in the ACPI device properties handling code (Heikki Krogerus). - Avoid unecessary memory overhead related to storing the signatures of the ACPI tables recognized by the kernel (Ard Biesheuvel). - Add missing newline characters when printing module parameter values in some places (Xiongfeng Wang). - Update the link to the ACPI specifications in some places (Tiezhu Yang). - Use the fallthrough pseudo-keyword in the ACPI code (Gustavo A. R. Silva). - Drop redundant variable initialization from the APEI code (Colin Ian King). - Drop uninitialized_var() from the ACPI PAD driver (Jason Yan). - Replace HTTP links with HTTPS ones in the ACPI code (Alexander A. Klimov)" * tag 'acpi-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits) ACPI: APEI: remove redundant assignment to variable rc ACPI: NUMA: Remove the useless 'node >= MAX_NUMNODES' check ACPI: NUMA: Remove the useless sub table pointer check ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array() ACPICA: Update version to 20200717 ACPICA: Do not increment operation_region reference counts for field units ACPICA: Replace one-element array with flexible-array ACPI: Replace HTTP links with HTTPS ones ACPI: Use valid link to the ACPI specification ACPI: OSL: Clean up the removal of unused memory mappings ACPI: OSL: Use deferred unmapping in acpi_os_unmap_iomem() ACPI: OSL: Use deferred unmapping in acpi_os_unmap_generic_address() ACPICA: Preserve memory opregion mappings ACPI: OSL: Implement deferred unmapping of ACPI memory ACPI: Use fallthrough pseudo-keyword PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context() ACPI: tables: avoid relocations for table signature array ACPI: PAD: Eliminate usage of uninitialized_var() macro ACPI: sysfs: add newlines when printing module parameters ACPI: EC: add newline when printing 'ec_event_clearing' module parameter ...

Linus Torvalds committed 6 years ago

Commit 2baa85d2 parents 0408497 db1da2f38 files · +167 −620Browse files

Unified · Split

38 files
  1. Documentation/firmware-guide/acpi/DSD-properties-rules.rst +2 −2
  2. Documentation/firmware-guide/acpi/dsd/data-node-references.rst +2 −2
  3. Documentation/firmware-guide/acpi/dsd/graph.rst +5 −5
  4. Documentation/firmware-guide/acpi/dsd/leds.rst +3 −3
  5. Documentation/firmware-guide/acpi/lpit.rst +1 −1
  6. Documentation/hwmon/acpi_power_meter.rst +1 −1
  7. drivers/acpi/Kconfig +2 −20
  8. drivers/acpi/Makefile +0 −1
  9. drivers/acpi/ac.c +1 −107
  10. drivers/acpi/acpi_pad.c +1 −1
  11. drivers/acpi/acpi_processor.c +1 −1
  12. drivers/acpi/acpica/evrgnini.c +8 −6
  13. drivers/acpi/acpica/exprep.c +0 −4
  14. drivers/acpi/acpica/exregion.c +46 −18
  15. drivers/acpi/acpica/utdelete.c +1 −5
  16. drivers/acpi/acpica/utids.c +1 −2
  17. drivers/acpi/apei/hest.c +1 −1
  18. drivers/acpi/battery.c +0 −255
  19. drivers/acpi/button.c +1 −1
  20. drivers/acpi/cm_sbs.c +0 −87
  21. drivers/acpi/dock.c +1 −1
  22. drivers/acpi/ec.c +4 −4
  23. drivers/acpi/evged.c +1 −1
  24. drivers/acpi/nfit/nfit.h +1 −1
  25. drivers/acpi/numa/srat.c +1 −9
  26. drivers/acpi/osl.c +36 −27
  27. drivers/acpi/processor_idle.c +1 −2
  28. drivers/acpi/property.c +2 −12
  29. drivers/acpi/resource.c +1 −1
  30. drivers/acpi/spcr.c +2 −2
  31. drivers/acpi/sysfs.c +6 −6
  32. drivers/acpi/tables.c +7 −18
  33. drivers/pci/hotplug/acpiphp_glue.c +11 −3
  34. drivers/pci/pci-acpi.c +3 −3
  35. include/acpi/acpixf.h +1 −1
  36. include/acpi/actypes.h +10 −4
  37. include/linux/tboot.h +1 −1
  38. tools/power/cpupower/man/cpupower-idle-info.1 +1 −1
Documentation/firmware-guide/acpi/DSD-properties-rules.rst+2−2
@@ -96,5 +96,5 @@ contents. · 95 unmodified lines
96References96References
97==========97==========
98 98
99.. [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf99.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
100.. [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf100.. [2] https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
Documentation/firmware-guide/acpi/dsd/data-node-references.rst+2−2
@@ -85,9 +85,9 @@ References · 84 unmodified lines
85==========85==========
86 86
87[1] Hierarchical Data Extension UUID For _DSD.87[1] Hierarchical Data Extension UUID For _DSD.
88<http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,88<https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
89referenced 2018-07-17.89referenced 2018-07-17.
90 90
91[2] Device Properties UUID For _DSD.91[2] Device Properties UUID For _DSD.
92<http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,92<https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
93referenced 2016-10-04.93referenced 2016-10-04.
Documentation/firmware-guide/acpi/dsd/graph.rst+5−5
@@ -154,23 +154,23 @@ References · 153 unmodified lines
154==========154==========
155 155
156[1] _DSD (Device Specific Data) Implementation Guide.156[1] _DSD (Device Specific Data) Implementation Guide.
157 http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,157 https://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,
158 referenced 2016-10-03.158 referenced 2016-10-03.
159 159
160[2] Devicetree. http://www.devicetree.org, referenced 2016-10-03.160[2] Devicetree. https://www.devicetree.org, referenced 2016-10-03.
161 161
162[3] Documentation/devicetree/bindings/graph.txt162[3] Documentation/devicetree/bindings/graph.txt
163 163
164[4] Device Properties UUID For _DSD.164[4] Device Properties UUID For _DSD.
165 http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,165 https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
166 referenced 2016-10-04.166 referenced 2016-10-04.
167 167
168[5] Hierarchical Data Extension UUID For _DSD.168[5] Hierarchical Data Extension UUID For _DSD.
169 http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,169 https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
170 referenced 2016-10-04.170 referenced 2016-10-04.
171 171
172[6] Advanced Configuration and Power Interface Specification.172[6] Advanced Configuration and Power Interface Specification.
173 http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,173 https://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,
174 referenced 2016-10-04.174 referenced 2016-10-04.
175 175
176[7] _DSD Device Properties Usage Rules.176[7] _DSD Device Properties Usage Rules.
Documentation/firmware-guide/acpi/dsd/leds.rst+3−3
@@ -90,7 +90,7 @@ where · 89 unmodified lines
90References90References
91==========91==========
92 92
93[1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.93[1] Device tree. <URL:https://www.devicetree.org>, referenced 2019-02-21.
94 94
95[2] Advanced Configuration and Power Interface Specification.95[2] Advanced Configuration and Power Interface Specification.
96 <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,96 <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,
@@ -101,11 +101,11 @@ References · 4 unmodified lines
101[4] Documentation/devicetree/bindings/media/video-interfaces.txt101[4] Documentation/devicetree/bindings/media/video-interfaces.txt
102 102
103[5] Device Properties UUID For _DSD.103[5] Device Properties UUID For _DSD.
104 <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,104 <URL:https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
105 referenced 2019-02-21.105 referenced 2019-02-21.
106 106
107[6] Hierarchical Data Extension UUID For _DSD.107[6] Hierarchical Data Extension UUID For _DSD.
108 <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,108 <URL:https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
109 referenced 2019-02-21.109 referenced 2019-02-21.
110 110
111[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst111[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
Documentation/firmware-guide/acpi/lpit.rst+1−1
@@ -7,7 +7,7 @@ Low Power Idle Table (LPIT) · 6 unmodified lines
7To enumerate platform Low Power Idle states, Intel platforms are using7To enumerate platform Low Power Idle states, Intel platforms are using
8“Low Power Idle Table” (LPIT). More details about this table can be8“Low Power Idle Table” (LPIT). More details about this table can be
9downloaded from:9downloaded from:
10http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf10https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
11 11
12Residencies for each low power state can be read via FFH12Residencies for each low power state can be read via FFH
13(Function fixed hardware) or a memory mapped interface.13(Function fixed hardware) or a memory mapped interface.
Documentation/hwmon/acpi_power_meter.rst+1−1
@@ -9,7 +9,7 @@ Supported systems: · 8 unmodified lines
9 9
10 Prefix: 'power_meter'10 Prefix: 'power_meter'
11 11
12 Datasheet: http://acpi.info/, section 10.4.12 Datasheet: https://uefi.org/specifications, section 10.4.
13 13
14Author: Darrick J. Wong14Author: Darrick J. Wong
15 15
drivers/acpi/Kconfig+2−20
@@ -32,7 +32,7 @@ menuconfig ACPI · 31 unmodified lines
32 Linux support for ACPI is based on Intel Corporation's ACPI32 Linux support for ACPI is based on Intel Corporation's ACPI
33 Component Architecture (ACPI CA). For more information on the33 Component Architecture (ACPI CA). For more information on the
34 ACPI CA, see:34 ACPI CA, see:
35 <http://acpica.org/>35 <https://acpica.org/>
36 36
37 ACPI is an open industry specification originally co-developed by37 ACPI is an open industry specification originally co-developed by
38 Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,38 Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,
@@ -40,8 +40,7 @@ menuconfig ACPI · 1 unmodified line
40 the UEFI Forum and any UEFI member can join the ASWG and contribute40 the UEFI Forum and any UEFI member can join the ASWG and contribute
41 to the ACPI specification.41 to the ACPI specification.
42 The specification is available at:42 The specification is available at:
43 <http://www.acpi.info>43 <https://uefi.org/specifications>
44 <http://www.uefi.org/acpi/specs>
45 44
46if ACPI45if ACPI
47 46
@@ -99,23 +98,6 @@ config ACPI_SLEEP · 51 unmodified lines
99 depends on ACPI_SYSTEM_POWER_STATES_SUPPORT98 depends on ACPI_SYSTEM_POWER_STATES_SUPPORT
100 default y99 default y
101 100
102config ACPI_PROCFS_POWER
103 bool "Deprecated power /proc/acpi directories"
104 depends on X86 && PROC_FS
105 help
106 For backwards compatibility, this option allows
107 deprecated power /proc/acpi/ directories to exist, even when
108 they have been replaced by functions in /sys.
109 The deprecated directories (and their replacements) include:
110 /proc/acpi/battery/* (/sys/class/power_supply/*) and
111 /proc/acpi/ac_adapter/* (sys/class/power_supply/*).
112 This option has no effect on /proc/acpi/ directories
113 and functions which do not yet exist in /sys.
114 This option, together with the proc directories, will be
115 deleted in the future.
116
117 Say N to delete power /proc/acpi/ directories that have moved to /sys.
118
119config ACPI_REV_OVERRIDE_POSSIBLE101config ACPI_REV_OVERRIDE_POSSIBLE
120 bool "Allow supported ACPI revision to be overridden"102 bool "Allow supported ACPI revision to be overridden"
121 depends on X86103 depends on X86
drivers/acpi/Makefile+0−1
@@ -55,7 +55,6 @@ acpi-$(CONFIG_X86) += acpi_cmos_rtc.o · 54 unmodified lines
55acpi-$(CONFIG_X86) += x86/apple.o55acpi-$(CONFIG_X86) += x86/apple.o
56acpi-$(CONFIG_X86) += x86/utils.o56acpi-$(CONFIG_X86) += x86/utils.o
57acpi-$(CONFIG_DEBUG_FS) += debugfs.o57acpi-$(CONFIG_DEBUG_FS) += debugfs.o
58acpi-$(CONFIG_ACPI_PROCFS_POWER) += cm_sbs.o
59acpi-y += acpi_lpat.o58acpi-y += acpi_lpat.o
60acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o59acpi-$(CONFIG_ACPI_LPIT) += acpi_lpit.o
61acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o60acpi-$(CONFIG_ACPI_GENERIC_GSI) += irq.o
drivers/acpi/ac.c+1−107
@@ -13,10 +13,6 @@ · 12 unmodified lines
13#include <linux/types.h>13#include <linux/types.h>
14#include <linux/dmi.h>14#include <linux/dmi.h>
15#include <linux/delay.h>15#include <linux/delay.h>
16#ifdef CONFIG_ACPI_PROCFS_POWER
17#include <linux/proc_fs.h>
18#include <linux/seq_file.h>
19#endif
20#include <linux/platform_device.h>16#include <linux/platform_device.h>
21#include <linux/power_supply.h>17#include <linux/power_supply.h>
22#include <linux/acpi.h>18#include <linux/acpi.h>
@@ -66,12 +62,6 @@ static int acpi_ac_resume(struct device *dev); · 43 unmodified lines
66#endif62#endif
67static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);63static SIMPLE_DEV_PM_OPS(acpi_ac_pm, NULL, acpi_ac_resume);
68 64
69#ifdef CONFIG_ACPI_PROCFS_POWER
70extern struct proc_dir_entry *acpi_lock_ac_dir(void);
71extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);
72#endif
73
74
75static int ac_sleep_before_get_state_ms;65static int ac_sleep_before_get_state_ms;
76static int ac_check_pmic = 1;66static int ac_check_pmic = 1;
77 67
@@ -150,77 +140,6 @@ static enum power_supply_property ac_props[] = { · 72 unmodified lines
150 POWER_SUPPLY_PROP_ONLINE,140 POWER_SUPPLY_PROP_ONLINE,
151};141};
152 142
153#ifdef CONFIG_ACPI_PROCFS_POWER
154/* --------------------------------------------------------------------------
155 FS Interface (/proc)
156 -------------------------------------------------------------------------- */
157
158static struct proc_dir_entry *acpi_ac_dir;
159
160static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
161{
162 struct acpi_ac *ac = seq->private;
163
164
165 if (!ac)
166 return 0;
167
168 if (acpi_ac_get_state(ac)) {
169 seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
170 return 0;
171 }
172
173 seq_puts(seq, "state: ");
174 switch (ac->state) {
175 case ACPI_AC_STATUS_OFFLINE:
176 seq_puts(seq, "off-line\n");
177 break;
178 case ACPI_AC_STATUS_ONLINE:
179 seq_puts(seq, "on-line\n");
180 break;
181 default:
182 seq_puts(seq, "unknown\n");
183 break;
184 }
185
186 return 0;
187}
188
189static int acpi_ac_add_fs(struct acpi_ac *ac)
190{
191 struct proc_dir_entry *entry = NULL;
192
193 printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"
194 " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
195 if (!acpi_device_dir(ac->device)) {
196 acpi_device_dir(ac->device) =
197 proc_mkdir(acpi_device_bid(ac->device), acpi_ac_dir);
198 if (!acpi_device_dir(ac->device))
199 return -ENODEV;
200 }
201
202 /* 'state' [R] */
203 entry = proc_create_single_data(ACPI_AC_FILE_STATE, S_IRUGO,
204 acpi_device_dir(ac->device), acpi_ac_seq_show, ac);
205 if (!entry)
206 return -ENODEV;
207 return 0;
208}
209
210static int acpi_ac_remove_fs(struct acpi_ac *ac)
211{
212
213 if (acpi_device_dir(ac->device)) {
214 remove_proc_entry(ACPI_AC_FILE_STATE,
215 acpi_device_dir(ac->device));
216 remove_proc_entry(acpi_device_bid(ac->device), acpi_ac_dir);
217 acpi_device_dir(ac->device) = NULL;
218 }
219
220 return 0;
221}
222#endif
223
224/* --------------------------------------------------------------------------143/* --------------------------------------------------------------------------
225 Driver Model144 Driver Model
226 -------------------------------------------------------------------------- */145 -------------------------------------------------------------------------- */
@@ -236,7 +155,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event) · 9 unmodified lines
236 default:155 default:
237 ACPI_DEBUG_PRINT((ACPI_DB_INFO,156 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
238 "Unsupported event [0x%x]\n", event));157 "Unsupported event [0x%x]\n", event));
239 /* fall through */158 fallthrough;
240 case ACPI_AC_NOTIFY_STATUS:159 case ACPI_AC_NOTIFY_STATUS:
241 case ACPI_NOTIFY_BUS_CHECK:160 case ACPI_NOTIFY_BUS_CHECK:
242 case ACPI_NOTIFY_DEVICE_CHECK:161 case ACPI_NOTIFY_DEVICE_CHECK:
@@ -348,11 +267,6 @@ static int acpi_ac_add(struct acpi_device *device) · 105 unmodified lines
348 psy_cfg.drv_data = ac;267 psy_cfg.drv_data = ac;
349 268
350 ac->charger_desc.name = acpi_device_bid(device);269 ac->charger_desc.name = acpi_device_bid(device);
351#ifdef CONFIG_ACPI_PROCFS_POWER
352 result = acpi_ac_add_fs(ac);
353 if (result)
354 goto end;
355#endif
356 ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;270 ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS;
357 ac->charger_desc.properties = ac_props;271 ac->charger_desc.properties = ac_props;
358 ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);272 ac->charger_desc.num_properties = ARRAY_SIZE(ac_props);
@@ -372,9 +286,6 @@ static int acpi_ac_add(struct acpi_device *device) · 13 unmodified lines
372 register_acpi_notifier(&ac->battery_nb);286 register_acpi_notifier(&ac->battery_nb);
373end:287end:
374 if (result) {288 if (result) {
375#ifdef CONFIG_ACPI_PROCFS_POWER
376 acpi_ac_remove_fs(ac);
377#endif
378 kfree(ac);289 kfree(ac);
379 }290 }
380 291
@@ -418,10 +329,6 @@ static int acpi_ac_remove(struct acpi_device *device) · 37 unmodified lines
418 power_supply_unregister(ac->charger);329 power_supply_unregister(ac->charger);
419 unregister_acpi_notifier(&ac->battery_nb);330 unregister_acpi_notifier(&ac->battery_nb);
420 331
421#ifdef CONFIG_ACPI_PROCFS_POWER
422 acpi_ac_remove_fs(ac);
423#endif
424
425 kfree(ac);332 kfree(ac);
426 333
427 return 0;334 return 0;
@@ -447,18 +354,8 @@ static int __init acpi_ac_init(void) · 19 unmodified lines
447 }354 }
448 }355 }
449 356
450#ifdef CONFIG_ACPI_PROCFS_POWER
451 acpi_ac_dir = acpi_lock_ac_dir();
452 if (!acpi_ac_dir)
453 return -ENODEV;
454#endif
455
456
457 result = acpi_bus_register_driver(&acpi_ac_driver);357 result = acpi_bus_register_driver(&acpi_ac_driver);
458 if (result < 0) {358 if (result < 0) {
459#ifdef CONFIG_ACPI_PROCFS_POWER
460 acpi_unlock_ac_dir(acpi_ac_dir);
461#endif
462 return -ENODEV;359 return -ENODEV;
463 }360 }
464 361
@@ -468,9 +365,6 @@ static int __init acpi_ac_init(void) · 3 unmodified lines
468static void __exit acpi_ac_exit(void)365static void __exit acpi_ac_exit(void)
469{366{
470 acpi_bus_unregister_driver(&acpi_ac_driver);367 acpi_bus_unregister_driver(&acpi_ac_driver);
471#ifdef CONFIG_ACPI_PROCFS_POWER
472 acpi_unlock_ac_dir(acpi_ac_dir);
473#endif
474}368}
475module_init(acpi_ac_init);369module_init(acpi_ac_init);
476module_exit(acpi_ac_exit);370module_exit(acpi_ac_exit);
drivers/acpi/acpi_pad.c+1−1
@@ -88,7 +88,7 @@ static void round_robin_cpu(unsigned int tsk_index) · 87 unmodified lines
88 cpumask_var_t tmp;88 cpumask_var_t tmp;
89 int cpu;89 int cpu;
90 unsigned long min_weight = -1;90 unsigned long min_weight = -1;
91 unsigned long uninitialized_var(preferred_cpu);91 unsigned long preferred_cpu;
92 92
93 if (!alloc_cpumask_var(&tmp, GFP_KERNEL))93 if (!alloc_cpumask_var(&tmp, GFP_KERNEL))
94 return;94 return;
drivers/acpi/acpi_processor.c+1−1
@@ -79,7 +79,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) · 78 unmodified lines
79 * PIIX4 models.79 * PIIX4 models.
80 */80 */
81 errata.piix4.throttle = 1;81 errata.piix4.throttle = 1;
82 /* fall through*/82 fallthrough;
83 83
84 case 2: /* PIIX4E */84 case 2: /* PIIX4E */
85 case 3: /* PIIX4M */85 case 3: /* PIIX4M */
drivers/acpi/acpica/evrgnini.c+8−6
@@ -38,6 +38,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, · 37 unmodified lines
38 union acpi_operand_object *region_desc =38 union acpi_operand_object *region_desc =
39 (union acpi_operand_object *)handle;39 (union acpi_operand_object *)handle;
40 struct acpi_mem_space_context *local_region_context;40 struct acpi_mem_space_context *local_region_context;
41 struct acpi_mem_mapping *mm;
41 42
42 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);43 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);
43 44
@@ -46,13 +47,14 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, · 2 unmodified lines
46 local_region_context =47 local_region_context =
47 (struct acpi_mem_space_context *)*region_context;48 (struct acpi_mem_space_context *)*region_context;
48 49
49 /* Delete a cached mapping if present */50 /* Delete memory mappings if present */
50 51
51 if (local_region_context->mapped_length) {52 while (local_region_context->first_mm) {
52 acpi_os_unmap_memory(local_region_context->53 mm = local_region_context->first_mm;
53 mapped_logical_address,54 local_region_context->first_mm = mm->next_mm;
54 local_region_context->55 acpi_os_unmap_memory(mm->logical_address,
55 mapped_length);56 mm->length);
57 ACPI_FREE(mm);
56 }58 }
57 ACPI_FREE(local_region_context);59 ACPI_FREE(local_region_context);
58 *region_context = NULL;60 *region_context = NULL;
drivers/acpi/acpica/exprep.c+0−4
@@ -473,10 +473,6 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info) · 472 unmodified lines
473 (u8)access_byte_width;473 (u8)access_byte_width;
474 }474 }
475 }475 }
476 /* An additional reference for the container */
477
478 acpi_ut_add_reference(obj_desc->field.region_obj);
479
480 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,476 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
481 "RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",477 "RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
482 obj_desc->field.start_field_bit_offset,478 obj_desc->field.start_field_bit_offset,
drivers/acpi/acpica/exregion.c+46−18
@@ -41,6 +41,7 @@ acpi_ex_system_memory_space_handler(u32 function, · 40 unmodified lines
41 acpi_status status = AE_OK;41 acpi_status status = AE_OK;
42 void *logical_addr_ptr = NULL;42 void *logical_addr_ptr = NULL;
43 struct acpi_mem_space_context *mem_info = region_context;43 struct acpi_mem_space_context *mem_info = region_context;
44 struct acpi_mem_mapping *mm = mem_info->cur_mm;
44 u32 length;45 u32 length;
45 acpi_size map_length;46 acpi_size map_length;
46 acpi_size page_boundary_map_length;47 acpi_size page_boundary_map_length;
@@ -96,20 +97,37 @@ acpi_ex_system_memory_space_handler(u32 function, · 49 unmodified lines
96 * Is 1) Address below the current mapping? OR97 * Is 1) Address below the current mapping? OR
97 * 2) Address beyond the current mapping?98 * 2) Address beyond the current mapping?
98 */99 */
99 if ((address < mem_info->mapped_physical_address) ||100 if (!mm || (address < mm->physical_address) ||
100 (((u64) address + length) > ((u64)101 ((u64) address + length > (u64) mm->physical_address + mm->length)) {
101 mem_info->mapped_physical_address +
102 mem_info->mapped_length))) {
103 /*102 /*
104 * The request cannot be resolved by the current memory mapping;103 * The request cannot be resolved by the current memory mapping.
105 * Delete the existing mapping and create a new one.104 *
105 * Look for an existing saved mapping covering the address range
106 * at hand. If found, save it as the current one and carry out
107 * the access.
106 */108 */
107 if (mem_info->mapped_length) {109 for (mm = mem_info->first_mm; mm; mm = mm->next_mm) {
110 if (mm == mem_info->cur_mm)
111 continue;
112
113 if (address < mm->physical_address)
114 continue;
108 115
109 /* Valid mapping, delete it */116 if ((u64) address + length >
117 (u64) mm->physical_address + mm->length)
118 continue;
110 119
111 acpi_os_unmap_memory(mem_info->mapped_logical_address,120 mem_info->cur_mm = mm;
112 mem_info->mapped_length);121 goto access;
122 }
123
124 /* Create a new mappings list entry */
125 mm = ACPI_ALLOCATE_ZEROED(sizeof(*mm));
126 if (!mm) {
127 ACPI_ERROR((AE_INFO,
128 "Unable to save memory mapping at 0x%8.8X%8.8X, size %u",
129 ACPI_FORMAT_UINT64(address), length));
130 return_ACPI_STATUS(AE_NO_MEMORY);
113 }131 }
114 132
115 /*133 /*
@@ -143,29 +161,39 @@ acpi_ex_system_memory_space_handler(u32 function, · 27 unmodified lines
143 161
144 /* Create a new mapping starting at the address given */162 /* Create a new mapping starting at the address given */
145 163
146 mem_info->mapped_logical_address =164 logical_addr_ptr = acpi_os_map_memory(address, map_length);
147 acpi_os_map_memory(address, map_length);165 if (!logical_addr_ptr) {
148 if (!mem_info->mapped_logical_address) {
149 ACPI_ERROR((AE_INFO,166 ACPI_ERROR((AE_INFO,
150 "Could not map memory at 0x%8.8X%8.8X, size %u",167 "Could not map memory at 0x%8.8X%8.8X, size %u",
151 ACPI_FORMAT_UINT64(address),168 ACPI_FORMAT_UINT64(address),
152 (u32)map_length));169 (u32)map_length));
153 mem_info->mapped_length = 0;170 ACPI_FREE(mm);
154 return_ACPI_STATUS(AE_NO_MEMORY);171 return_ACPI_STATUS(AE_NO_MEMORY);
155 }172 }
156 173
157 /* Save the physical address and mapping size */174 /* Save the physical address and mapping size */
158 175
159 mem_info->mapped_physical_address = address;176 mm->logical_address = logical_addr_ptr;
160 mem_info->mapped_length = map_length;177 mm->physical_address = address;
178 mm->length = map_length;
179
180 /*
181 * Add the new entry to the mappigs list and save it as the
182 * current mapping.
183 */
184 mm->next_mm = mem_info->first_mm;
185 mem_info->first_mm = mm;
186
187 mem_info->cur_mm = mm;
161 }188 }
162 189
190access:
163 /*191 /*
164 * Generate a logical pointer corresponding to the address we want to192 * Generate a logical pointer corresponding to the address we want to
165 * access193 * access
166 */194 */
167 logical_addr_ptr = mem_info->mapped_logical_address +195 logical_addr_ptr = mm->logical_address +
168 ((u64) address - (u64) mem_info->mapped_physical_address);196 ((u64) address - (u64) mm->physical_address);
169 197
170 ACPI_DEBUG_PRINT((ACPI_DB_INFO,198 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
171 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",199 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
drivers/acpi/acpica/utdelete.c+1−5
@@ -568,11 +568,6 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) · 567 unmodified lines
568 next_object = object->buffer_field.buffer_obj;568 next_object = object->buffer_field.buffer_obj;
569 break;569 break;
570 570
571 case ACPI_TYPE_LOCAL_REGION_FIELD:
572
573 next_object = object->field.region_obj;
574 break;
575
576 case ACPI_TYPE_LOCAL_BANK_FIELD:571 case ACPI_TYPE_LOCAL_BANK_FIELD:
577 572
578 next_object = object->bank_field.bank_obj;573 next_object = object->bank_field.bank_obj;
@@ -613,6 +608,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action) · 34 unmodified lines
613 }608 }
614 break;609 break;
615 610
611 case ACPI_TYPE_LOCAL_REGION_FIELD:
616 case ACPI_TYPE_REGION:612 case ACPI_TYPE_REGION:
617 default:613 default:
618 614
drivers/acpi/acpica/utids.c+1−2
@@ -263,8 +263,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node *device_node, · 262 unmodified lines
263 * 3) Size of the actual CID strings263 * 3) Size of the actual CID strings
264 */264 */
265 cid_list_size = sizeof(struct acpi_pnp_device_id_list) +265 cid_list_size = sizeof(struct acpi_pnp_device_id_list) +
266 ((count - 1) * sizeof(struct acpi_pnp_device_id)) +266 (count * sizeof(struct acpi_pnp_device_id)) + string_area_size;
267 string_area_size;
268 267
269 cid_list = ACPI_ALLOCATE_ZEROED(cid_list_size);268 cid_list = ACPI_ALLOCATE_ZEROED(cid_list_size);
270 if (!cid_list) {269 if (!cid_list) {
drivers/acpi/apei/hest.c+1−1
@@ -227,7 +227,7 @@ __setup("hest_disable", setup_hest_disable); · 226 unmodified lines
227void __init acpi_hest_init(void)227void __init acpi_hest_init(void)
228{228{
229 acpi_status status;229 acpi_status status;
230 int rc = -ENODEV;230 int rc;
231 unsigned int ghes_count = 0;231 unsigned int ghes_count = 0;
232 232
233 if (hest_disable) {233 if (hest_disable) {
drivers/acpi/battery.c+0−255
@@ -24,12 +24,6 @@ · 23 unmodified lines
24 24
25#include <asm/unaligned.h>25#include <asm/unaligned.h>
26 26
27#ifdef CONFIG_ACPI_PROCFS_POWER
28#include <linux/proc_fs.h>
29#include <linux/seq_file.h>
30#include <linux/uaccess.h>
31#endif
32
33#include <linux/acpi.h>27#include <linux/acpi.h>
34#include <linux/power_supply.h>28#include <linux/power_supply.h>
35 29
@@ -69,11 +63,6 @@ static unsigned int cache_time = 1000; · 33 unmodified lines
69module_param(cache_time, uint, 0644);63module_param(cache_time, uint, 0644);
70MODULE_PARM_DESC(cache_time, "cache time in milliseconds");64MODULE_PARM_DESC(cache_time, "cache time in milliseconds");
71 65
72#ifdef CONFIG_ACPI_PROCFS_POWER
73extern struct proc_dir_entry *acpi_lock_battery_dir(void);
74extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir);
75#endif
76
77static const struct acpi_device_id battery_device_ids[] = {66static const struct acpi_device_id battery_device_ids[] = {
78 {"PNP0C0A", 0},67 {"PNP0C0A", 0},
79 {"", 0},68 {"", 0},
@@ -1023,226 +1012,6 @@ static void acpi_battery_refresh(struct acpi_battery *battery) · 943 unmodified lines
1023 sysfs_add_battery(battery);1012 sysfs_add_battery(battery);
1024}1013}
1025 1014
1026/* --------------------------------------------------------------------------
1027 FS Interface (/proc)
1028 -------------------------------------------------------------------------- */
1029
1030#ifdef CONFIG_ACPI_PROCFS_POWER
1031static struct proc_dir_entry *acpi_battery_dir;
1032
1033static const char *acpi_battery_units(const struct acpi_battery *battery)
1034{
1035 return (battery->power_unit == ACPI_BATTERY_POWER_UNIT_MA) ?
1036 "mA" : "mW";
1037}
1038
1039static int acpi_battery_info_proc_show(struct seq_file *seq, void *offset)
1040{
1041 struct acpi_battery *battery = seq->private;
1042 int result = acpi_battery_update(battery, false);
1043
1044 if (result)
1045 goto end;
1046
1047 seq_printf(seq, "present: %s\n",
1048 acpi_battery_present(battery) ? "yes" : "no");
1049 if (!acpi_battery_present(battery))
1050 goto end;
1051 if (battery->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
1052 seq_printf(seq, "design capacity: unknown\n");
1053 else
1054 seq_printf(seq, "design capacity: %d %sh\n",
1055 battery->design_capacity,
1056 acpi_battery_units(battery));
1057
1058 if (battery->full_charge_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
1059 seq_printf(seq, "last full capacity: unknown\n");
1060 else
1061 seq_printf(seq, "last full capacity: %d %sh\n",
1062 battery->full_charge_capacity,
1063 acpi_battery_units(battery));
1064
1065 seq_printf(seq, "battery technology: %srechargeable\n",
1066 battery->technology ? "" : "non-");
1067
1068 if (battery->design_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
1069 seq_printf(seq, "design voltage: unknown\n");
1070 else
1071 seq_printf(seq, "design voltage: %d mV\n",
1072 battery->design_voltage);
1073 seq_printf(seq, "design capacity warning: %d %sh\n",
1074 battery->design_capacity_warning,
1075 acpi_battery_units(battery));
1076 seq_printf(seq, "design capacity low: %d %sh\n",
1077 battery->design_capacity_low,
1078 acpi_battery_units(battery));
1079 seq_printf(seq, "cycle count: %i\n", battery->cycle_count);
1080 seq_printf(seq, "capacity granularity 1: %d %sh\n",
1081 battery->capacity_granularity_1,
1082 acpi_battery_units(battery));
1083 seq_printf(seq, "capacity granularity 2: %d %sh\n",
1084 battery->capacity_granularity_2,
1085 acpi_battery_units(battery));
1086 seq_printf(seq, "model number: %s\n", battery->model_number);
1087 seq_printf(seq, "serial number: %s\n", battery->serial_number);
1088 seq_printf(seq, "battery type: %s\n", battery->type);
1089 seq_printf(seq, "OEM info: %s\n", battery->oem_info);
1090 end:
1091 if (result)
1092 seq_printf(seq, "ERROR: Unable to read battery info\n");
1093 return result;
1094}
1095
1096static int acpi_battery_state_proc_show(struct seq_file *seq, void *offset)
1097{
1098 struct acpi_battery *battery = seq->private;
1099 int result = acpi_battery_update(battery, false);
1100
1101 if (result)
1102 goto end;
1103
1104 seq_printf(seq, "present: %s\n",
1105 acpi_battery_present(battery) ? "yes" : "no");
1106 if (!acpi_battery_present(battery))
1107 goto end;
1108
1109 seq_printf(seq, "capacity state: %s\n",
1110 (battery->state & 0x04) ? "critical" : "ok");
1111 if ((battery->state & 0x01) && (battery->state & 0x02))
1112 seq_printf(seq,
1113 "charging state: charging/discharging\n");
1114 else if (battery->state & 0x01)
1115 seq_printf(seq, "charging state: discharging\n");
1116 else if (battery->state & 0x02)
1117 seq_printf(seq, "charging state: charging\n");
1118 else
1119 seq_printf(seq, "charging state: charged\n");
1120
1121 if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
1122 seq_printf(seq, "present rate: unknown\n");
1123 else
1124 seq_printf(seq, "present rate: %d %s\n",
1125 battery->rate_now, acpi_battery_units(battery));
1126
1127 if (battery->capacity_now == ACPI_BATTERY_VALUE_UNKNOWN)
1128 seq_printf(seq, "remaining capacity: unknown\n");
1129 else
1130 seq_printf(seq, "remaining capacity: %d %sh\n",
1131 battery->capacity_now, acpi_battery_units(battery));
1132 if (battery->voltage_now == ACPI_BATTERY_VALUE_UNKNOWN)
1133 seq_printf(seq, "present voltage: unknown\n");
1134 else
1135 seq_printf(seq, "present voltage: %d mV\n",
1136 battery->voltage_now);
1137 end:
1138 if (result)
1139 seq_printf(seq, "ERROR: Unable to read battery state\n");
1140
1141 return result;
1142}
1143
1144static int acpi_battery_alarm_proc_show(struct seq_file *seq, void *offset)
1145{
1146 struct acpi_battery *battery = seq->private;
1147 int result = acpi_battery_update(battery, false);
1148
1149 if (result)
1150 goto end;
1151
1152 if (!acpi_battery_present(battery)) {
1153 seq_printf(seq, "present: no\n");
1154 goto end;
1155 }
1156 seq_printf(seq, "alarm: ");
1157 if (battery->alarm) {
1158 seq_printf(seq, "%u %sh\n", battery->alarm,
1159 acpi_battery_units(battery));
1160 } else {
1161 seq_printf(seq, "unsupported\n");
1162 }
1163 end:
1164 if (result)
1165 seq_printf(seq, "ERROR: Unable to read battery alarm\n");
1166 return result;
1167}
1168
1169static ssize_t acpi_battery_write_alarm(struct file *file,
1170 const char __user * buffer,
1171 size_t count, loff_t * ppos)
1172{
1173 int result = 0;
1174 char alarm_string[12] = { '\0' };
1175 struct seq_file *m = file->private_data;
1176 struct acpi_battery *battery = m->private;
1177
1178 if (!battery || (count > sizeof(alarm_string) - 1))
1179 return -EINVAL;
1180 if (!acpi_battery_present(battery)) {
1181 result = -ENODEV;
1182 goto end;
1183 }
1184 if (copy_from_user(alarm_string, buffer, count)) {
1185 result = -EFAULT;
1186 goto end;
1187 }
1188 alarm_string[count] = '\0';
1189 if (kstrtoint(alarm_string, 0, &battery->alarm)) {
1190 result = -EINVAL;
1191 goto end;
1192 }
1193 result = acpi_battery_set_alarm(battery);
1194 end:
1195 if (result)
1196 return result;
1197 return count;
1198}
1199
1200static int acpi_battery_alarm_proc_open(struct inode *inode, struct file *file)
1201{
1202 return single_open(file, acpi_battery_alarm_proc_show, PDE_DATA(inode));
1203}
1204
1205static const struct proc_ops acpi_battery_alarm_proc_ops = {
1206 .proc_open = acpi_battery_alarm_proc_open,
1207 .proc_read = seq_read,
1208 .proc_write = acpi_battery_write_alarm,
1209 .proc_lseek = seq_lseek,
1210 .proc_release = single_release,
1211};
1212
1213static int acpi_battery_add_fs(struct acpi_device *device)
1214{
1215 pr_warn(PREFIX "Deprecated procfs I/F for battery is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared\n");
1216 if (!acpi_device_dir(device)) {
1217 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
1218 acpi_battery_dir);
1219 if (!acpi_device_dir(device))
1220 return -ENODEV;
1221 }
1222
1223 if (!proc_create_single_data("info", S_IRUGO, acpi_device_dir(device),
1224 acpi_battery_info_proc_show, acpi_driver_data(device)))
1225 return -ENODEV;
1226 if (!proc_create_single_data("state", S_IRUGO, acpi_device_dir(device),
1227 acpi_battery_state_proc_show, acpi_driver_data(device)))
1228 return -ENODEV;
1229 if (!proc_create_data("alarm", S_IFREG | S_IRUGO | S_IWUSR,
1230 acpi_device_dir(device), &acpi_battery_alarm_proc_ops,
1231 acpi_driver_data(device)))
1232 return -ENODEV;
1233 return 0;
1234}
1235
1236static void acpi_battery_remove_fs(struct acpi_device *device)
1237{
1238 if (!acpi_device_dir(device))
1239 return;
1240 remove_proc_subtree(acpi_device_bid(device), acpi_battery_dir);
1241 acpi_device_dir(device) = NULL;
1242}
1243
1244#endif
1245
1246/* --------------------------------------------------------------------------1015/* --------------------------------------------------------------------------
1247 Driver Interface1016 Driver Interface
1248 -------------------------------------------------------------------------- */1017 -------------------------------------------------------------------------- */
@@ -1432,14 +1201,6 @@ static int acpi_battery_add(struct acpi_device *device) · 183 unmodified lines
1432 if (result)1201 if (result)
1433 goto fail;1202 goto fail;
1434 1203
1435#ifdef CONFIG_ACPI_PROCFS_POWER
1436 result = acpi_battery_add_fs(device);
1437 if (result) {
1438 acpi_battery_remove_fs(device);
1439 goto fail;
1440 }
1441#endif
1442
1443 pr_info(PREFIX "%s Slot [%s] (battery %s)\n",1204 pr_info(PREFIX "%s Slot [%s] (battery %s)\n",
1444 ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),1205 ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
1445 device->status.battery_present ? "present" : "absent");1206 device->status.battery_present ? "present" : "absent");
@@ -1468,9 +1229,6 @@ static int acpi_battery_remove(struct acpi_device *device) · 22 unmodified lines
1468 device_init_wakeup(&device->dev, 0);1229 device_init_wakeup(&device->dev, 0);
1469 battery = acpi_driver_data(device);1230 battery = acpi_driver_data(device);
1470 unregister_pm_notifier(&battery->pm_nb);1231 unregister_pm_notifier(&battery->pm_nb);
1471#ifdef CONFIG_ACPI_PROCFS_POWER
1472 acpi_battery_remove_fs(device);
1473#endif
1474 sysfs_remove_battery(battery);1232 sysfs_remove_battery(battery);
1475 mutex_destroy(&battery->lock);1233 mutex_destroy(&battery->lock);
1476 mutex_destroy(&battery->sysfs_lock);1234 mutex_destroy(&battery->sysfs_lock);
@@ -1531,16 +1289,7 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie) · 54 unmodified lines
1531 }1289 }
1532 }1290 }
1533 1291
1534#ifdef CONFIG_ACPI_PROCFS_POWER
1535 acpi_battery_dir = acpi_lock_battery_dir();
1536 if (!acpi_battery_dir)
1537 return;
1538#endif
1539 result = acpi_bus_register_driver(&acpi_battery_driver);1292 result = acpi_bus_register_driver(&acpi_battery_driver);
1540#ifdef CONFIG_ACPI_PROCFS_POWER
1541 if (result < 0)
1542 acpi_unlock_battery_dir(acpi_battery_dir);
1543#endif
1544 battery_driver_registered = (result == 0);1293 battery_driver_registered = (result == 0);
1545}1294}
1546 1295
@@ -1560,10 +1309,6 @@ static void __exit acpi_battery_exit(void) · 13 unmodified lines
1560 acpi_bus_unregister_driver(&acpi_battery_driver);1309 acpi_bus_unregister_driver(&acpi_battery_driver);
1561 battery_hook_exit();1310 battery_hook_exit();
1562 }1311 }
1563#ifdef CONFIG_ACPI_PROCFS_POWER
1564 if (acpi_battery_dir)
1565 acpi_unlock_battery_dir(acpi_battery_dir);
1566#endif
1567}1312}
1568 1313
1569module_init(acpi_battery_init);1314module_init(acpi_battery_init);
drivers/acpi/button.c+1−1
@@ -405,7 +405,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) · 404 unmodified lines
405 switch (event) {405 switch (event) {
406 case ACPI_FIXED_HARDWARE_EVENT:406 case ACPI_FIXED_HARDWARE_EVENT:
407 event = ACPI_BUTTON_NOTIFY_STATUS;407 event = ACPI_BUTTON_NOTIFY_STATUS;
408 /* fall through */408 fallthrough;
409 case ACPI_BUTTON_NOTIFY_STATUS:409 case ACPI_BUTTON_NOTIFY_STATUS:
410 input = button->input;410 input = button->input;
411 if (button->type == ACPI_BUTTON_TYPE_LID) {411 if (button->type == ACPI_BUTTON_TYPE_LID) {
drivers/acpi/cm_sbs.c+0−87
@@ -1,87 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#include <linux/kernel.h>
4#include <linux/module.h>
5#include <linux/init.h>
6#include <linux/acpi.h>
7#include <linux/types.h>
8#include <linux/proc_fs.h>
9#include <linux/seq_file.h>
10#include <acpi/acpi_bus.h>
11#include <acpi/acpi_drivers.h>
12
13#define PREFIX "ACPI: "
14
15ACPI_MODULE_NAME("cm_sbs");
16#define ACPI_AC_CLASS "ac_adapter"
17#define ACPI_BATTERY_CLASS "battery"
18#define _COMPONENT ACPI_SBS_COMPONENT
19static struct proc_dir_entry *acpi_ac_dir;
20static struct proc_dir_entry *acpi_battery_dir;
21
22static DEFINE_MUTEX(cm_sbs_mutex);
23
24static int lock_ac_dir_cnt;
25static int lock_battery_dir_cnt;
26
27struct proc_dir_entry *acpi_lock_ac_dir(void)
28{
29 mutex_lock(&cm_sbs_mutex);
30 if (!acpi_ac_dir)
31 acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
32 if (acpi_ac_dir) {
33 lock_ac_dir_cnt++;
34 } else {
35 printk(KERN_ERR PREFIX
36 "Cannot create %s\n", ACPI_AC_CLASS);
37 }
38 mutex_unlock(&cm_sbs_mutex);
39 return acpi_ac_dir;
40}
41EXPORT_SYMBOL(acpi_lock_ac_dir);
42
43void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
44{
45 mutex_lock(&cm_sbs_mutex);
46 if (acpi_ac_dir_param)
47 lock_ac_dir_cnt--;
48 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
49 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
50 acpi_ac_dir = NULL;
51 }
52 mutex_unlock(&cm_sbs_mutex);
53}
54EXPORT_SYMBOL(acpi_unlock_ac_dir);
55
56struct proc_dir_entry *acpi_lock_battery_dir(void)
57{
58 mutex_lock(&cm_sbs_mutex);
59 if (!acpi_battery_dir) {
60 acpi_battery_dir =
61 proc_mkdir(ACPI_BATTERY_CLASS, acpi_root_dir);
62 }
63 if (acpi_battery_dir) {
64 lock_battery_dir_cnt++;
65 } else {
66 printk(KERN_ERR PREFIX
67 "Cannot create %s\n", ACPI_BATTERY_CLASS);
68 }
69 mutex_unlock(&cm_sbs_mutex);
70 return acpi_battery_dir;
71}
72EXPORT_SYMBOL(acpi_lock_battery_dir);
73
74void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
75{
76 mutex_lock(&cm_sbs_mutex);
77 if (acpi_battery_dir_param)
78 lock_battery_dir_cnt--;
79 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
80 && acpi_battery_dir) {
81 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
82 acpi_battery_dir = NULL;
83 }
84 mutex_unlock(&cm_sbs_mutex);
85 return;
86}
87EXPORT_SYMBOL(acpi_unlock_battery_dir);
drivers/acpi/dock.c+1−1
@@ -469,7 +469,7 @@ int dock_notify(struct acpi_device *adev, u32 event) · 468 unmodified lines
469 surprise_removal = 1;469 surprise_removal = 1;
470 event = ACPI_NOTIFY_EJECT_REQUEST;470 event = ACPI_NOTIFY_EJECT_REQUEST;
471 /* Fall back */471 /* Fall back */
472 /* fall through */472 fallthrough;
473 case ACPI_NOTIFY_EJECT_REQUEST:473 case ACPI_NOTIFY_EJECT_REQUEST:
474 begin_undock(ds);474 begin_undock(ds);
475 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))475 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))
drivers/acpi/ec.c+4−4
@@ -2059,13 +2059,13 @@ static int param_get_event_clearing(char *buffer, · 2058 unmodified lines
2059{2059{
2060 switch (ec_event_clearing) {2060 switch (ec_event_clearing) {
2061 case ACPI_EC_EVT_TIMING_STATUS:2061 case ACPI_EC_EVT_TIMING_STATUS:
2062 return sprintf(buffer, "status");2062 return sprintf(buffer, "status\n");
2063 case ACPI_EC_EVT_TIMING_QUERY:2063 case ACPI_EC_EVT_TIMING_QUERY:
2064 return sprintf(buffer, "query");2064 return sprintf(buffer, "query\n");
2065 case ACPI_EC_EVT_TIMING_EVENT:2065 case ACPI_EC_EVT_TIMING_EVENT:
2066 return sprintf(buffer, "event");2066 return sprintf(buffer, "event\n");
2067 default:2067 default:
2068 return sprintf(buffer, "invalid");2068 return sprintf(buffer, "invalid\n");
2069 }2069 }
2070 return 0;2070 return 0;
2071}2071}
drivers/acpi/evged.c+1−1
@@ -106,7 +106,7 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares, · 105 unmodified lines
106 106
107 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))107 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
108 break;108 break;
109 /* fall through */109 fallthrough;
110 default:110 default:
111 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))111 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
112 break;112 break;
drivers/acpi/nfit/nfit.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
16/* ACPI 6.1 */16/* ACPI 6.1 */
17#define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"17#define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"
18 18
19/* http://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */19/* https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
20#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"20#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"
21 21
22/* https://github.com/HewlettPackard/hpe-nvm/blob/master/Documentation/ */22/* https://github.com/HewlettPackard/hpe-nvm/blob/master/Documentation/ */
drivers/acpi/numa/srat.c+1−9
@@ -230,7 +230,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) · 229 unmodified lines
230 pxm &= 0xff;230 pxm &= 0xff;
231 231
232 node = acpi_map_pxm_to_node(pxm);232 node = acpi_map_pxm_to_node(pxm);
233 if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {233 if (node == NUMA_NO_NODE) {
234 pr_err("SRAT: Too many proximity domains.\n");234 pr_err("SRAT: Too many proximity domains.\n");
235 goto out_err_bad_srat;235 goto out_err_bad_srat;
236 }236 }
@@ -291,8 +291,6 @@ acpi_parse_x2apic_affinity(union acpi_subtable_headers *header, · 54 unmodified lines
291 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;291 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
292 292
293 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;293 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
294 if (!processor_affinity)
295 return -EINVAL;
296 294
297 acpi_table_print_srat_entry(&header->common);295 acpi_table_print_srat_entry(&header->common);
298 296
@@ -309,8 +307,6 @@ acpi_parse_processor_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
309 struct acpi_srat_cpu_affinity *processor_affinity;307 struct acpi_srat_cpu_affinity *processor_affinity;
310 308
311 processor_affinity = (struct acpi_srat_cpu_affinity *)header;309 processor_affinity = (struct acpi_srat_cpu_affinity *)header;
312 if (!processor_affinity)
313 return -EINVAL;
314 310
315 acpi_table_print_srat_entry(&header->common);311 acpi_table_print_srat_entry(&header->common);
316 312
@@ -327,8 +323,6 @@ acpi_parse_gicc_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
327 struct acpi_srat_gicc_affinity *processor_affinity;323 struct acpi_srat_gicc_affinity *processor_affinity;
328 324
329 processor_affinity = (struct acpi_srat_gicc_affinity *)header;325 processor_affinity = (struct acpi_srat_gicc_affinity *)header;
330 if (!processor_affinity)
331 return -EINVAL;
332 326
333 acpi_table_print_srat_entry(&header->common);327 acpi_table_print_srat_entry(&header->common);
334 328
@@ -347,8 +341,6 @@ acpi_parse_memory_affinity(union acpi_subtable_headers * header, · 12 unmodified lines
347 struct acpi_srat_mem_affinity *memory_affinity;341 struct acpi_srat_mem_affinity *memory_affinity;
348 342
349 memory_affinity = (struct acpi_srat_mem_affinity *)header;343 memory_affinity = (struct acpi_srat_mem_affinity *)header;
350 if (!memory_affinity)
351 return -EINVAL;
352 344
353 acpi_table_print_srat_entry(&header->common);345 acpi_table_print_srat_entry(&header->common);
354 346
drivers/acpi/osl.c+36−27
@@ -77,7 +77,10 @@ struct acpi_ioremap { · 76 unmodified lines
77 void __iomem *virt;77 void __iomem *virt;
78 acpi_physical_address phys;78 acpi_physical_address phys;
79 acpi_size size;79 acpi_size size;
80 unsigned long refcount;80 union {
81 unsigned long refcount;
82 struct rcu_work rwork;
83 } track;
81};84};
82 85
83static LIST_HEAD(acpi_ioremaps);86static LIST_HEAD(acpi_ioremaps);
@@ -250,7 +253,7 @@ void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size) · 166 unmodified lines
250 map = acpi_map_lookup(phys, size);253 map = acpi_map_lookup(phys, size);
251 if (map) {254 if (map) {
252 virt = map->virt + (phys - map->phys);255 virt = map->virt + (phys - map->phys);
253 map->refcount++;256 map->track.refcount++;
254 }257 }
255 mutex_unlock(&acpi_ioremap_lock);258 mutex_unlock(&acpi_ioremap_lock);
256 return virt;259 return virt;
@@ -335,7 +338,7 @@ void __iomem __ref · 78 unmodified lines
335 /* Check if there's a suitable mapping already. */338 /* Check if there's a suitable mapping already. */
336 map = acpi_map_lookup(phys, size);339 map = acpi_map_lookup(phys, size);
337 if (map) {340 if (map) {
338 map->refcount++;341 map->track.refcount++;
339 goto out;342 goto out;
340 }343 }
341 344
@@ -358,7 +361,7 @@ void __iomem __ref · 16 unmodified lines
358 map->virt = virt;361 map->virt = virt;
359 map->phys = pg_off;362 map->phys = pg_off;
360 map->size = pg_sz;363 map->size = pg_sz;
361 map->refcount = 1;364 map->track.refcount = 1;
362 365
363 list_add_tail_rcu(&map->list, &acpi_ioremaps);366 list_add_tail_rcu(&map->list, &acpi_ioremaps);
364 367
@@ -374,21 +377,26 @@ void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) · 9 unmodified lines
374}377}
375EXPORT_SYMBOL_GPL(acpi_os_map_memory);378EXPORT_SYMBOL_GPL(acpi_os_map_memory);
376 379
377/* Must be called with mutex_lock(&acpi_ioremap_lock) */380static void acpi_os_map_remove(struct work_struct *work)
378static unsigned long acpi_os_drop_map_ref(struct acpi_ioremap *map)
379{381{
380 unsigned long refcount = --map->refcount;382 struct acpi_ioremap *map = container_of(to_rcu_work(work),
383 struct acpi_ioremap,
384 track.rwork);
381 385
382 if (!refcount)386 acpi_unmap(map->phys, map->virt);
383 list_del_rcu(&map->list);387 kfree(map);
384 return refcount;
385}388}
386 389
387static void acpi_os_map_cleanup(struct acpi_ioremap *map)390/* Must be called with mutex_lock(&acpi_ioremap_lock) */
391static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
388{392{
389 synchronize_rcu_expedited();393 if (--map->track.refcount)
390 acpi_unmap(map->phys, map->virt);394 return;
391 kfree(map);395
396 list_del_rcu(&map->list);
397
398 INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove);
399 queue_rcu_work(system_wq, &map->track.rwork);
392}400}
393 401
394/**402/**
@@ -397,8 +405,8 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) · 2 unmodified lines
397 * @size: Size of the address range to drop a reference to.405 * @size: Size of the address range to drop a reference to.
398 *406 *
399 * Look up the given virtual address range in the list of existing ACPI memory407 * Look up the given virtual address range in the list of existing ACPI memory
400 * mappings, drop a reference to it and unmap it if there are no more active408 * mappings, drop a reference to it and if there are no more active references
401 * references to it.409 * to it, queue it up for later removal.
402 *410 *
403 * During early init (when acpi_permanent_mmap has not been set yet) this411 * During early init (when acpi_permanent_mmap has not been set yet) this
404 * routine simply calls __acpi_unmap_table() to get the job done. Since412 * routine simply calls __acpi_unmap_table() to get the job done. Since
@@ -408,7 +416,6 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) · 3 unmodified lines
408void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)416void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
409{417{
410 struct acpi_ioremap *map;418 struct acpi_ioremap *map;
411 unsigned long refcount;
412 419
413 if (!acpi_permanent_mmap) {420 if (!acpi_permanent_mmap) {
414 __acpi_unmap_table(virt, size);421 __acpi_unmap_table(virt, size);
@@ -416,23 +423,27 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) · 1 unmodified line
416 }423 }
417 424
418 mutex_lock(&acpi_ioremap_lock);425 mutex_lock(&acpi_ioremap_lock);
426
419 map = acpi_map_lookup_virt(virt, size);427 map = acpi_map_lookup_virt(virt, size);
420 if (!map) {428 if (!map) {
421 mutex_unlock(&acpi_ioremap_lock);429 mutex_unlock(&acpi_ioremap_lock);
422 WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);430 WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
423 return;431 return;
424 }432 }
425 refcount = acpi_os_drop_map_ref(map);433 acpi_os_drop_map_ref(map);
426 mutex_unlock(&acpi_ioremap_lock);
427 434
428 if (!refcount)435 mutex_unlock(&acpi_ioremap_lock);
429 acpi_os_map_cleanup(map);
430}436}
431EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);437EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);
432 438
439/**
440 * acpi_os_unmap_memory - Drop a memory mapping reference.
441 * @virt: Start of the address range to drop a reference to.
442 * @size: Size of the address range to drop a reference to.
443 */
433void __ref acpi_os_unmap_memory(void *virt, acpi_size size)444void __ref acpi_os_unmap_memory(void *virt, acpi_size size)
434{445{
435 return acpi_os_unmap_iomem((void __iomem *)virt, size);446 acpi_os_unmap_iomem((void __iomem *)virt, size);
436}447}
437EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);448EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
438 449
@@ -461,7 +472,6 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 22 unmodified lines
461{472{
462 u64 addr;473 u64 addr;
463 struct acpi_ioremap *map;474 struct acpi_ioremap *map;
464 unsigned long refcount;
465 475
466 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)476 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
467 return;477 return;
@@ -472,16 +482,15 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 4 unmodified lines
472 return;482 return;
473 483
474 mutex_lock(&acpi_ioremap_lock);484 mutex_lock(&acpi_ioremap_lock);
485
475 map = acpi_map_lookup(addr, gas->bit_width / 8);486 map = acpi_map_lookup(addr, gas->bit_width / 8);
476 if (!map) {487 if (!map) {
477 mutex_unlock(&acpi_ioremap_lock);488 mutex_unlock(&acpi_ioremap_lock);
478 return;489 return;
479 }490 }
480 refcount = acpi_os_drop_map_ref(map);491 acpi_os_drop_map_ref(map);
481 mutex_unlock(&acpi_ioremap_lock);
482 492
483 if (!refcount)493 mutex_unlock(&acpi_ioremap_lock);
484 acpi_os_map_cleanup(map);
485}494}
486EXPORT_SYMBOL(acpi_os_unmap_generic_address);495EXPORT_SYMBOL(acpi_os_unmap_generic_address);
487 496
drivers/acpi/processor_idle.c+1−2
@@ -203,8 +203,7 @@ static void tsc_check_state(int state) · 202 unmodified lines
203 */203 */
204 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))204 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
205 return;205 return;
206 206 fallthrough;
207 /*FALL THROUGH*/
208 default:207 default:
209 /* TSC could halt in idle, so notify users */208 /* TSC could halt in idle, so notify users */
210 if (state > ACPI_STATE_C1)209 if (state > ACPI_STATE_C1)
drivers/acpi/property.c+2−12
@@ -606,13 +606,7 @@ static struct fwnode_handle * · 605 unmodified lines
606acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,606acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode,
607 const char *childname)607 const char *childname)
608{608{
609 char name[ACPI_PATH_SEGMENT_LENGTH];
610 struct fwnode_handle *child;609 struct fwnode_handle *child;
611 struct acpi_buffer path;
612 acpi_status status;
613
614 path.length = sizeof(name);
615 path.pointer = name;
616 610
617 fwnode_for_each_child_node(fwnode, child) {611 fwnode_for_each_child_node(fwnode, child) {
618 if (is_acpi_data_node(child)) {612 if (is_acpi_data_node(child)) {
@@ -621,12 +615,8 @@ acpi_fwnode_get_named_child_node(const struct fwnode_handle *fwnode, · 2 unmodified lines
621 continue;615 continue;
622 }616 }
623 617
624 status = acpi_get_name(ACPI_HANDLE_FWNODE(child),618 if (!strncmp(acpi_device_bid(to_acpi_device_node(child)),
625 ACPI_SINGLE_NAME, &path);619 childname, ACPI_NAMESEG_SIZE))
626 if (ACPI_FAILURE(status))
627 break;
628
629 if (!strncmp(name, childname, ACPI_NAMESEG_SIZE))
630 return child;620 return child;
631 }621 }
632 622
drivers/acpi/resource.c+1−1
@@ -373,7 +373,7 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity) · 372 unmodified lines
373 case ACPI_ACTIVE_BOTH:373 case ACPI_ACTIVE_BOTH:
374 if (triggering == ACPI_EDGE_SENSITIVE)374 if (triggering == ACPI_EDGE_SENSITIVE)
375 return IRQ_TYPE_EDGE_BOTH;375 return IRQ_TYPE_EDGE_BOTH;
376 /* fall through */376 fallthrough;
377 default:377 default:
378 return IRQ_TYPE_NONE;378 return IRQ_TYPE_NONE;
379 }379 }
drivers/acpi/spcr.c+2−2
@@ -111,7 +111,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 110 unmodified lines
111 table->serial_port.access_width))) {111 table->serial_port.access_width))) {
112 default:112 default:
113 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");113 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
114 /* fall through */114 fallthrough;
115 case 8:115 case 8:
116 iotype = "mmio";116 iotype = "mmio";
117 break;117 break;
@@ -128,7 +128,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 10 unmodified lines
128 switch (table->interface_type) {128 switch (table->interface_type) {
129 case ACPI_DBG2_ARM_SBSA_32BIT:129 case ACPI_DBG2_ARM_SBSA_32BIT:
130 iotype = "mmio32";130 iotype = "mmio32";
131 /* fall through */131 fallthrough;
132 case ACPI_DBG2_ARM_PL011:132 case ACPI_DBG2_ARM_PL011:
133 case ACPI_DBG2_ARM_SBSA_GENERIC:133 case ACPI_DBG2_ARM_SBSA_GENERIC:
134 case ACPI_DBG2_BCM2835:134 case ACPI_DBG2_BCM2835:
drivers/acpi/sysfs.c+6−6
@@ -214,7 +214,7 @@ static int param_set_trace_method_name(const char *val, · 213 unmodified lines
214 214
215static int param_get_trace_method_name(char *buffer, const struct kernel_param *kp)215static int param_get_trace_method_name(char *buffer, const struct kernel_param *kp)
216{216{
217 return scnprintf(buffer, PAGE_SIZE, "%s", acpi_gbl_trace_method_name);217 return scnprintf(buffer, PAGE_SIZE, "%s\n", acpi_gbl_trace_method_name);
218}218}
219 219
220static const struct kernel_param_ops param_ops_trace_method = {220static const struct kernel_param_ops param_ops_trace_method = {
@@ -271,15 +271,15 @@ static int param_set_trace_state(const char *val, · 50 unmodified lines
271static int param_get_trace_state(char *buffer, const struct kernel_param *kp)271static int param_get_trace_state(char *buffer, const struct kernel_param *kp)
272{272{
273 if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED))273 if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED))
274 return sprintf(buffer, "disable");274 return sprintf(buffer, "disable\n");
275 else {275 else {
276 if (acpi_gbl_trace_method_name) {276 if (acpi_gbl_trace_method_name) {
277 if (acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT)277 if (acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT)
278 return sprintf(buffer, "method-once");278 return sprintf(buffer, "method-once\n");
279 else279 else
280 return sprintf(buffer, "method");280 return sprintf(buffer, "method\n");
281 } else281 } else
282 return sprintf(buffer, "enable");282 return sprintf(buffer, "enable\n");
283 }283 }
284 return 0;284 return 0;
285}285}
@@ -302,7 +302,7 @@ static int param_get_acpica_version(char *buffer, · 16 unmodified lines
302{302{
303 int result;303 int result;
304 304
305 result = sprintf(buffer, "%x", ACPI_CA_VERSION);305 result = sprintf(buffer, "%x\n", ACPI_CA_VERSION);
306 306
307 return result;307 return result;
308}308}
drivers/acpi/tables.c+7−18
@@ -292,20 +292,6 @@ static int __init acpi_parse_entries_array(char *id, unsigned long table_size, · 291 unmodified lines
292 int errs = 0;292 int errs = 0;
293 int i;293 int i;
294 294
295 if (acpi_disabled)
296 return -ENODEV;
297
298 if (!id)
299 return -EINVAL;
300
301 if (!table_size)
302 return -EINVAL;
303
304 if (!table_header) {
305 pr_warn("%4.4s not present\n", id);
306 return -ENODEV;
307 }
308
309 table_end = (unsigned long)table_header + table_header->length;295 table_end = (unsigned long)table_header + table_header->length;
310 296
311 /* Parse all entries looking for a match. */297 /* Parse all entries looking for a match. */
@@ -371,6 +357,9 @@ int __init acpi_table_parse_entries_array(char *id, · 59 unmodified lines
371 if (!id)357 if (!id)
372 return -EINVAL;358 return -EINVAL;
373 359
360 if (!table_size)
361 return -EINVAL;
362
374 if (!strncmp(id, ACPI_SIG_MADT, 4))363 if (!strncmp(id, ACPI_SIG_MADT, 4))
375 instance = acpi_apic_instance;364 instance = acpi_apic_instance;
376 365
@@ -490,7 +479,7 @@ static u8 __init acpi_table_checksum(u8 *buffer, u32 length) · 113 unmodified lines
490}479}
491 480
492/* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */481/* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */
493static const char * const table_sigs[] = {482static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst = {
494 ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,483 ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
495 ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,484 ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,
496 ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,485 ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,
@@ -501,7 +490,7 @@ static const char * const table_sigs[] = { · 4 unmodified lines
501 ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,490 ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,
502 ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,491 ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,
503 ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,492 ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,
504 ACPI_SIG_NHLT, NULL };493 ACPI_SIG_NHLT };
505 494
506#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)495#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
507 496
@@ -548,11 +537,11 @@ void __init acpi_table_upgrade(void) · 40 unmodified lines
548 537
549 table = file.data;538 table = file.data;
550 539
551 for (sig = 0; table_sigs[sig]; sig++)540 for (sig = 0; sig < ARRAY_SIZE(table_sigs); sig++)
552 if (!memcmp(table->signature, table_sigs[sig], 4))541 if (!memcmp(table->signature, table_sigs[sig], 4))
553 break;542 break;
554 543
555 if (!table_sigs[sig]) {544 if (sig >= ARRAY_SIZE(table_sigs)) {
556 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",545 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",
557 cpio_path, file.name);546 cpio_path, file.name);
558 continue;547 continue;
drivers/pci/hotplug/acpiphp_glue.c+11−3
@@ -122,13 +122,21 @@ static struct acpiphp_context *acpiphp_grab_context(struct acpi_device *adev) · 121 unmodified lines
122 struct acpiphp_context *context;122 struct acpiphp_context *context;
123 123
124 acpi_lock_hp_context();124 acpi_lock_hp_context();
125
125 context = acpiphp_get_context(adev);126 context = acpiphp_get_context(adev);
126 if (!context || context->func.parent->is_going_away) {127 if (!context)
127 acpi_unlock_hp_context();128 goto unlock;
128 return NULL;129
130 if (context->func.parent->is_going_away) {
131 acpiphp_put_context(context);
132 context = NULL;
133 goto unlock;
129 }134 }
135
130 get_bridge(context->func.parent);136 get_bridge(context->func.parent);
131 acpiphp_put_context(context);137 acpiphp_put_context(context);
138
139unlock:
132 acpi_unlock_hp_context();140 acpi_unlock_hp_context();
133 return context;141 return context;
134}142}
drivers/pci/pci-acpi.c+3−3
@@ -527,8 +527,8 @@ static void program_hpx_type3_register(struct pci_dev *dev, · 526 unmodified lines
527 return;527 return;
528 528
529 break;529 break;
530 case HPX_CFG_VEND_CAP: /* Fall through */530 case HPX_CFG_VEND_CAP:
531 case HPX_CFG_DVSEC: /* Fall through */531 case HPX_CFG_DVSEC:
532 default:532 default:
533 pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");533 pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");
534 return;534 return;
@@ -1001,7 +1001,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) · 466 unmodified lines
1001 error = -EBUSY;1001 error = -EBUSY;
1002 break;1002 break;
1003 }1003 }
1004 /* Fall through */1004 fallthrough;
1005 case PCI_D0:1005 case PCI_D0:
1006 case PCI_D1:1006 case PCI_D1:
1007 case PCI_D2:1007 case PCI_D2:
include/acpi/acpixf.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
12 12
13/* Current ACPICA subsystem version in YYYYMMDD format */13/* Current ACPICA subsystem version in YYYYMMDD format */
14 14
15#define ACPI_CA_VERSION 0x2020052815#define ACPI_CA_VERSION 0x20200717
16 16
17#include <acpi/acconfig.h>17#include <acpi/acconfig.h>
18#include <acpi/actypes.h>18#include <acpi/actypes.h>
include/acpi/actypes.h+10−4
@@ -1146,7 +1146,7 @@ struct acpi_pnp_device_id { · 1145 unmodified lines
1146struct acpi_pnp_device_id_list {1146struct acpi_pnp_device_id_list {
1147 u32 count; /* Number of IDs in Ids array */1147 u32 count; /* Number of IDs in Ids array */
1148 u32 list_size; /* Size of list, including ID strings */1148 u32 list_size; /* Size of list, including ID strings */
1149 struct acpi_pnp_device_id ids[1]; /* ID array */1149 struct acpi_pnp_device_id ids[]; /* ID array */
1150};1150};
1151 1151
1152/*1152/*
@@ -1201,12 +1201,18 @@ struct acpi_pci_id { · 48 unmodified lines
1201 u16 function;1201 u16 function;
1202};1202};
1203 1203
1204struct acpi_mem_mapping {
1205 acpi_physical_address physical_address;
1206 u8 *logical_address;
1207 acpi_size length;
1208 struct acpi_mem_mapping *next_mm;
1209};
1210
1204struct acpi_mem_space_context {1211struct acpi_mem_space_context {
1205 u32 length;1212 u32 length;
1206 acpi_physical_address address;1213 acpi_physical_address address;
1207 acpi_physical_address mapped_physical_address;1214 struct acpi_mem_mapping *cur_mm;
1208 u8 *mapped_logical_address;1215 struct acpi_mem_mapping *first_mm;
1209 acpi_size mapped_length;
1210};1216};
1211 1217
1212/*1218/*
include/linux/tboot.h+1−1
@@ -44,7 +44,7 @@ struct tboot_acpi_generic_address { · 43 unmodified lines
44 44
45/*45/*
46 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec46 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
47 * (http://www.acpi.info/)47 * (https://uefi.org/specifications)
48 */48 */
49struct tboot_acpi_sleep_info {49struct tboot_acpi_sleep_info {
50 struct tboot_acpi_generic_address pm1a_cnt_blk;50 struct tboot_acpi_generic_address pm1a_cnt_blk;
tools/power/cpupower/man/cpupower-idle-info.1+1−1
@@ -75,7 +75,7 @@ By default only values of core zero are displayed. How to display settings of · 74 unmodified lines
75other cores is described in the cpupower(1) manpage in the \-\-cpu option75other cores is described in the cpupower(1) manpage in the \-\-cpu option
76section.76section.
77.SH REFERENCES77.SH REFERENCES
78http://www.acpi.info/spec.htm78https://uefi.org/specifications
79.SH "FILES"79.SH "FILES"
80.nf80.nf
81\fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP81\fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t