aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 20:56:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-26 20:56:45 -0400
commite663107fa1edda4d8a0d5b8ce704d71f8e27de43 (patch)
tree2ca367a9cdeb97ce613e792256b64831189af7b3 /include
parent6453dbdda30428a3c56568c96fe70ea3612f07e2 (diff)
parent54d0b14ad7cc4ff3c710f092a93638f359c1b14b (diff)
Merge tag 'acpi-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "The new feaures here are the support for ACPI overlays (allowing ACPI tables to be loaded at any time from EFI variables or via configfs) and the LPI (Low-Power Idle) support. Also notable is the ACPI-based NUMA support for ARM64. Apart from that we have two new drivers, for the DPTF (Dynamic Power and Thermal Framework) power participant device and for the Intel Broxton WhiskeyCove PMIC, some more PMIC-related changes, support for the Boot Error Record Table (BERT) in APEI and support for platform-initiated graceful shutdown. Plus two new pieces of documentation and usual assorted fixes and cleanups in quite a few places. Specifics: - Support for ACPI SSDT overlays allowing Secondary System Description Tables (SSDTs) to be loaded at any time from EFI variables or via configfs (Octavian Purdila, Mika Westerberg). - Support for the ACPI LPI (Low-Power Idle) feature introduced in ACPI 6.0 and allowing processor idle states to be represented in ACPI tables in a hierarchical way (with the help of Processor Container objects) and support for ACPI idle states management on ARM64, based on LPI (Sudeep Holla). - General improvements of ACPI support for NUMA and ARM64 support for ACPI-based NUMA (Hanjun Guo, David Daney, Robert Richter). - General improvements of the ACPI table upgrade mechanism and ARM64 support for that feature (Aleksey Makarov, Jon Masters). - Support for the Boot Error Record Table (BERT) in APEI and improvements of kernel messages printed by the error injection code (Huang Ying, Borislav Petkov). - New driver for the Intel Broxton WhiskeyCove PMIC operation region and support for the REGS operation region on Broxton, PMIC code cleanups (Bin Gao, Felipe Balbi, Paul Gortmaker). - New driver for the power participant device which is part of the Dynamic Power and Thermal Framework (DPTF) and DPTF-related code reorganization (Srinivas Pandruvada). - Support for the platform-initiated graceful shutdown feature introduced in ACPI 6.1 (Prashanth Prakash). - ACPI button driver update related to lid input events generated automatically on initialization and system resume that have been problematic for some time (Lv Zheng). - ACPI EC driver cleanups (Lv Zheng). - Documentation of the ACPICA release automation process and the in-kernel ACPI AML debugger (Lv Zheng). - New blacklist entry and two fixes for the ACPI backlight driver (Alex Hung, Arvind Yadav, Ralf Gerbig). - Cleanups of the ACPI pci_slot driver (Joe Perches, Paul Gortmaker). - ACPI CPPC code changes to make it more robust against possible defects in ACPI tables and new symbol definitions for PCC (Hoan Tran). - System reboot code modification to execute the ACPI _PTS (Prepare To Sleep) method in addition to _TTS (Ocean He). - ACPICA-related change to carry out lock ordering checks in ACPICA if ACPICA debug is enabled in the kernel (Lv Zheng). - Assorted minor fixes and cleanups (Andy Shevchenko, Baoquan He, Bhaktipriya Shridhar, Paul Gortmaker, Rafael Wysocki)" * tag 'acpi-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (71 commits) ACPI: enable ACPI_PROCESSOR_IDLE on ARM64 arm64: add support for ACPI Low Power Idle(LPI) drivers: firmware: psci: initialise idle states using ACPI LPI cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64} arm64: cpuidle: drop __init section marker to arm_cpuidle_init ACPI / processor_idle: Add support for Low Power Idle(LPI) states ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE ACPI / DPTF: move int340x_thermal.c to the DPTF folder ACPI / DPTF: Add DPTF power participant driver ACPI / lpat: make it explicitly non-modular ACPI / dock: make dock explicitly non-modular ACPI / PCI: make pci_slot explicitly non-modular ACPI / PMIC: remove modular references from non-modular code ACPICA: Linux: Enable ACPI_MUTEX_DEBUG for Linux kernel ACPI: Rename configfs.c to acpi_configfs.c to prevent link error ACPI / debugger: Add AML debugger documentation ACPI: Add documentation describing ACPICA release automation ACPI: add support for loading SSDTs via configfs ACPI: add support for configfs efi / ACPI: load SSTDs from EFI variables ...
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_numa.h4
-rw-r--r--include/acpi/cppc_acpi.h7
-rw-r--r--include/acpi/pcc.h29
-rw-r--r--include/acpi/platform/aclinux.h4
-rw-r--r--include/acpi/processor.h27
-rw-r--r--include/acpi/video.h2
-rw-r--r--include/linux/acpi.h66
-rw-r--r--include/linux/cpuidle.h18
8 files changed, 142 insertions, 15 deletions
diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h
index 94a37cd7fbda..d4b72944ccda 100644
--- a/include/acpi/acpi_numa.h
+++ b/include/acpi/acpi_numa.h
@@ -15,6 +15,10 @@ extern int pxm_to_node(int);
15extern int node_to_pxm(int); 15extern int node_to_pxm(int);
16extern int acpi_map_pxm_to_node(int); 16extern int acpi_map_pxm_to_node(int);
17extern unsigned char acpi_srat_revision; 17extern unsigned char acpi_srat_revision;
18extern int acpi_numa __initdata;
19
20extern void bad_srat(void);
21extern int srat_disabled(void);
18 22
19#endif /* CONFIG_ACPI_NUMA */ 23#endif /* CONFIG_ACPI_NUMA */
20#endif /* __ACP_NUMA_H */ 24#endif /* __ACP_NUMA_H */
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h
index dad8af3ebeb5..284965cbc9af 100644
--- a/include/acpi/cppc_acpi.h
+++ b/include/acpi/cppc_acpi.h
@@ -15,10 +15,9 @@
15#define _CPPC_ACPI_H 15#define _CPPC_ACPI_H
16 16
17#include <linux/acpi.h> 17#include <linux/acpi.h>
18#include <linux/mailbox_controller.h>
19#include <linux/mailbox_client.h>
20#include <linux/types.h> 18#include <linux/types.h>
21 19
20#include <acpi/pcc.h>
22#include <acpi/processor.h> 21#include <acpi/processor.h>
23 22
24/* Only support CPPCv2 for now. */ 23/* Only support CPPCv2 for now. */
@@ -130,8 +129,4 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
130extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); 129extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
131extern int acpi_get_psd_map(struct cpudata **); 130extern int acpi_get_psd_map(struct cpudata **);
132 131
133/* Methods to interact with the PCC mailbox controller. */
134extern struct mbox_chan *
135 pcc_mbox_request_channel(struct mbox_client *, unsigned int);
136
137#endif /* _CPPC_ACPI_H*/ 132#endif /* _CPPC_ACPI_H*/
diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h
new file mode 100644
index 000000000000..17a940a14477
--- /dev/null
+++ b/include/acpi/pcc.h
@@ -0,0 +1,29 @@
1/*
2 * PCC (Platform Communications Channel) methods
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; version 2
7 * of the License.
8 */
9
10#ifndef _PCC_H
11#define _PCC_H
12
13#include <linux/mailbox_controller.h>
14#include <linux/mailbox_client.h>
15
16#ifdef CONFIG_PCC
17extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
18 int subspace_id);
19extern void pcc_mbox_free_channel(struct mbox_chan *chan);
20#else
21static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
22 int subspace_id)
23{
24 return NULL;
25}
26static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
27#endif
28
29#endif /* _PCC_H */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 45c2d6528829..93b61b1f2beb 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -73,6 +73,10 @@
73#define ACPI_DEBUGGER 73#define ACPI_DEBUGGER
74#endif 74#endif
75 75
76#ifdef CONFIG_ACPI_DEBUG
77#define ACPI_MUTEX_DEBUG
78#endif
79
76#include <linux/string.h> 80#include <linux/string.h>
77#include <linux/kernel.h> 81#include <linux/kernel.h>
78#include <linux/ctype.h> 82#include <linux/ctype.h>
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 6f1805dd5d3c..bfe6b2e10f3a 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -39,6 +39,7 @@
39#define ACPI_CSTATE_SYSTEMIO 0 39#define ACPI_CSTATE_SYSTEMIO 0
40#define ACPI_CSTATE_FFH 1 40#define ACPI_CSTATE_FFH 1
41#define ACPI_CSTATE_HALT 2 41#define ACPI_CSTATE_HALT 2
42#define ACPI_CSTATE_INTEGER 3
42 43
43#define ACPI_CX_DESC_LEN 32 44#define ACPI_CX_DESC_LEN 32
44 45
@@ -67,9 +68,25 @@ struct acpi_processor_cx {
67 char desc[ACPI_CX_DESC_LEN]; 68 char desc[ACPI_CX_DESC_LEN];
68}; 69};
69 70
71struct acpi_lpi_state {
72 u32 min_residency;
73 u32 wake_latency; /* worst case */
74 u32 flags;
75 u32 arch_flags;
76 u32 res_cnt_freq;
77 u32 enable_parent_state;
78 u64 address;
79 u8 index;
80 u8 entry_method;
81 char desc[ACPI_CX_DESC_LEN];
82};
83
70struct acpi_processor_power { 84struct acpi_processor_power {
71 int count; 85 int count;
72 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 86 union {
87 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
88 struct acpi_lpi_state lpi_states[ACPI_PROCESSOR_MAX_POWER];
89 };
73 int timer_broadcast_on_state; 90 int timer_broadcast_on_state;
74}; 91};
75 92
@@ -189,6 +206,7 @@ struct acpi_processor_flags {
189 u8 bm_control:1; 206 u8 bm_control:1;
190 u8 bm_check:1; 207 u8 bm_check:1;
191 u8 has_cst:1; 208 u8 has_cst:1;
209 u8 has_lpi:1;
192 u8 power_setup_done:1; 210 u8 power_setup_done:1;
193 u8 bm_rld_set:1; 211 u8 bm_rld_set:1;
194 u8 need_hotplug_init:1; 212 u8 need_hotplug_init:1;
@@ -242,7 +260,7 @@ extern int acpi_processor_get_performance_info(struct acpi_processor *pr);
242DECLARE_PER_CPU(struct acpi_processor *, processors); 260DECLARE_PER_CPU(struct acpi_processor *, processors);
243extern struct acpi_processor_errata errata; 261extern struct acpi_processor_errata errata;
244 262
245#ifdef ARCH_HAS_POWER_INIT 263#if defined(ARCH_HAS_POWER_INIT) && defined(CONFIG_ACPI_PROCESSOR_CSTATE)
246void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 264void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
247 unsigned int cpu); 265 unsigned int cpu);
248int acpi_processor_ffh_cstate_probe(unsigned int cpu, 266int acpi_processor_ffh_cstate_probe(unsigned int cpu,
@@ -309,6 +327,7 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
309 327
310/* in processor_core.c */ 328/* in processor_core.c */
311phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id); 329phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id);
330phys_cpuid_t acpi_map_madt_entry(u32 acpi_id);
312int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id); 331int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id);
313int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id); 332int acpi_get_cpuid(acpi_handle, int type, u32 acpi_id);
314 333
@@ -371,7 +390,7 @@ extern struct cpuidle_driver acpi_idle_driver;
371#ifdef CONFIG_ACPI_PROCESSOR_IDLE 390#ifdef CONFIG_ACPI_PROCESSOR_IDLE
372int acpi_processor_power_init(struct acpi_processor *pr); 391int acpi_processor_power_init(struct acpi_processor *pr);
373int acpi_processor_power_exit(struct acpi_processor *pr); 392int acpi_processor_power_exit(struct acpi_processor *pr);
374int acpi_processor_cst_has_changed(struct acpi_processor *pr); 393int acpi_processor_power_state_has_changed(struct acpi_processor *pr);
375int acpi_processor_hotplug(struct acpi_processor *pr); 394int acpi_processor_hotplug(struct acpi_processor *pr);
376#else 395#else
377static inline int acpi_processor_power_init(struct acpi_processor *pr) 396static inline int acpi_processor_power_init(struct acpi_processor *pr)
@@ -384,7 +403,7 @@ static inline int acpi_processor_power_exit(struct acpi_processor *pr)
384 return -ENODEV; 403 return -ENODEV;
385} 404}
386 405
387static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr) 406static inline int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
388{ 407{
389 return -ENODEV; 408 return -ENODEV;
390} 409}
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 5731ccb42585..4536bd345ab4 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -54,7 +54,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
54 struct acpi_video_device_brightness **dev_br, 54 struct acpi_video_device_brightness **dev_br,
55 int *pmax_level); 55 int *pmax_level);
56#else 56#else
57static inline int acpi_video_register(void) { return 0; } 57static inline int acpi_video_register(void) { return -ENODEV; }
58static inline void acpi_video_unregister(void) { return; } 58static inline void acpi_video_unregister(void) { return; }
59static inline int acpi_video_get_edid(struct acpi_device *device, int type, 59static inline int acpi_video_get_edid(struct acpi_device *device, int type,
60 int device_id, void **edid) 60 int device_id, void **edid)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 288fac5294f5..cc63aef07249 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -208,7 +208,6 @@ void acpi_boot_table_init (void);
208int acpi_mps_check (void); 208int acpi_mps_check (void);
209int acpi_numa_init (void); 209int acpi_numa_init (void);
210 210
211void early_acpi_table_init(void *data, size_t size);
212int acpi_table_init (void); 211int acpi_table_init (void);
213int acpi_table_parse(char *id, acpi_tbl_table_handler handler); 212int acpi_table_parse(char *id, acpi_tbl_table_handler handler);
214int __init acpi_parse_entries(char *id, unsigned long table_size, 213int __init acpi_parse_entries(char *id, unsigned long table_size,
@@ -232,12 +231,26 @@ int acpi_table_parse_madt(enum acpi_madt_type id,
232int acpi_parse_mcfg (struct acpi_table_header *header); 231int acpi_parse_mcfg (struct acpi_table_header *header);
233void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); 232void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
234 233
235/* the following four functions are architecture-dependent */ 234/* the following numa functions are architecture-dependent */
236void acpi_numa_slit_init (struct acpi_table_slit *slit); 235void acpi_numa_slit_init (struct acpi_table_slit *slit);
236
237#if defined(CONFIG_X86) || defined(CONFIG_IA64)
237void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa); 238void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
239#else
240static inline void
241acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) { }
242#endif
243
238void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa); 244void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
245
246#ifdef CONFIG_ARM64
247void acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa);
248#else
249static inline void
250acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) { }
251#endif
252
239int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma); 253int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
240void acpi_numa_arch_fixup(void);
241 254
242#ifndef PHYS_CPUID_INVALID 255#ifndef PHYS_CPUID_INVALID
243typedef u32 phys_cpuid_t; 256typedef u32 phys_cpuid_t;
@@ -444,8 +457,12 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
444#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008 457#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008
445#define OSC_SB_APEI_SUPPORT 0x00000010 458#define OSC_SB_APEI_SUPPORT 0x00000010
446#define OSC_SB_CPC_SUPPORT 0x00000020 459#define OSC_SB_CPC_SUPPORT 0x00000020
460#define OSC_SB_CPCV2_SUPPORT 0x00000040
461#define OSC_SB_PCLPI_SUPPORT 0x00000080
462#define OSC_SB_OSLPI_SUPPORT 0x00000100
447 463
448extern bool osc_sb_apei_support_acked; 464extern bool osc_sb_apei_support_acked;
465extern bool osc_pc_lpi_support_confirmed;
449 466
450/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */ 467/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */
451#define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001 468#define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001
@@ -532,6 +549,24 @@ void acpi_walk_dep_device_list(acpi_handle handle);
532struct platform_device *acpi_create_platform_device(struct acpi_device *); 549struct platform_device *acpi_create_platform_device(struct acpi_device *);
533#define ACPI_PTR(_ptr) (_ptr) 550#define ACPI_PTR(_ptr) (_ptr)
534 551
552static inline void acpi_device_set_enumerated(struct acpi_device *adev)
553{
554 adev->flags.visited = true;
555}
556
557static inline void acpi_device_clear_enumerated(struct acpi_device *adev)
558{
559 adev->flags.visited = false;
560}
561
562enum acpi_reconfig_event {
563 ACPI_RECONFIG_DEVICE_ADD = 0,
564 ACPI_RECONFIG_DEVICE_REMOVE,
565};
566
567int acpi_reconfig_notifier_register(struct notifier_block *nb);
568int acpi_reconfig_notifier_unregister(struct notifier_block *nb);
569
535#else /* !CONFIG_ACPI */ 570#else /* !CONFIG_ACPI */
536 571
537#define acpi_disabled 1 572#define acpi_disabled 1
@@ -588,7 +623,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev)
588 return NULL; 623 return NULL;
589} 624}
590 625
591static inline void early_acpi_table_init(void *data, size_t size) { }
592static inline void acpi_early_init(void) { } 626static inline void acpi_early_init(void) { }
593static inline void acpi_subsystem_init(void) { } 627static inline void acpi_subsystem_init(void) { }
594 628
@@ -678,6 +712,24 @@ static inline enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev)
678 712
679#define ACPI_PTR(_ptr) (NULL) 713#define ACPI_PTR(_ptr) (NULL)
680 714
715static inline void acpi_device_set_enumerated(struct acpi_device *adev)
716{
717}
718
719static inline void acpi_device_clear_enumerated(struct acpi_device *adev)
720{
721}
722
723static inline int acpi_reconfig_notifier_register(struct notifier_block *nb)
724{
725 return -EINVAL;
726}
727
728static inline int acpi_reconfig_notifier_unregister(struct notifier_block *nb)
729{
730 return -EINVAL;
731}
732
681#endif /* !CONFIG_ACPI */ 733#endif /* !CONFIG_ACPI */
682 734
683#ifdef CONFIG_ACPI 735#ifdef CONFIG_ACPI
@@ -997,4 +1049,10 @@ static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
997#define acpi_probe_device_table(t) ({ int __r = 0; __r;}) 1049#define acpi_probe_device_table(t) ({ int __r = 0; __r;})
998#endif 1050#endif
999 1051
1052#ifdef CONFIG_ACPI_TABLE_UPGRADE
1053void acpi_table_upgrade(void);
1054#else
1055static inline void acpi_table_upgrade(void) { }
1056#endif
1057
1000#endif /*_LINUX_ACPI_H*/ 1058#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 07b83d32f66c..bb31373c3478 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -252,4 +252,22 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
252#define CPUIDLE_DRIVER_STATE_START 0 252#define CPUIDLE_DRIVER_STATE_START 0
253#endif 253#endif
254 254
255#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \
256({ \
257 int __ret; \
258 \
259 if (!idx) { \
260 cpu_do_idle(); \
261 return idx; \
262 } \
263 \
264 __ret = cpu_pm_enter(); \
265 if (!__ret) { \
266 __ret = low_level_idle_enter(idx); \
267 cpu_pm_exit(); \
268 } \
269 \
270 __ret ? -1 : idx; \
271})
272
255#endif /* _LINUX_CPUIDLE_H */ 273#endif /* _LINUX_CPUIDLE_H */