diff options
57 files changed, 424 insertions, 169 deletions
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ea2ab0330e3a..bcb6262044d8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -5,7 +5,7 @@ config ARM64 | |||
5 | select ACPI_GTDT if ACPI | 5 | select ACPI_GTDT if ACPI |
6 | select ACPI_IORT if ACPI | 6 | select ACPI_IORT if ACPI |
7 | select ACPI_REDUCED_HARDWARE_ONLY if ACPI | 7 | select ACPI_REDUCED_HARDWARE_ONLY if ACPI |
8 | select ACPI_MCFG if ACPI | 8 | select ACPI_MCFG if (ACPI && PCI) |
9 | select ACPI_SPCR_TABLE if ACPI | 9 | select ACPI_SPCR_TABLE if ACPI |
10 | select ACPI_PPTT if ACPI | 10 | select ACPI_PPTT if ACPI |
11 | select ARCH_CLOCKSOURCE_DATA | 11 | select ARCH_CLOCKSOURCE_DATA |
@@ -163,7 +163,7 @@ config ARM64 | |||
163 | select OF | 163 | select OF |
164 | select OF_EARLY_FLATTREE | 164 | select OF_EARLY_FLATTREE |
165 | select OF_RESERVED_MEM | 165 | select OF_RESERVED_MEM |
166 | select PCI_ECAM if ACPI | 166 | select PCI_ECAM if (ACPI && PCI) |
167 | select POWER_RESET | 167 | select POWER_RESET |
168 | select POWER_SUPPLY | 168 | select POWER_SUPPLY |
169 | select REFCOUNT_FULL | 169 | select REFCOUNT_FULL |
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h index 959d618dbb17..73bb404f4d2a 100644 --- a/arch/x86/include/asm/pci_x86.h +++ b/arch/x86/include/asm/pci_x86.h | |||
@@ -121,7 +121,14 @@ extern void __init dmi_check_pciprobe(void); | |||
121 | extern void __init dmi_check_skip_isa_align(void); | 121 | extern void __init dmi_check_skip_isa_align(void); |
122 | 122 | ||
123 | /* some common used subsys_initcalls */ | 123 | /* some common used subsys_initcalls */ |
124 | #ifdef CONFIG_PCI | ||
124 | extern int __init pci_acpi_init(void); | 125 | extern int __init pci_acpi_init(void); |
126 | #else | ||
127 | static inline int __init pci_acpi_init(void) | ||
128 | { | ||
129 | return -EINVAL; | ||
130 | } | ||
131 | #endif | ||
125 | extern void __init pcibios_irq_init(void); | 132 | extern void __init pcibios_irq_init(void); |
126 | extern int __init pcibios_init(void); | 133 | extern int __init pcibios_init(void); |
127 | extern int pci_legacy_init(void); | 134 | extern int pci_legacy_init(void); |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 7cea769c37df..7b65a807b3dd 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -9,7 +9,6 @@ config ARCH_SUPPORTS_ACPI | |||
9 | menuconfig ACPI | 9 | menuconfig ACPI |
10 | bool "ACPI (Advanced Configuration and Power Interface) Support" | 10 | bool "ACPI (Advanced Configuration and Power Interface) Support" |
11 | depends on ARCH_SUPPORTS_ACPI | 11 | depends on ARCH_SUPPORTS_ACPI |
12 | depends on PCI | ||
13 | select PNP | 12 | select PNP |
14 | default y if X86 | 13 | default y if X86 |
15 | help | 14 | help |
@@ -336,7 +335,7 @@ config ACPI_CUSTOM_DSDT_FILE | |||
336 | See Documentation/acpi/dsdt-override.txt | 335 | See Documentation/acpi/dsdt-override.txt |
337 | 336 | ||
338 | Enter the full path name to the file which includes the AmlCode | 337 | Enter the full path name to the file which includes the AmlCode |
339 | declaration. | 338 | or dsdt_aml_code declaration. |
340 | 339 | ||
341 | If unsure, don't enter a file name. | 340 | If unsure, don't enter a file name. |
342 | 341 | ||
@@ -370,7 +369,7 @@ config ACPI_DEBUG | |||
370 | 369 | ||
371 | config ACPI_PCI_SLOT | 370 | config ACPI_PCI_SLOT |
372 | bool "PCI slot detection driver" | 371 | bool "PCI slot detection driver" |
373 | depends on SYSFS | 372 | depends on SYSFS && PCI |
374 | help | 373 | help |
375 | This driver creates entries in /sys/bus/pci/slots/ for all PCI | 374 | This driver creates entries in /sys/bus/pci/slots/ for all PCI |
376 | slots in the system. This can help correlate PCI bus addresses, | 375 | slots in the system. This can help correlate PCI bus addresses, |
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index edc039313cd6..7c6afc111d76 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile | |||
@@ -39,7 +39,7 @@ acpi-y += processor_core.o | |||
39 | acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o | 39 | acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o |
40 | acpi-y += ec.o | 40 | acpi-y += ec.o |
41 | acpi-$(CONFIG_ACPI_DOCK) += dock.o | 41 | acpi-$(CONFIG_ACPI_DOCK) += dock.o |
42 | acpi-y += pci_root.o pci_link.o pci_irq.o | 42 | acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o |
43 | obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o | 43 | obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o |
44 | acpi-y += acpi_lpss.o acpi_apd.o | 44 | acpi-y += acpi_lpss.o acpi_apd.o |
45 | acpi-y += acpi_platform.o | 45 | acpi-y += acpi_platform.o |
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c index 2664452fa112..ddf598ae8b6b 100644 --- a/drivers/acpi/acpi_apd.c +++ b/drivers/acpi/acpi_apd.c | |||
@@ -166,6 +166,11 @@ static const struct apd_device_desc thunderx2_i2c_desc = { | |||
166 | .setup = acpi_apd_setup, | 166 | .setup = acpi_apd_setup, |
167 | .fixed_clk_rate = 125000000, | 167 | .fixed_clk_rate = 125000000, |
168 | }; | 168 | }; |
169 | |||
170 | static const struct apd_device_desc hip08_spi_desc = { | ||
171 | .setup = acpi_apd_setup, | ||
172 | .fixed_clk_rate = 250000000, | ||
173 | }; | ||
169 | #endif | 174 | #endif |
170 | 175 | ||
171 | #else | 176 | #else |
@@ -234,6 +239,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = { | |||
234 | { "CAV9007", APD_ADDR(thunderx2_i2c_desc) }, | 239 | { "CAV9007", APD_ADDR(thunderx2_i2c_desc) }, |
235 | { "HISI02A1", APD_ADDR(hip07_i2c_desc) }, | 240 | { "HISI02A1", APD_ADDR(hip07_i2c_desc) }, |
236 | { "HISI02A2", APD_ADDR(hip08_i2c_desc) }, | 241 | { "HISI02A2", APD_ADDR(hip08_i2c_desc) }, |
242 | { "HISI0173", APD_ADDR(hip08_spi_desc) }, | ||
237 | #endif | 243 | #endif |
238 | { } | 244 | { } |
239 | }; | 245 | }; |
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index b9bda06d344d..5f94c35d165f 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -673,12 +673,7 @@ static int acpi_lpss_create_device(struct acpi_device *adev, | |||
673 | * have _PS0 and _PS3 without _PSC (and no power resources), so | 673 | * have _PS0 and _PS3 without _PSC (and no power resources), so |
674 | * acpi_bus_init_power() will assume that the BIOS has put them into D0. | 674 | * acpi_bus_init_power() will assume that the BIOS has put them into D0. |
675 | */ | 675 | */ |
676 | ret = acpi_device_fix_up_power(adev); | 676 | acpi_device_fix_up_power(adev); |
677 | if (ret) { | ||
678 | /* Skip the device, but continue the namespace scan. */ | ||
679 | ret = 0; | ||
680 | goto err_out; | ||
681 | } | ||
682 | 677 | ||
683 | adev->driver_data = pdata; | 678 | adev->driver_data = pdata; |
684 | pdev = acpi_create_platform_device(adev, dev_desc->properties); | 679 | pdev = acpi_create_platform_device(adev, dev_desc->properties); |
diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index b14621da5413..59700433a96e 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile | |||
@@ -77,13 +77,13 @@ acpi-y += \ | |||
77 | hwacpi.o \ | 77 | hwacpi.o \ |
78 | hwesleep.o \ | 78 | hwesleep.o \ |
79 | hwgpe.o \ | 79 | hwgpe.o \ |
80 | hwpci.o \ | ||
81 | hwregs.o \ | 80 | hwregs.o \ |
82 | hwsleep.o \ | 81 | hwsleep.o \ |
83 | hwvalid.o \ | 82 | hwvalid.o \ |
84 | hwxface.o \ | 83 | hwxface.o \ |
85 | hwxfsleep.o | 84 | hwxfsleep.o |
86 | 85 | ||
86 | acpi-$(CONFIG_PCI) += hwpci.o | ||
87 | acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o | 87 | acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o |
88 | 88 | ||
89 | acpi-y += \ | 89 | acpi-y += \ |
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h index 1e6204518496..87d6eb01beaf 100644 --- a/drivers/acpi/acpica/acglobal.h +++ b/drivers/acpi/acpica/acglobal.h | |||
@@ -172,11 +172,7 @@ ACPI_GLOBAL(u8, acpi_gbl_disable_mem_tracking); | |||
172 | * | 172 | * |
173 | ****************************************************************************/ | 173 | ****************************************************************************/ |
174 | 174 | ||
175 | #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) | ||
176 | #define NUM_PREDEFINED_NAMES 10 | 175 | #define NUM_PREDEFINED_NAMES 10 |
177 | #else | ||
178 | #define NUM_PREDEFINED_NAMES 9 | ||
179 | #endif | ||
180 | 176 | ||
181 | ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct); | 177 | ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct); |
182 | ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node); | 178 | ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node); |
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h index 43ce67a9da1f..ef99e2fc37f8 100644 --- a/drivers/acpi/acpica/achware.h +++ b/drivers/acpi/acpica/achware.h | |||
@@ -106,11 +106,20 @@ acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, | |||
106 | struct acpi_gpe_block_info *gpe_block, | 106 | struct acpi_gpe_block_info *gpe_block, |
107 | void *context); | 107 | void *context); |
108 | 108 | ||
109 | #ifdef ACPI_PCI_CONFIGURED | ||
109 | /* | 110 | /* |
110 | * hwpci - PCI configuration support | 111 | * hwpci - PCI configuration support |
111 | */ | 112 | */ |
112 | acpi_status | 113 | acpi_status |
113 | acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, | 114 | acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, |
114 | acpi_handle root_pci_device, acpi_handle pci_region); | 115 | acpi_handle root_pci_device, acpi_handle pci_region); |
116 | #else | ||
117 | static inline acpi_status | ||
118 | acpi_hw_derive_pci_id(struct acpi_pci_id *pci_id, acpi_handle root_pci_device, | ||
119 | acpi_handle pci_region) | ||
120 | { | ||
121 | return AE_SUPPORT; | ||
122 | } | ||
123 | #endif | ||
115 | 124 | ||
116 | #endif /* __ACHWARE_H__ */ | 125 | #endif /* __ACHWARE_H__ */ |
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h index bbb3b4d1e796..9bd25f36c608 100644 --- a/drivers/acpi/acpica/acnamesp.h +++ b/drivers/acpi/acpica/acnamesp.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define ACPI_NS_TEMPORARY 0x0040 | 34 | #define ACPI_NS_TEMPORARY 0x0040 |
35 | #define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 | 35 | #define ACPI_NS_OVERRIDE_IF_FOUND 0x0080 |
36 | #define ACPI_NS_EARLY_INIT 0x0100 | 36 | #define ACPI_NS_EARLY_INIT 0x0100 |
37 | #define ACPI_NS_PREFIX_MUST_EXIST 0x0200 | ||
37 | 38 | ||
38 | /* Flags for acpi_ns_walk_namespace */ | 39 | /* Flags for acpi_ns_walk_namespace */ |
39 | 40 | ||
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h index acf27156dbd4..14be32961b4c 100644 --- a/drivers/acpi/acpica/acstruct.h +++ b/drivers/acpi/acpica/acstruct.h | |||
@@ -60,6 +60,8 @@ struct acpi_walk_state { | |||
60 | struct acpi_parse_state parser_state; /* Current state of parser */ | 60 | struct acpi_parse_state parser_state; /* Current state of parser */ |
61 | u32 prev_arg_types; | 61 | u32 prev_arg_types; |
62 | u32 arg_count; /* push for fixed or var args */ | 62 | u32 arg_count; /* push for fixed or var args */ |
63 | u16 method_nesting_depth; | ||
64 | u8 method_is_nested; | ||
63 | 65 | ||
64 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ | 66 | struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ |
65 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ | 67 | struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ |
@@ -74,7 +76,8 @@ struct acpi_walk_state { | |||
74 | struct acpi_namespace_node *method_call_node; /* Called method Node */ | 76 | struct acpi_namespace_node *method_call_node; /* Called method Node */ |
75 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ | 77 | union acpi_parse_object *method_call_op; /* method_call Op if running a method */ |
76 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ | 78 | union acpi_operand_object *method_desc; /* Method descriptor if running a method */ |
77 | struct acpi_namespace_node *method_node; /* Method node if running a method. */ | 79 | struct acpi_namespace_node *method_node; /* Method node if running a method */ |
80 | char *method_pathname; /* Full pathname of running method */ | ||
78 | union acpi_parse_object *op; /* Current parser op */ | 81 | union acpi_parse_object *op; /* Current parser op */ |
79 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ | 82 | const struct acpi_opcode_info *op_info; /* Info on current opcode */ |
80 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ | 83 | union acpi_parse_object *origin; /* Start of walk [Obsolete] */ |
diff --git a/drivers/acpi/acpica/dbxface.c b/drivers/acpi/acpica/dbxface.c index f2526726daf6..3eb45ea93e5e 100644 --- a/drivers/acpi/acpica/dbxface.c +++ b/drivers/acpi/acpica/dbxface.c | |||
@@ -24,6 +24,13 @@ acpi_db_start_command(struct acpi_walk_state *walk_state, | |||
24 | void acpi_db_method_end(struct acpi_walk_state *walk_state); | 24 | void acpi_db_method_end(struct acpi_walk_state *walk_state); |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #ifdef ACPI_DISASSEMBLER | ||
28 | static union acpi_parse_object *acpi_db_get_display_op(struct acpi_walk_state | ||
29 | *walk_state, | ||
30 | union acpi_parse_object | ||
31 | *op); | ||
32 | #endif | ||
33 | |||
27 | /******************************************************************************* | 34 | /******************************************************************************* |
28 | * | 35 | * |
29 | * FUNCTION: acpi_db_start_command | 36 | * FUNCTION: acpi_db_start_command |
@@ -113,6 +120,70 @@ void acpi_db_signal_break_point(struct acpi_walk_state *walk_state) | |||
113 | acpi_os_printf("**break** Executed AML BreakPoint opcode\n"); | 120 | acpi_os_printf("**break** Executed AML BreakPoint opcode\n"); |
114 | } | 121 | } |
115 | 122 | ||
123 | #ifdef ACPI_DISASSEMBLER | ||
124 | /******************************************************************************* | ||
125 | * | ||
126 | * FUNCTION: acpi_db_get_display_op | ||
127 | * | ||
128 | * PARAMETERS: walk_state - Current walk | ||
129 | * op - Current executing op (from aml interpreter) | ||
130 | * | ||
131 | * RETURN: Opcode to display | ||
132 | * | ||
133 | * DESCRIPTION: Find the opcode to display during single stepping | ||
134 | * | ||
135 | ******************************************************************************/ | ||
136 | |||
137 | static union acpi_parse_object *acpi_db_get_display_op(struct acpi_walk_state | ||
138 | *walk_state, | ||
139 | union acpi_parse_object | ||
140 | *op) | ||
141 | { | ||
142 | union acpi_parse_object *display_op; | ||
143 | union acpi_parse_object *parent_op; | ||
144 | |||
145 | display_op = op; | ||
146 | parent_op = op->common.parent; | ||
147 | if (parent_op) { | ||
148 | if ((walk_state->control_state) && | ||
149 | (walk_state->control_state->common.state == | ||
150 | ACPI_CONTROL_PREDICATE_EXECUTING)) { | ||
151 | /* | ||
152 | * We are executing the predicate of an IF or WHILE statement | ||
153 | * Search upwards for the containing IF or WHILE so that the | ||
154 | * entire predicate can be displayed. | ||
155 | */ | ||
156 | while (parent_op) { | ||
157 | if ((parent_op->common.aml_opcode == AML_IF_OP) | ||
158 | || (parent_op->common.aml_opcode == | ||
159 | AML_WHILE_OP)) { | ||
160 | display_op = parent_op; | ||
161 | break; | ||
162 | } | ||
163 | parent_op = parent_op->common.parent; | ||
164 | } | ||
165 | } else { | ||
166 | while (parent_op) { | ||
167 | if ((parent_op->common.aml_opcode == AML_IF_OP) | ||
168 | || (parent_op->common.aml_opcode == | ||
169 | AML_ELSE_OP) | ||
170 | || (parent_op->common.aml_opcode == | ||
171 | AML_SCOPE_OP) | ||
172 | || (parent_op->common.aml_opcode == | ||
173 | AML_METHOD_OP) | ||
174 | || (parent_op->common.aml_opcode == | ||
175 | AML_WHILE_OP)) { | ||
176 | break; | ||
177 | } | ||
178 | display_op = parent_op; | ||
179 | parent_op = parent_op->common.parent; | ||
180 | } | ||
181 | } | ||
182 | } | ||
183 | return display_op; | ||
184 | } | ||
185 | #endif | ||
186 | |||
116 | /******************************************************************************* | 187 | /******************************************************************************* |
117 | * | 188 | * |
118 | * FUNCTION: acpi_db_single_step | 189 | * FUNCTION: acpi_db_single_step |
@@ -134,8 +205,6 @@ acpi_db_single_step(struct acpi_walk_state *walk_state, | |||
134 | union acpi_parse_object *next; | 205 | union acpi_parse_object *next; |
135 | acpi_status status = AE_OK; | 206 | acpi_status status = AE_OK; |
136 | u32 original_debug_level; | 207 | u32 original_debug_level; |
137 | union acpi_parse_object *display_op; | ||
138 | union acpi_parse_object *parent_op; | ||
139 | u32 aml_offset; | 208 | u32 aml_offset; |
140 | 209 | ||
141 | ACPI_FUNCTION_ENTRY(); | 210 | ACPI_FUNCTION_ENTRY(); |
@@ -222,51 +291,12 @@ acpi_db_single_step(struct acpi_walk_state *walk_state, | |||
222 | next = op->common.next; | 291 | next = op->common.next; |
223 | op->common.next = NULL; | 292 | op->common.next = NULL; |
224 | 293 | ||
225 | display_op = op; | ||
226 | parent_op = op->common.parent; | ||
227 | if (parent_op) { | ||
228 | if ((walk_state->control_state) && | ||
229 | (walk_state->control_state->common.state == | ||
230 | ACPI_CONTROL_PREDICATE_EXECUTING)) { | ||
231 | /* | ||
232 | * We are executing the predicate of an IF or WHILE statement | ||
233 | * Search upwards for the containing IF or WHILE so that the | ||
234 | * entire predicate can be displayed. | ||
235 | */ | ||
236 | while (parent_op) { | ||
237 | if ((parent_op->common.aml_opcode == | ||
238 | AML_IF_OP) | ||
239 | || (parent_op->common.aml_opcode == | ||
240 | AML_WHILE_OP)) { | ||
241 | display_op = parent_op; | ||
242 | break; | ||
243 | } | ||
244 | parent_op = parent_op->common.parent; | ||
245 | } | ||
246 | } else { | ||
247 | while (parent_op) { | ||
248 | if ((parent_op->common.aml_opcode == | ||
249 | AML_IF_OP) | ||
250 | || (parent_op->common.aml_opcode == | ||
251 | AML_ELSE_OP) | ||
252 | || (parent_op->common.aml_opcode == | ||
253 | AML_SCOPE_OP) | ||
254 | || (parent_op->common.aml_opcode == | ||
255 | AML_METHOD_OP) | ||
256 | || (parent_op->common.aml_opcode == | ||
257 | AML_WHILE_OP)) { | ||
258 | break; | ||
259 | } | ||
260 | display_op = parent_op; | ||
261 | parent_op = parent_op->common.parent; | ||
262 | } | ||
263 | } | ||
264 | } | ||
265 | |||
266 | /* Now we can disassemble and display it */ | 294 | /* Now we can disassemble and display it */ |
267 | 295 | ||
268 | #ifdef ACPI_DISASSEMBLER | 296 | #ifdef ACPI_DISASSEMBLER |
269 | acpi_dm_disassemble(walk_state, display_op, ACPI_UINT32_MAX); | 297 | acpi_dm_disassemble(walk_state, |
298 | acpi_db_get_display_op(walk_state, op), | ||
299 | ACPI_UINT32_MAX); | ||
270 | #else | 300 | #else |
271 | /* | 301 | /* |
272 | * The AML Disassembler is not configured - at least we can | 302 | * The AML Disassembler is not configured - at least we can |
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index dd4deb678d13..c1a4d02fafd5 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c | |||
@@ -532,6 +532,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
532 | goto cleanup; | 532 | goto cleanup; |
533 | } | 533 | } |
534 | 534 | ||
535 | next_walk_state->method_nesting_depth = | ||
536 | this_walk_state->method_nesting_depth + 1; | ||
537 | |||
535 | /* | 538 | /* |
536 | * Delete the operands on the previous walkstate operand stack | 539 | * Delete the operands on the previous walkstate operand stack |
537 | * (they were copied to new objects) | 540 | * (they were copied to new objects) |
@@ -549,6 +552,17 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
549 | "**** Begin nested execution of [%4.4s] **** WalkState=%p\n", | 552 | "**** Begin nested execution of [%4.4s] **** WalkState=%p\n", |
550 | method_node->name.ascii, next_walk_state)); | 553 | method_node->name.ascii, next_walk_state)); |
551 | 554 | ||
555 | this_walk_state->method_pathname = | ||
556 | acpi_ns_get_normalized_pathname(method_node, TRUE); | ||
557 | this_walk_state->method_is_nested = TRUE; | ||
558 | |||
559 | /* Optional object evaluation log */ | ||
560 | |||
561 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
562 | "%-26s: %*s%s\n", " Nested method call", | ||
563 | next_walk_state->method_nesting_depth * 3, " ", | ||
564 | &this_walk_state->method_pathname[1])); | ||
565 | |||
552 | /* Invoke an internal method if necessary */ | 566 | /* Invoke an internal method if necessary */ |
553 | 567 | ||
554 | if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { | 568 | if (obj_desc->method.info_flags & ACPI_METHOD_INTERNAL_ONLY) { |
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c index 6992c8d5ab43..6a9cc613adaa 100644 --- a/drivers/acpi/acpica/dsobject.c +++ b/drivers/acpi/acpica/dsobject.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #define _COMPONENT ACPI_DISPATCHER | 18 | #define _COMPONENT ACPI_DISPATCHER |
19 | ACPI_MODULE_NAME("dsobject") | 19 | ACPI_MODULE_NAME("dsobject") |
20 | 20 | ||
21 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
22 | /******************************************************************************* | 21 | /******************************************************************************* |
23 | * | 22 | * |
24 | * FUNCTION: acpi_ds_build_internal_object | 23 | * FUNCTION: acpi_ds_build_internal_object |
@@ -299,8 +298,6 @@ acpi_ds_create_node(struct acpi_walk_state *walk_state, | |||
299 | return_ACPI_STATUS(status); | 298 | return_ACPI_STATUS(status); |
300 | } | 299 | } |
301 | 300 | ||
302 | #endif /* ACPI_NO_METHOD_EXECUTION */ | ||
303 | |||
304 | /******************************************************************************* | 301 | /******************************************************************************* |
305 | * | 302 | * |
306 | * FUNCTION: acpi_ds_init_object_from_op | 303 | * FUNCTION: acpi_ds_init_object_from_op |
@@ -404,9 +401,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
404 | 401 | ||
405 | /* Truncate value if we are executing from a 32-bit ACPI table */ | 402 | /* Truncate value if we are executing from a 32-bit ACPI table */ |
406 | 403 | ||
407 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
408 | (void)acpi_ex_truncate_for32bit_table(obj_desc); | 404 | (void)acpi_ex_truncate_for32bit_table(obj_desc); |
409 | #endif | ||
410 | break; | 405 | break; |
411 | 406 | ||
412 | case AML_REVISION_OP: | 407 | case AML_REVISION_OP: |
@@ -428,7 +423,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
428 | 423 | ||
429 | obj_desc->integer.value = op->common.value.integer; | 424 | obj_desc->integer.value = op->common.value.integer; |
430 | 425 | ||
431 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
432 | if (acpi_ex_truncate_for32bit_table(obj_desc)) { | 426 | if (acpi_ex_truncate_for32bit_table(obj_desc)) { |
433 | 427 | ||
434 | /* Warn if we found a 64-bit constant in a 32-bit table */ | 428 | /* Warn if we found a 64-bit constant in a 32-bit table */ |
@@ -439,7 +433,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
439 | value.integer), | 433 | value.integer), |
440 | (u32)obj_desc->integer.value)); | 434 | (u32)obj_desc->integer.value)); |
441 | } | 435 | } |
442 | #endif | ||
443 | break; | 436 | break; |
444 | 437 | ||
445 | default: | 438 | default: |
@@ -477,7 +470,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
477 | ((u32)opcode) - AML_FIRST_LOCAL_OP; | 470 | ((u32)opcode) - AML_FIRST_LOCAL_OP; |
478 | obj_desc->reference.class = ACPI_REFCLASS_LOCAL; | 471 | obj_desc->reference.class = ACPI_REFCLASS_LOCAL; |
479 | 472 | ||
480 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
481 | status = | 473 | status = |
482 | acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL, | 474 | acpi_ds_method_data_get_node(ACPI_REFCLASS_LOCAL, |
483 | obj_desc->reference. | 475 | obj_desc->reference. |
@@ -487,7 +479,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
487 | acpi_namespace_node, | 479 | acpi_namespace_node, |
488 | &obj_desc->reference. | 480 | &obj_desc->reference. |
489 | object)); | 481 | object)); |
490 | #endif | ||
491 | break; | 482 | break; |
492 | 483 | ||
493 | case AML_TYPE_METHOD_ARGUMENT: | 484 | case AML_TYPE_METHOD_ARGUMENT: |
@@ -498,7 +489,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
498 | ((u32)opcode) - AML_FIRST_ARG_OP; | 489 | ((u32)opcode) - AML_FIRST_ARG_OP; |
499 | obj_desc->reference.class = ACPI_REFCLASS_ARG; | 490 | obj_desc->reference.class = ACPI_REFCLASS_ARG; |
500 | 491 | ||
501 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
502 | status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG, | 492 | status = acpi_ds_method_data_get_node(ACPI_REFCLASS_ARG, |
503 | obj_desc-> | 493 | obj_desc-> |
504 | reference.value, | 494 | reference.value, |
@@ -509,7 +499,6 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state, | |||
509 | &obj_desc-> | 499 | &obj_desc-> |
510 | reference. | 500 | reference. |
511 | object)); | 501 | object)); |
512 | #endif | ||
513 | break; | 502 | break; |
514 | 503 | ||
515 | default: /* Object name or Debug object */ | 504 | default: /* Object name or Debug object */ |
diff --git a/drivers/acpi/acpica/dspkginit.c b/drivers/acpi/acpica/dspkginit.c index d703a5594a02..584853385268 100644 --- a/drivers/acpi/acpica/dspkginit.c +++ b/drivers/acpi/acpica/dspkginit.c | |||
@@ -152,6 +152,32 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, | |||
152 | */ | 152 | */ |
153 | for (i = 0; arg && (i < element_count); i++) { | 153 | for (i = 0; arg && (i < element_count); i++) { |
154 | if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { | 154 | if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { |
155 | if (!arg->common.node) { | ||
156 | /* | ||
157 | * This is the case where an expression has returned a value. | ||
158 | * The use of expressions (term_args) within individual | ||
159 | * package elements is not supported by the AML interpreter, | ||
160 | * even though the ASL grammar supports it. Example: | ||
161 | * | ||
162 | * Name (INT1, 0x1234) | ||
163 | * | ||
164 | * Name (PKG3, Package () { | ||
165 | * Add (INT1, 0xAAAA0000) | ||
166 | * }) | ||
167 | * | ||
168 | * 1) No known AML interpreter supports this type of construct | ||
169 | * 2) This fixes a fault if the construct is encountered | ||
170 | */ | ||
171 | ACPI_EXCEPTION((AE_INFO, AE_SUPPORT, | ||
172 | "Expressions within package elements are not supported")); | ||
173 | |||
174 | /* Cleanup the return object, it is not needed */ | ||
175 | |||
176 | acpi_ut_remove_reference(walk_state->results-> | ||
177 | results.obj_desc[0]); | ||
178 | return_ACPI_STATUS(AE_SUPPORT); | ||
179 | } | ||
180 | |||
155 | if (arg->common.node->type == ACPI_TYPE_METHOD) { | 181 | if (arg->common.node->type == ACPI_TYPE_METHOD) { |
156 | /* | 182 | /* |
157 | * A method reference "looks" to the parser to be a method | 183 | * A method reference "looks" to the parser to be a method |
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c index 8d1b75400515..fb9ed5e1da89 100644 --- a/drivers/acpi/acpica/dsutils.c +++ b/drivers/acpi/acpica/dsutils.c | |||
@@ -57,7 +57,6 @@ void acpi_ds_clear_implicit_return(struct acpi_walk_state *walk_state) | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
61 | /******************************************************************************* | 60 | /******************************************************************************* |
62 | * | 61 | * |
63 | * FUNCTION: acpi_ds_do_implicit_return | 62 | * FUNCTION: acpi_ds_do_implicit_return |
@@ -401,7 +400,6 @@ void acpi_ds_clear_operands(struct acpi_walk_state *walk_state) | |||
401 | walk_state->num_operands = 0; | 400 | walk_state->num_operands = 0; |
402 | return_VOID; | 401 | return_VOID; |
403 | } | 402 | } |
404 | #endif | ||
405 | 403 | ||
406 | /******************************************************************************* | 404 | /******************************************************************************* |
407 | * | 405 | * |
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c index d06c41446282..e2ef09643d50 100644 --- a/drivers/acpi/acpica/dswload.c +++ b/drivers/acpi/acpica/dswload.c | |||
@@ -73,12 +73,10 @@ acpi_ds_init_callbacks(struct acpi_walk_state *walk_state, u32 pass_number) | |||
73 | 73 | ||
74 | /* Execution pass */ | 74 | /* Execution pass */ |
75 | 75 | ||
76 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
77 | walk_state->parse_flags |= ACPI_PARSE_EXECUTE | | 76 | walk_state->parse_flags |= ACPI_PARSE_EXECUTE | |
78 | ACPI_PARSE_DELETE_TREE; | 77 | ACPI_PARSE_DELETE_TREE; |
79 | walk_state->descending_callback = acpi_ds_exec_begin_op; | 78 | walk_state->descending_callback = acpi_ds_exec_begin_op; |
80 | walk_state->ascending_callback = acpi_ds_exec_end_op; | 79 | walk_state->ascending_callback = acpi_ds_exec_end_op; |
81 | #endif | ||
82 | break; | 80 | break; |
83 | 81 | ||
84 | default: | 82 | default: |
@@ -364,7 +362,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state *walk_state, | |||
364 | 362 | ||
365 | /* Initialize the op */ | 363 | /* Initialize the op */ |
366 | 364 | ||
367 | #if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)) | 365 | #ifdef ACPI_CONSTANT_EVAL_ONLY |
368 | op->named.path = path; | 366 | op->named.path = path; |
369 | #endif | 367 | #endif |
370 | 368 | ||
@@ -422,7 +420,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) | |||
422 | 420 | ||
423 | object_type = walk_state->op_info->object_type; | 421 | object_type = walk_state->op_info->object_type; |
424 | 422 | ||
425 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
426 | if (walk_state->op_info->flags & AML_FIELD) { | 423 | if (walk_state->op_info->flags & AML_FIELD) { |
427 | /* | 424 | /* |
428 | * If we are executing a method, do not create any namespace objects | 425 | * If we are executing a method, do not create any namespace objects |
@@ -466,7 +463,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state) | |||
466 | } | 463 | } |
467 | } | 464 | } |
468 | } | 465 | } |
469 | #endif | ||
470 | 466 | ||
471 | if (op->common.aml_opcode == AML_NAME_OP) { | 467 | if (op->common.aml_opcode == AML_NAME_OP) { |
472 | 468 | ||
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index b4685bb5f071..9a309f5c4de8 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c | |||
@@ -296,6 +296,14 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, | |||
296 | } | 296 | } |
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | /* | ||
300 | * For name creation opcodes, the full namepath prefix must | ||
301 | * exist, except for the final (new) nameseg. | ||
302 | */ | ||
303 | if (walk_state->op_info->flags & AML_NAMED) { | ||
304 | flags |= ACPI_NS_PREFIX_MUST_EXIST; | ||
305 | } | ||
306 | |||
299 | /* Add new entry or lookup existing entry */ | 307 | /* Add new entry or lookup existing entry */ |
300 | 308 | ||
301 | status = | 309 | status = |
@@ -363,10 +371,8 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) | |||
363 | struct acpi_namespace_node *node; | 371 | struct acpi_namespace_node *node; |
364 | union acpi_parse_object *arg; | 372 | union acpi_parse_object *arg; |
365 | struct acpi_namespace_node *new_node; | 373 | struct acpi_namespace_node *new_node; |
366 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
367 | u32 i; | 374 | u32 i; |
368 | u8 region_space; | 375 | u8 region_space; |
369 | #endif | ||
370 | 376 | ||
371 | ACPI_FUNCTION_TRACE(ds_load2_end_op); | 377 | ACPI_FUNCTION_TRACE(ds_load2_end_op); |
372 | 378 | ||
@@ -453,7 +459,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) | |||
453 | arg = op->common.value.arg; | 459 | arg = op->common.value.arg; |
454 | 460 | ||
455 | switch (walk_state->op_info->type) { | 461 | switch (walk_state->op_info->type) { |
456 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
457 | 462 | ||
458 | case AML_TYPE_CREATE_FIELD: | 463 | case AML_TYPE_CREATE_FIELD: |
459 | /* | 464 | /* |
@@ -550,12 +555,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) | |||
550 | } | 555 | } |
551 | 556 | ||
552 | break; | 557 | break; |
553 | #endif /* ACPI_NO_METHOD_EXECUTION */ | ||
554 | 558 | ||
555 | case AML_TYPE_NAMED_COMPLEX: | 559 | case AML_TYPE_NAMED_COMPLEX: |
556 | 560 | ||
557 | switch (op->common.aml_opcode) { | 561 | switch (op->common.aml_opcode) { |
558 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
559 | case AML_REGION_OP: | 562 | case AML_REGION_OP: |
560 | case AML_DATA_REGION_OP: | 563 | case AML_DATA_REGION_OP: |
561 | 564 | ||
@@ -643,8 +646,6 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state) | |||
643 | } | 646 | } |
644 | break; | 647 | break; |
645 | 648 | ||
646 | #endif /* ACPI_NO_METHOD_EXECUTION */ | ||
647 | |||
648 | default: | 649 | default: |
649 | 650 | ||
650 | /* All NAMED_COMPLEX opcodes must be handled above */ | 651 | /* All NAMED_COMPLEX opcodes must be handled above */ |
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c index c879380e5ce1..4c1ec202d5ab 100644 --- a/drivers/acpi/acpica/dswstate.c +++ b/drivers/acpi/acpica/dswstate.c | |||
@@ -530,7 +530,7 @@ struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id, | |||
530 | 530 | ||
531 | /* Init the method args/local */ | 531 | /* Init the method args/local */ |
532 | 532 | ||
533 | #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) | 533 | #ifndef ACPI_CONSTANT_EVAL_ONLY |
534 | acpi_ds_method_data_init(walk_state); | 534 | acpi_ds_method_data_init(walk_state); |
535 | #endif | 535 | #endif |
536 | 536 | ||
diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c index d319ee33d040..4ed1e67db6be 100644 --- a/drivers/acpi/acpica/evhandler.c +++ b/drivers/acpi/acpica/evhandler.c | |||
@@ -364,25 +364,25 @@ acpi_ev_install_space_handler(struct acpi_namespace_node *node, | |||
364 | handler = acpi_ex_system_io_space_handler; | 364 | handler = acpi_ex_system_io_space_handler; |
365 | setup = acpi_ev_io_space_region_setup; | 365 | setup = acpi_ev_io_space_region_setup; |
366 | break; | 366 | break; |
367 | 367 | #ifdef ACPI_PCI_CONFIGURED | |
368 | case ACPI_ADR_SPACE_PCI_CONFIG: | 368 | case ACPI_ADR_SPACE_PCI_CONFIG: |
369 | 369 | ||
370 | handler = acpi_ex_pci_config_space_handler; | 370 | handler = acpi_ex_pci_config_space_handler; |
371 | setup = acpi_ev_pci_config_region_setup; | 371 | setup = acpi_ev_pci_config_region_setup; |
372 | break; | 372 | break; |
373 | 373 | #endif | |
374 | case ACPI_ADR_SPACE_CMOS: | 374 | case ACPI_ADR_SPACE_CMOS: |
375 | 375 | ||
376 | handler = acpi_ex_cmos_space_handler; | 376 | handler = acpi_ex_cmos_space_handler; |
377 | setup = acpi_ev_cmos_region_setup; | 377 | setup = acpi_ev_cmos_region_setup; |
378 | break; | 378 | break; |
379 | 379 | #ifdef ACPI_PCI_CONFIGURED | |
380 | case ACPI_ADR_SPACE_PCI_BAR_TARGET: | 380 | case ACPI_ADR_SPACE_PCI_BAR_TARGET: |
381 | 381 | ||
382 | handler = acpi_ex_pci_bar_space_handler; | 382 | handler = acpi_ex_pci_bar_space_handler; |
383 | setup = acpi_ev_pci_bar_region_setup; | 383 | setup = acpi_ev_pci_bar_region_setup; |
384 | break; | 384 | break; |
385 | 385 | #endif | |
386 | case ACPI_ADR_SPACE_DATA_TABLE: | 386 | case ACPI_ADR_SPACE_DATA_TABLE: |
387 | 387 | ||
388 | handler = acpi_ex_data_table_space_handler; | 388 | handler = acpi_ex_data_table_space_handler; |
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c index 98de48481776..1a70b80cc406 100644 --- a/drivers/acpi/acpica/exconvrt.c +++ b/drivers/acpi/acpica/exconvrt.c | |||
@@ -323,7 +323,7 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) | |||
323 | 323 | ||
324 | /* hex_length: 2 ascii hex chars per data byte */ | 324 | /* hex_length: 2 ascii hex chars per data byte */ |
325 | 325 | ||
326 | hex_length = ACPI_MUL_2(data_width); | 326 | hex_length = (data_width * 2); |
327 | for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) { | 327 | for (i = 0, j = (hex_length - 1); i < hex_length; i++, j--) { |
328 | 328 | ||
329 | /* Get one hex digit, most significant digits first */ | 329 | /* Get one hex digit, most significant digits first */ |
@@ -364,7 +364,8 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 data_width) | |||
364 | * | 364 | * |
365 | * RETURN: Status | 365 | * RETURN: Status |
366 | * | 366 | * |
367 | * DESCRIPTION: Convert an ACPI Object to a string | 367 | * DESCRIPTION: Convert an ACPI Object to a string. Supports both implicit |
368 | * and explicit conversions and related rules. | ||
368 | * | 369 | * |
369 | ******************************************************************************/ | 370 | ******************************************************************************/ |
370 | 371 | ||
@@ -393,9 +394,11 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, | |||
393 | 394 | ||
394 | switch (type) { | 395 | switch (type) { |
395 | case ACPI_EXPLICIT_CONVERT_DECIMAL: | 396 | case ACPI_EXPLICIT_CONVERT_DECIMAL: |
396 | 397 | /* | |
397 | /* Make room for maximum decimal number */ | 398 | * From to_decimal_string, integer source. |
398 | 399 | * | |
400 | * Make room for the maximum decimal number size | ||
401 | */ | ||
399 | string_length = ACPI_MAX_DECIMAL_DIGITS; | 402 | string_length = ACPI_MAX_DECIMAL_DIGITS; |
400 | base = 10; | 403 | base = 10; |
401 | break; | 404 | break; |
@@ -440,8 +443,10 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, | |||
440 | switch (type) { | 443 | switch (type) { |
441 | case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by to_decimal_string */ | 444 | case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by to_decimal_string */ |
442 | /* | 445 | /* |
443 | * From ACPI: "If Data is a buffer, it is converted to a string of | 446 | * Explicit conversion from the to_decimal_string ASL operator. |
444 | * decimal values separated by commas." | 447 | * |
448 | * From ACPI: "If the input is a buffer, it is converted to a | ||
449 | * a string of decimal values separated by commas." | ||
445 | */ | 450 | */ |
446 | base = 10; | 451 | base = 10; |
447 | 452 | ||
@@ -462,20 +467,29 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, | |||
462 | 467 | ||
463 | case ACPI_IMPLICIT_CONVERT_HEX: | 468 | case ACPI_IMPLICIT_CONVERT_HEX: |
464 | /* | 469 | /* |
470 | * Implicit buffer-to-string conversion | ||
471 | * | ||
465 | * From the ACPI spec: | 472 | * From the ACPI spec: |
466 | *"The entire contents of the buffer are converted to a string of | 473 | * "The entire contents of the buffer are converted to a string of |
467 | * two-character hexadecimal numbers, each separated by a space." | 474 | * two-character hexadecimal numbers, each separated by a space." |
475 | * | ||
476 | * Each hex number is prefixed with 0x (11/2018) | ||
468 | */ | 477 | */ |
469 | separator = ' '; | 478 | separator = ' '; |
470 | string_length = (obj_desc->buffer.length * 3); | 479 | string_length = (obj_desc->buffer.length * 5); |
471 | break; | 480 | break; |
472 | 481 | ||
473 | case ACPI_EXPLICIT_CONVERT_HEX: /* Used by to_hex_string */ | 482 | case ACPI_EXPLICIT_CONVERT_HEX: |
474 | /* | 483 | /* |
484 | * Explicit conversion from the to_hex_string ASL operator. | ||
485 | * | ||
475 | * From ACPI: "If Data is a buffer, it is converted to a string of | 486 | * From ACPI: "If Data is a buffer, it is converted to a string of |
476 | * hexadecimal values separated by commas." | 487 | * hexadecimal values separated by commas." |
488 | * | ||
489 | * Each hex number is prefixed with 0x (11/2018) | ||
477 | */ | 490 | */ |
478 | string_length = (obj_desc->buffer.length * 3); | 491 | separator = ','; |
492 | string_length = (obj_desc->buffer.length * 5); | ||
479 | break; | 493 | break; |
480 | 494 | ||
481 | default: | 495 | default: |
@@ -504,10 +518,21 @@ acpi_ex_convert_to_string(union acpi_operand_object * obj_desc, | |||
504 | * (separated by commas or spaces) | 518 | * (separated by commas or spaces) |
505 | */ | 519 | */ |
506 | for (i = 0; i < obj_desc->buffer.length; i++) { | 520 | for (i = 0; i < obj_desc->buffer.length; i++) { |
521 | if (base == 16) { | ||
522 | |||
523 | /* Emit 0x prefix for explict/implicit hex conversion */ | ||
524 | |||
525 | *new_buf++ = '0'; | ||
526 | *new_buf++ = 'x'; | ||
527 | } | ||
528 | |||
507 | new_buf += acpi_ex_convert_to_ascii((u64) obj_desc-> | 529 | new_buf += acpi_ex_convert_to_ascii((u64) obj_desc-> |
508 | buffer.pointer[i], | 530 | buffer.pointer[i], |
509 | base, new_buf, 1); | 531 | base, new_buf, 1); |
510 | *new_buf++ = separator; /* each separated by a comma or space */ | 532 | |
533 | /* Each digit is separated by either a comma or space */ | ||
534 | |||
535 | *new_buf++ = separator; | ||
511 | } | 536 | } |
512 | 537 | ||
513 | /* | 538 | /* |
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c index e49fa3c1321a..3304c6b1e8a7 100644 --- a/drivers/acpi/acpica/excreate.c +++ b/drivers/acpi/acpica/excreate.c | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | #define _COMPONENT ACPI_EXECUTER | 16 | #define _COMPONENT ACPI_EXECUTER |
17 | ACPI_MODULE_NAME("excreate") | 17 | ACPI_MODULE_NAME("excreate") |
18 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
19 | /******************************************************************************* | 18 | /******************************************************************************* |
20 | * | 19 | * |
21 | * FUNCTION: acpi_ex_create_alias | 20 | * FUNCTION: acpi_ex_create_alias |
@@ -390,7 +389,6 @@ acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state) | |||
390 | acpi_ut_remove_reference(obj_desc); | 389 | acpi_ut_remove_reference(obj_desc); |
391 | return_ACPI_STATUS(status); | 390 | return_ACPI_STATUS(status); |
392 | } | 391 | } |
393 | #endif | ||
394 | 392 | ||
395 | /******************************************************************************* | 393 | /******************************************************************************* |
396 | * | 394 | * |
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c index d5b3efd35a5b..3a477566ba1b 100644 --- a/drivers/acpi/acpica/exoparg2.c +++ b/drivers/acpi/acpica/exoparg2.c | |||
@@ -287,9 +287,9 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state) | |||
287 | * NOTE: A length of zero is ok, and will create a zero-length, null | 287 | * NOTE: A length of zero is ok, and will create a zero-length, null |
288 | * terminated string. | 288 | * terminated string. |
289 | */ | 289 | */ |
290 | while ((length < operand[0]->buffer.length) && | 290 | while ((length < operand[0]->buffer.length) && /* Length of input buffer */ |
291 | (length < operand[1]->integer.value) && | 291 | (length < operand[1]->integer.value) && /* Length operand */ |
292 | (operand[0]->buffer.pointer[length])) { | 292 | (operand[0]->buffer.pointer[length])) { /* Null terminator */ |
293 | length++; | 293 | length++; |
294 | } | 294 | } |
295 | 295 | ||
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c index 97bbfd07fcf7..2c58f5e00b1a 100644 --- a/drivers/acpi/acpica/exregion.c +++ b/drivers/acpi/acpica/exregion.c | |||
@@ -311,6 +311,7 @@ acpi_ex_system_io_space_handler(u32 function, | |||
311 | return_ACPI_STATUS(status); | 311 | return_ACPI_STATUS(status); |
312 | } | 312 | } |
313 | 313 | ||
314 | #ifdef ACPI_PCI_CONFIGURED | ||
314 | /******************************************************************************* | 315 | /******************************************************************************* |
315 | * | 316 | * |
316 | * FUNCTION: acpi_ex_pci_config_space_handler | 317 | * FUNCTION: acpi_ex_pci_config_space_handler |
@@ -387,6 +388,7 @@ acpi_ex_pci_config_space_handler(u32 function, | |||
387 | 388 | ||
388 | return_ACPI_STATUS(status); | 389 | return_ACPI_STATUS(status); |
389 | } | 390 | } |
391 | #endif | ||
390 | 392 | ||
391 | /******************************************************************************* | 393 | /******************************************************************************* |
392 | * | 394 | * |
@@ -420,6 +422,7 @@ acpi_ex_cmos_space_handler(u32 function, | |||
420 | return_ACPI_STATUS(status); | 422 | return_ACPI_STATUS(status); |
421 | } | 423 | } |
422 | 424 | ||
425 | #ifdef ACPI_PCI_CONFIGURED | ||
423 | /******************************************************************************* | 426 | /******************************************************************************* |
424 | * | 427 | * |
425 | * FUNCTION: acpi_ex_pci_bar_space_handler | 428 | * FUNCTION: acpi_ex_pci_bar_space_handler |
@@ -451,6 +454,7 @@ acpi_ex_pci_bar_space_handler(u32 function, | |||
451 | 454 | ||
452 | return_ACPI_STATUS(status); | 455 | return_ACPI_STATUS(status); |
453 | } | 456 | } |
457 | #endif | ||
454 | 458 | ||
455 | /******************************************************************************* | 459 | /******************************************************************************* |
456 | * | 460 | * |
diff --git a/drivers/acpi/acpica/exserial.c b/drivers/acpi/acpica/exserial.c index 9920fac6413f..ec61553c4483 100644 --- a/drivers/acpi/acpica/exserial.c +++ b/drivers/acpi/acpica/exserial.c | |||
@@ -244,6 +244,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc, | |||
244 | { | 244 | { |
245 | acpi_status status; | 245 | acpi_status status; |
246 | u32 buffer_length; | 246 | u32 buffer_length; |
247 | u32 data_length; | ||
247 | void *buffer; | 248 | void *buffer; |
248 | union acpi_operand_object *buffer_desc; | 249 | union acpi_operand_object *buffer_desc; |
249 | u32 function; | 250 | u32 function; |
@@ -324,8 +325,9 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc, | |||
324 | /* Copy the input buffer data to the transfer buffer */ | 325 | /* Copy the input buffer data to the transfer buffer */ |
325 | 326 | ||
326 | buffer = buffer_desc->buffer.pointer; | 327 | buffer = buffer_desc->buffer.pointer; |
327 | memcpy(buffer, source_desc->buffer.pointer, | 328 | data_length = (buffer_length < source_desc->buffer.length ? |
328 | min(buffer_length, source_desc->buffer.length)); | 329 | buffer_length : source_desc->buffer.length); |
330 | memcpy(buffer, source_desc->buffer.pointer, data_length); | ||
329 | 331 | ||
330 | /* Lock entire transaction if requested */ | 332 | /* Lock entire transaction if requested */ |
331 | 333 | ||
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c index 6ce307d5ce2a..bd22e27adf9b 100644 --- a/drivers/acpi/acpica/exutils.c +++ b/drivers/acpi/acpica/exutils.c | |||
@@ -34,7 +34,6 @@ ACPI_MODULE_NAME("exutils") | |||
34 | /* Local prototypes */ | 34 | /* Local prototypes */ |
35 | static u32 acpi_ex_digits_needed(u64 value, u32 base); | 35 | static u32 acpi_ex_digits_needed(u64 value, u32 base); |
36 | 36 | ||
37 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
38 | /******************************************************************************* | 37 | /******************************************************************************* |
39 | * | 38 | * |
40 | * FUNCTION: acpi_ex_enter_interpreter | 39 | * FUNCTION: acpi_ex_enter_interpreter |
@@ -409,5 +408,3 @@ u8 acpi_is_valid_space_id(u8 space_id) | |||
409 | 408 | ||
410 | return (TRUE); | 409 | return (TRUE); |
411 | } | 410 | } |
412 | |||
413 | #endif | ||
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c index e3f10afde5ff..75192b958544 100644 --- a/drivers/acpi/acpica/nsaccess.c +++ b/drivers/acpi/acpica/nsaccess.c | |||
@@ -267,6 +267,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
267 | acpi_object_type this_search_type; | 267 | acpi_object_type this_search_type; |
268 | u32 search_parent_flag = ACPI_NS_SEARCH_PARENT; | 268 | u32 search_parent_flag = ACPI_NS_SEARCH_PARENT; |
269 | u32 local_flags; | 269 | u32 local_flags; |
270 | acpi_interpreter_mode local_interpreter_mode; | ||
270 | 271 | ||
271 | ACPI_FUNCTION_TRACE(ns_lookup); | 272 | ACPI_FUNCTION_TRACE(ns_lookup); |
272 | 273 | ||
@@ -506,6 +507,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
506 | */ | 507 | */ |
507 | this_search_type = ACPI_TYPE_ANY; | 508 | this_search_type = ACPI_TYPE_ANY; |
508 | current_node = this_node; | 509 | current_node = this_node; |
510 | |||
509 | while (num_segments && current_node) { | 511 | while (num_segments && current_node) { |
510 | num_segments--; | 512 | num_segments--; |
511 | if (!num_segments) { | 513 | if (!num_segments) { |
@@ -536,6 +538,16 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
536 | } | 538 | } |
537 | } | 539 | } |
538 | 540 | ||
541 | /* Handle opcodes that create a new name_seg via a full name_path */ | ||
542 | |||
543 | local_interpreter_mode = interpreter_mode; | ||
544 | if ((flags & ACPI_NS_PREFIX_MUST_EXIST) && (num_segments > 0)) { | ||
545 | |||
546 | /* Every element of the path must exist (except for the final name_seg) */ | ||
547 | |||
548 | local_interpreter_mode = ACPI_IMODE_EXECUTE; | ||
549 | } | ||
550 | |||
539 | /* Extract one ACPI name from the front of the pathname */ | 551 | /* Extract one ACPI name from the front of the pathname */ |
540 | 552 | ||
541 | ACPI_MOVE_32_TO_32(&simple_name, path); | 553 | ACPI_MOVE_32_TO_32(&simple_name, path); |
@@ -544,12 +556,19 @@ acpi_ns_lookup(union acpi_generic_state *scope_info, | |||
544 | 556 | ||
545 | status = | 557 | status = |
546 | acpi_ns_search_and_enter(simple_name, walk_state, | 558 | acpi_ns_search_and_enter(simple_name, walk_state, |
547 | current_node, interpreter_mode, | 559 | current_node, |
560 | local_interpreter_mode, | ||
548 | this_search_type, local_flags, | 561 | this_search_type, local_flags, |
549 | &this_node); | 562 | &this_node); |
550 | if (ACPI_FAILURE(status)) { | 563 | if (ACPI_FAILURE(status)) { |
551 | if (status == AE_NOT_FOUND) { | 564 | if (status == AE_NOT_FOUND) { |
552 | 565 | #if !defined ACPI_ASL_COMPILER /* Note: iASL reports this error by itself, not needed here */ | |
566 | if (flags & ACPI_NS_PREFIX_MUST_EXIST) { | ||
567 | acpi_os_printf(ACPI_MSG_BIOS_ERROR | ||
568 | "Object does not exist: %4.4s\n", | ||
569 | &simple_name); | ||
570 | } | ||
571 | #endif | ||
553 | /* Name not found in ACPI namespace */ | 572 | /* Name not found in ACPI namespace */ |
554 | 573 | ||
555 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, | 574 | ACPI_DEBUG_PRINT((ACPI_DB_NAMES, |
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c index 64ba80ede0ad..6390b7951ebf 100644 --- a/drivers/acpi/acpica/nseval.c +++ b/drivers/acpi/acpica/nseval.c | |||
@@ -104,6 +104,13 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info) | |||
104 | return_ACPI_STATUS(AE_NO_MEMORY); | 104 | return_ACPI_STATUS(AE_NO_MEMORY); |
105 | } | 105 | } |
106 | 106 | ||
107 | /* Optional object evaluation log */ | ||
108 | |||
109 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
110 | "%-26s: %s (%s)\n", " Enter evaluation", | ||
111 | &info->full_pathname[1], | ||
112 | acpi_ut_get_type_name(info->node->type))); | ||
113 | |||
107 | /* Count the number of arguments being passed in */ | 114 | /* Count the number of arguments being passed in */ |
108 | 115 | ||
109 | info->param_count = 0; | 116 | info->param_count = 0; |
@@ -289,6 +296,12 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info) | |||
289 | info->relative_pathname)); | 296 | info->relative_pathname)); |
290 | 297 | ||
291 | cleanup: | 298 | cleanup: |
299 | /* Optional object evaluation log */ | ||
300 | |||
301 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
302 | "%-26s: %s\n", " Exit evaluation", | ||
303 | &info->full_pathname[1])); | ||
304 | |||
292 | /* | 305 | /* |
293 | * Namespace was unlocked by the handling acpi_ns* function, so we | 306 | * Namespace was unlocked by the handling acpi_ns* function, so we |
294 | * just free the pathname and return | 307 | * just free the pathname and return |
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c index e291bb8cd369..04bc73e82aed 100644 --- a/drivers/acpi/acpica/nsload.c +++ b/drivers/acpi/acpica/nsload.c | |||
@@ -24,7 +24,6 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle); | |||
24 | static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); | 24 | static acpi_status acpi_ns_delete_subtree(acpi_handle start_handle); |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #ifndef ACPI_NO_METHOD_EXECUTION | ||
28 | /******************************************************************************* | 27 | /******************************************************************************* |
29 | * | 28 | * |
30 | * FUNCTION: acpi_ns_load_table | 29 | * FUNCTION: acpi_ns_load_table |
@@ -297,4 +296,3 @@ acpi_status acpi_ns_unload_namespace(acpi_handle handle) | |||
297 | return_ACPI_STATUS(status); | 296 | return_ACPI_STATUS(status); |
298 | } | 297 | } |
299 | #endif | 298 | #endif |
300 | #endif | ||
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c index c9ef4949869f..488ff39d86f7 100644 --- a/drivers/acpi/acpica/nsparse.c +++ b/drivers/acpi/acpica/nsparse.c | |||
@@ -107,8 +107,20 @@ acpi_ns_execute_table(u32 table_index, struct acpi_namespace_node *start_node) | |||
107 | goto cleanup; | 107 | goto cleanup; |
108 | } | 108 | } |
109 | 109 | ||
110 | /* Optional object evaluation log */ | ||
111 | |||
112 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
113 | "%-26s: (Definition Block level)\n", | ||
114 | "Module-level evaluation")); | ||
115 | |||
110 | status = acpi_ps_execute_table(info); | 116 | status = acpi_ps_execute_table(info); |
111 | 117 | ||
118 | /* Optional object evaluation log */ | ||
119 | |||
120 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
121 | "%-26s: (Definition Block level)\n", | ||
122 | "Module-level complete")); | ||
123 | |||
112 | cleanup: | 124 | cleanup: |
113 | if (info) { | 125 | if (info) { |
114 | ACPI_FREE(info->full_pathname); | 126 | ACPI_FREE(info->full_pathname); |
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c index 0fa01c9e353e..e00d1af6fa80 100644 --- a/drivers/acpi/acpica/psloop.c +++ b/drivers/acpi/acpica/psloop.c | |||
@@ -428,7 +428,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
428 | parser_state = &walk_state->parser_state; | 428 | parser_state = &walk_state->parser_state; |
429 | walk_state->arg_types = 0; | 429 | walk_state->arg_types = 0; |
430 | 430 | ||
431 | #if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) | 431 | #ifndef ACPI_CONSTANT_EVAL_ONLY |
432 | 432 | ||
433 | if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) { | 433 | if (walk_state->walk_type & ACPI_WALK_METHOD_RESTART) { |
434 | 434 | ||
@@ -508,7 +508,8 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
508 | */ | 508 | */ |
509 | if ((walk_state-> | 509 | if ((walk_state-> |
510 | parse_flags & ACPI_PARSE_MODULE_LEVEL) | 510 | parse_flags & ACPI_PARSE_MODULE_LEVEL) |
511 | && status == AE_ALREADY_EXISTS) { | 511 | && ((status == AE_ALREADY_EXISTS) |
512 | || (status == AE_NOT_FOUND))) { | ||
512 | status = AE_OK; | 513 | status = AE_OK; |
513 | } | 514 | } |
514 | if (status == AE_CTRL_PARSE_CONTINUE) { | 515 | if (status == AE_CTRL_PARSE_CONTINUE) { |
@@ -537,10 +538,7 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state) | |||
537 | * the scope op because the parse failure indicates that | 538 | * the scope op because the parse failure indicates that |
538 | * the device may not exist. | 539 | * the device may not exist. |
539 | */ | 540 | */ |
540 | ACPI_ERROR((AE_INFO, | 541 | ACPI_INFO(("Skipping parse of AML opcode: %s (0x%4.4X)", acpi_ps_get_opcode_name(walk_state->opcode), walk_state->opcode)); |
541 | "Skip parsing opcode %s", | ||
542 | acpi_ps_get_opcode_name | ||
543 | (walk_state->opcode))); | ||
544 | 542 | ||
545 | /* | 543 | /* |
546 | * Determine the opcode length before skipping the opcode. | 544 | * Determine the opcode length before skipping the opcode. |
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c index 3138e7a00da8..e1fd819a2955 100644 --- a/drivers/acpi/acpica/psobject.c +++ b/drivers/acpi/acpica/psobject.c | |||
@@ -600,8 +600,7 @@ acpi_ps_complete_op(struct acpi_walk_state *walk_state, | |||
600 | * because there could be correct AML beyond the parts that caused | 600 | * because there could be correct AML beyond the parts that caused |
601 | * the runtime error. | 601 | * the runtime error. |
602 | */ | 602 | */ |
603 | ACPI_ERROR((AE_INFO, | 603 | ACPI_INFO(("Ignoring error and continuing table load")); |
604 | "Ignore error and continue table load")); | ||
605 | return_ACPI_STATUS(AE_OK); | 604 | return_ACPI_STATUS(AE_OK); |
606 | } | 605 | } |
607 | return_ACPI_STATUS(status); | 606 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c index a16a6ea5ae02..65603473b6cb 100644 --- a/drivers/acpi/acpica/psparse.c +++ b/drivers/acpi/acpica/psparse.c | |||
@@ -479,6 +479,21 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
479 | "Completed one call to walk loop, %s State=%p\n", | 479 | "Completed one call to walk loop, %s State=%p\n", |
480 | acpi_format_exception(status), walk_state)); | 480 | acpi_format_exception(status), walk_state)); |
481 | 481 | ||
482 | if (walk_state->method_pathname && walk_state->method_is_nested) { | ||
483 | |||
484 | /* Optional object evaluation log */ | ||
485 | |||
486 | ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION, | ||
487 | "%-26s: %*s%s\n", | ||
488 | " Exit nested method", | ||
489 | (walk_state-> | ||
490 | method_nesting_depth + 1) * 3, | ||
491 | " ", | ||
492 | &walk_state->method_pathname[1])); | ||
493 | |||
494 | ACPI_FREE(walk_state->method_pathname); | ||
495 | walk_state->method_is_nested = FALSE; | ||
496 | } | ||
482 | if (status == AE_CTRL_TRANSFER) { | 497 | if (status == AE_CTRL_TRANSFER) { |
483 | /* | 498 | /* |
484 | * A method call was detected. | 499 | * A method call was detected. |
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c index f26bcbbc2c27..5743b22399a0 100644 --- a/drivers/acpi/acpica/psxface.c +++ b/drivers/acpi/acpica/psxface.c | |||
@@ -147,6 +147,9 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) | |||
147 | goto cleanup; | 147 | goto cleanup; |
148 | } | 148 | } |
149 | 149 | ||
150 | walk_state->method_pathname = info->full_pathname; | ||
151 | walk_state->method_is_nested = FALSE; | ||
152 | |||
150 | if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { | 153 | if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { |
151 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; | 154 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; |
152 | } | 155 | } |
@@ -267,6 +270,9 @@ acpi_status acpi_ps_execute_table(struct acpi_evaluate_info *info) | |||
267 | goto cleanup; | 270 | goto cleanup; |
268 | } | 271 | } |
269 | 272 | ||
273 | walk_state->method_pathname = info->full_pathname; | ||
274 | walk_state->method_is_nested = FALSE; | ||
275 | |||
270 | if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { | 276 | if (info->obj_desc->method.info_flags & ACPI_METHOD_MODULE_LEVEL) { |
271 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; | 277 | walk_state->parse_flags |= ACPI_PARSE_MODULE_LEVEL; |
272 | } | 278 | } |
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c index fa674e9b0e62..f8c5b49344df 100644 --- a/drivers/acpi/acpica/utglobal.c +++ b/drivers/acpi/acpica/utglobal.c | |||
@@ -83,10 +83,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = { | |||
83 | {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR(char, 2)}, | 83 | {"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR(char, 2)}, |
84 | {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, | 84 | {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, |
85 | {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR(char, 1)}, | 85 | {"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR(char, 1)}, |
86 | |||
87 | #if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) | ||
88 | {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR(char, 1)}, | 86 | {"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR(char, 1)}, |
89 | #endif | ||
90 | 87 | ||
91 | /* Table terminator */ | 88 | /* Table terminator */ |
92 | 89 | ||
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c index ed73d79b500e..afaadc73196b 100644 --- a/drivers/acpi/acpica/utmisc.c +++ b/drivers/acpi/acpica/utmisc.c | |||
@@ -62,7 +62,8 @@ u8 acpi_ut_is_aml_table(struct acpi_table_header *table) | |||
62 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) || | 62 | if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) || |
63 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) || | 63 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) || |
64 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT) || | 64 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT) || |
65 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT)) { | 65 | ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) || |
66 | ACPI_IS_OEM_SIG(table->signature)) { | ||
66 | return (TRUE); | 67 | return (TRUE); |
67 | } | 68 | } |
68 | 69 | ||
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c index 64b63c81994b..902a47463abf 100644 --- a/drivers/acpi/acpica/utosi.c +++ b/drivers/acpi/acpica/utosi.c | |||
@@ -70,6 +70,8 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = { | |||
70 | {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */ | 70 | {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */ |
71 | {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ | 71 | {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ |
72 | {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */ | 72 | {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */ |
73 | {"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */ | ||
74 | {"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */ | ||
73 | 75 | ||
74 | /* Feature Group Strings */ | 76 | /* Feature Group Strings */ |
75 | 77 | ||
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index b38737c83a24..fcccbfdbdd1a 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c | |||
@@ -607,17 +607,7 @@ static int available_error_type_show(struct seq_file *m, void *v) | |||
607 | return 0; | 607 | return 0; |
608 | } | 608 | } |
609 | 609 | ||
610 | static int available_error_type_open(struct inode *inode, struct file *file) | 610 | DEFINE_SHOW_ATTRIBUTE(available_error_type); |
611 | { | ||
612 | return single_open(file, available_error_type_show, NULL); | ||
613 | } | ||
614 | |||
615 | static const struct file_operations available_error_type_fops = { | ||
616 | .open = available_error_type_open, | ||
617 | .read = seq_read, | ||
618 | .llseek = seq_lseek, | ||
619 | .release = single_release, | ||
620 | }; | ||
621 | 611 | ||
622 | static int error_type_get(void *data, u64 *val) | 612 | static int error_type_get(void *data, u64 *val) |
623 | { | 613 | { |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 02c6fd9caff7..f008ba7c9ced 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -691,6 +691,8 @@ static void __ghes_panic(struct ghes *ghes) | |||
691 | { | 691 | { |
692 | __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus); | 692 | __ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus); |
693 | 693 | ||
694 | ghes_clear_estatus(ghes); | ||
695 | |||
694 | /* reboot to log the error! */ | 696 | /* reboot to log the error! */ |
695 | if (!panic_timeout) | 697 | if (!panic_timeout) |
696 | panic_timeout = ghes_panic_timeout; | 698 | panic_timeout = ghes_panic_timeout; |
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 70f4e80b9246..2159ad9bf9ed 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c | |||
@@ -1435,8 +1435,14 @@ dev_put: | |||
1435 | return ret; | 1435 | return ret; |
1436 | } | 1436 | } |
1437 | 1437 | ||
1438 | static bool __init iort_enable_acs(struct acpi_iort_node *iort_node) | 1438 | #ifdef CONFIG_PCI |
1439 | static void __init iort_enable_acs(struct acpi_iort_node *iort_node) | ||
1439 | { | 1440 | { |
1441 | static bool acs_enabled __initdata; | ||
1442 | |||
1443 | if (acs_enabled) | ||
1444 | return; | ||
1445 | |||
1440 | if (iort_node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) { | 1446 | if (iort_node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) { |
1441 | struct acpi_iort_node *parent; | 1447 | struct acpi_iort_node *parent; |
1442 | struct acpi_iort_id_mapping *map; | 1448 | struct acpi_iort_id_mapping *map; |
@@ -1458,13 +1464,15 @@ static bool __init iort_enable_acs(struct acpi_iort_node *iort_node) | |||
1458 | if ((parent->type == ACPI_IORT_NODE_SMMU) || | 1464 | if ((parent->type == ACPI_IORT_NODE_SMMU) || |
1459 | (parent->type == ACPI_IORT_NODE_SMMU_V3)) { | 1465 | (parent->type == ACPI_IORT_NODE_SMMU_V3)) { |
1460 | pci_request_acs(); | 1466 | pci_request_acs(); |
1461 | return true; | 1467 | acs_enabled = true; |
1468 | return; | ||
1462 | } | 1469 | } |
1463 | } | 1470 | } |
1464 | } | 1471 | } |
1465 | |||
1466 | return false; | ||
1467 | } | 1472 | } |
1473 | #else | ||
1474 | static inline void iort_enable_acs(struct acpi_iort_node *iort_node) { } | ||
1475 | #endif | ||
1468 | 1476 | ||
1469 | static void __init iort_init_platform_devices(void) | 1477 | static void __init iort_init_platform_devices(void) |
1470 | { | 1478 | { |
@@ -1472,7 +1480,6 @@ static void __init iort_init_platform_devices(void) | |||
1472 | struct acpi_table_iort *iort; | 1480 | struct acpi_table_iort *iort; |
1473 | struct fwnode_handle *fwnode; | 1481 | struct fwnode_handle *fwnode; |
1474 | int i, ret; | 1482 | int i, ret; |
1475 | bool acs_enabled = false; | ||
1476 | const struct iort_dev_config *ops; | 1483 | const struct iort_dev_config *ops; |
1477 | 1484 | ||
1478 | /* | 1485 | /* |
@@ -1493,8 +1500,7 @@ static void __init iort_init_platform_devices(void) | |||
1493 | return; | 1500 | return; |
1494 | } | 1501 | } |
1495 | 1502 | ||
1496 | if (!acs_enabled) | 1503 | iort_enable_acs(iort_node); |
1497 | acs_enabled = iort_enable_acs(iort_node); | ||
1498 | 1504 | ||
1499 | ops = iort_get_dev_cfg(iort_node); | 1505 | ops = iort_get_dev_cfg(iort_node); |
1500 | if (ops) { | 1506 | if (ops) { |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index f59d0b9e2683..c112dccc76b5 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -25,8 +25,13 @@ int acpi_osi_init(void); | |||
25 | acpi_status acpi_os_initialize1(void); | 25 | acpi_status acpi_os_initialize1(void); |
26 | void init_acpi_device_notify(void); | 26 | void init_acpi_device_notify(void); |
27 | int acpi_scan_init(void); | 27 | int acpi_scan_init(void); |
28 | #ifdef CONFIG_PCI | ||
28 | void acpi_pci_root_init(void); | 29 | void acpi_pci_root_init(void); |
29 | void acpi_pci_link_init(void); | 30 | void acpi_pci_link_init(void); |
31 | #else | ||
32 | static inline void acpi_pci_root_init(void) {} | ||
33 | static inline void acpi_pci_link_init(void) {} | ||
34 | #endif | ||
30 | void acpi_processor_init(void); | 35 | void acpi_processor_init(void); |
31 | void acpi_platform_init(void); | 36 | void acpi_platform_init(void); |
32 | void acpi_pnp_init(void); | 37 | void acpi_pnp_init(void); |
diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c index b2a16ed7e81a..efd2ce099893 100644 --- a/drivers/acpi/osi.c +++ b/drivers/acpi/osi.c | |||
@@ -74,6 +74,13 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { | |||
74 | * a BIOS workaround. | 74 | * a BIOS workaround. |
75 | */ | 75 | */ |
76 | {"Linux-Lenovo-NV-HDMI-Audio", true}, | 76 | {"Linux-Lenovo-NV-HDMI-Audio", true}, |
77 | /* | ||
78 | * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to | ||
79 | * output video directly to external monitors on HP Inc. mobile | ||
80 | * workstations as Nvidia and AMD VGA drivers provide limited | ||
81 | * hybrid graphics supports. | ||
82 | */ | ||
83 | {"Linux-HPI-Hybrid-Graphics", true}, | ||
77 | }; | 84 | }; |
78 | 85 | ||
79 | static u32 acpi_osi_handler(acpi_string interface, u32 supported) | 86 | static u32 acpi_osi_handler(acpi_string interface, u32 supported) |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index b48874b8e1ea..f29e427d0d1d 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -769,6 +769,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u64 value, u32 width) | |||
769 | return AE_OK; | 769 | return AE_OK; |
770 | } | 770 | } |
771 | 771 | ||
772 | #ifdef CONFIG_PCI | ||
772 | acpi_status | 773 | acpi_status |
773 | acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, | 774 | acpi_os_read_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, |
774 | u64 *value, u32 width) | 775 | u64 *value, u32 width) |
@@ -827,6 +828,7 @@ acpi_os_write_pci_configuration(struct acpi_pci_id * pci_id, u32 reg, | |||
827 | 828 | ||
828 | return (result ? AE_ERROR : AE_OK); | 829 | return (result ? AE_ERROR : AE_OK); |
829 | } | 830 | } |
831 | #endif | ||
830 | 832 | ||
831 | static void acpi_os_execute_deferred(struct work_struct *work) | 833 | static void acpi_os_execute_deferred(struct work_struct *work) |
832 | { | 834 | { |
diff --git a/drivers/acpi/reboot.c b/drivers/acpi/reboot.c index 6fa9c2a4cfe9..ca707f5b521d 100644 --- a/drivers/acpi/reboot.c +++ b/drivers/acpi/reboot.c | |||
@@ -4,11 +4,35 @@ | |||
4 | #include <linux/acpi.h> | 4 | #include <linux/acpi.h> |
5 | #include <acpi/reboot.h> | 5 | #include <acpi/reboot.h> |
6 | 6 | ||
7 | #ifdef CONFIG_PCI | ||
8 | static void acpi_pci_reboot(struct acpi_generic_address *rr, u8 reset_value) | ||
9 | { | ||
10 | unsigned int devfn; | ||
11 | struct pci_bus *bus0; | ||
12 | |||
13 | /* The reset register can only live on bus 0. */ | ||
14 | bus0 = pci_find_bus(0, 0); | ||
15 | if (!bus0) | ||
16 | return; | ||
17 | /* Form PCI device/function pair. */ | ||
18 | devfn = PCI_DEVFN((rr->address >> 32) & 0xffff, | ||
19 | (rr->address >> 16) & 0xffff); | ||
20 | pr_debug("Resetting with ACPI PCI RESET_REG.\n"); | ||
21 | /* Write the value that resets us. */ | ||
22 | pci_bus_write_config_byte(bus0, devfn, | ||
23 | (rr->address & 0xffff), reset_value); | ||
24 | } | ||
25 | #else | ||
26 | static inline void acpi_pci_reboot(struct acpi_generic_address *rr, | ||
27 | u8 reset_value) | ||
28 | { | ||
29 | pr_warn_once("PCI configuration space access is not supported\n"); | ||
30 | } | ||
31 | #endif | ||
32 | |||
7 | void acpi_reboot(void) | 33 | void acpi_reboot(void) |
8 | { | 34 | { |
9 | struct acpi_generic_address *rr; | 35 | struct acpi_generic_address *rr; |
10 | struct pci_bus *bus0; | ||
11 | unsigned int devfn; | ||
12 | u8 reset_value; | 36 | u8 reset_value; |
13 | 37 | ||
14 | if (acpi_disabled) | 38 | if (acpi_disabled) |
@@ -33,17 +57,7 @@ void acpi_reboot(void) | |||
33 | * on a device on bus 0. */ | 57 | * on a device on bus 0. */ |
34 | switch (rr->space_id) { | 58 | switch (rr->space_id) { |
35 | case ACPI_ADR_SPACE_PCI_CONFIG: | 59 | case ACPI_ADR_SPACE_PCI_CONFIG: |
36 | /* The reset register can only live on bus 0. */ | 60 | acpi_pci_reboot(rr, reset_value); |
37 | bus0 = pci_find_bus(0, 0); | ||
38 | if (!bus0) | ||
39 | return; | ||
40 | /* Form PCI device/function pair. */ | ||
41 | devfn = PCI_DEVFN((rr->address >> 32) & 0xffff, | ||
42 | (rr->address >> 16) & 0xffff); | ||
43 | printk(KERN_DEBUG "Resetting with ACPI PCI RESET_REG.\n"); | ||
44 | /* Write the value that resets us. */ | ||
45 | pci_bus_write_config_byte(bus0, devfn, | ||
46 | (rr->address & 0xffff), reset_value); | ||
47 | break; | 61 | break; |
48 | 62 | ||
49 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: | 63 | case ACPI_ADR_SPACE_SYSTEM_MEMORY: |
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 9d52743080a4..c336784d0bcb 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c | |||
@@ -148,6 +148,13 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | switch (table->baud_rate) { | 150 | switch (table->baud_rate) { |
151 | case 0: | ||
152 | /* | ||
153 | * SPCR 1.04 defines 0 as a preconfigured state of UART. | ||
154 | * Assume firmware or bootloader configures console correctly. | ||
155 | */ | ||
156 | baud_rate = 0; | ||
157 | break; | ||
151 | case 3: | 158 | case 3: |
152 | baud_rate = 9600; | 159 | baud_rate = 9600; |
153 | break; | 160 | break; |
@@ -196,6 +203,10 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) | |||
196 | * UART so don't attempt to change to the baud rate state | 203 | * UART so don't attempt to change to the baud rate state |
197 | * in the table because driver cannot calculate the dividers | 204 | * in the table because driver cannot calculate the dividers |
198 | */ | 205 | */ |
206 | baud_rate = 0; | ||
207 | } | ||
208 | |||
209 | if (!baud_rate) { | ||
199 | snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype, | 210 | snprintf(opts, sizeof(opts), "%s,%s,0x%llx", uart, iotype, |
200 | table->serial_port.address); | 211 | table->serial_port.address); |
201 | } else { | 212 | } else { |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 61203eebf3a1..48eabb6c2d4f 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -712,6 +712,11 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table, | |||
712 | table_length); | 712 | table_length); |
713 | } | 713 | } |
714 | 714 | ||
715 | #ifdef CONFIG_ACPI_CUSTOM_DSDT | ||
716 | static void *amlcode __attribute__ ((weakref("AmlCode"))); | ||
717 | static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code"))); | ||
718 | #endif | ||
719 | |||
715 | acpi_status | 720 | acpi_status |
716 | acpi_os_table_override(struct acpi_table_header *existing_table, | 721 | acpi_os_table_override(struct acpi_table_header *existing_table, |
717 | struct acpi_table_header **new_table) | 722 | struct acpi_table_header **new_table) |
@@ -722,8 +727,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table, | |||
722 | *new_table = NULL; | 727 | *new_table = NULL; |
723 | 728 | ||
724 | #ifdef CONFIG_ACPI_CUSTOM_DSDT | 729 | #ifdef CONFIG_ACPI_CUSTOM_DSDT |
725 | if (strncmp(existing_table->signature, "DSDT", 4) == 0) | 730 | if (!strncmp(existing_table->signature, "DSDT", 4)) { |
726 | *new_table = (struct acpi_table_header *)AmlCode; | 731 | *new_table = (struct acpi_table_header *)&amlcode; |
732 | if (!(*new_table)) | ||
733 | *new_table = (struct acpi_table_header *)&dsdt_amlcode; | ||
734 | } | ||
727 | #endif | 735 | #endif |
728 | if (*new_table != NULL) | 736 | if (*new_table != NULL) |
729 | acpi_table_taint(existing_table); | 737 | acpi_table_taint(existing_table); |
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile index f2bda77a2df1..657d642fcc67 100644 --- a/drivers/pci/Makefile +++ b/drivers/pci/Makefile | |||
@@ -11,6 +11,7 @@ ifdef CONFIG_PCI | |||
11 | obj-$(CONFIG_PROC_FS) += proc.o | 11 | obj-$(CONFIG_PROC_FS) += proc.o |
12 | obj-$(CONFIG_SYSFS) += slot.o | 12 | obj-$(CONFIG_SYSFS) += slot.o |
13 | obj-$(CONFIG_OF) += of.o | 13 | obj-$(CONFIG_OF) += of.o |
14 | obj-$(CONFIG_ACPI) += pci-acpi.o | ||
14 | endif | 15 | endif |
15 | 16 | ||
16 | obj-$(CONFIG_PCI_QUIRKS) += quirks.o | 17 | obj-$(CONFIG_PCI_QUIRKS) += quirks.o |
@@ -20,7 +21,6 @@ obj-$(CONFIG_PCI_MSI) += msi.o | |||
20 | obj-$(CONFIG_PCI_ATS) += ats.o | 21 | obj-$(CONFIG_PCI_ATS) += ats.o |
21 | obj-$(CONFIG_PCI_IOV) += iov.o | 22 | obj-$(CONFIG_PCI_IOV) += iov.o |
22 | obj-$(CONFIG_PCI_BRIDGE_EMUL) += pci-bridge-emul.o | 23 | obj-$(CONFIG_PCI_BRIDGE_EMUL) += pci-bridge-emul.o |
23 | obj-$(CONFIG_ACPI) += pci-acpi.o | ||
24 | obj-$(CONFIG_PCI_LABEL) += pci-label.o | 24 | obj-$(CONFIG_PCI_LABEL) += pci-label.o |
25 | obj-$(CONFIG_X86_INTEL_MID) += pci-mid.o | 25 | obj-$(CONFIG_X86_INTEL_MID) += pci-mid.o |
26 | obj-$(CONFIG_PCI_SYSCALL) += syscall.o | 26 | obj-$(CONFIG_PCI_SYSCALL) += syscall.o |
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 3a26aa7ead23..6db9a6d40c85 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -73,7 +73,8 @@ | |||
73 | #define ACPI_LV_RESOURCES 0x00010000 | 73 | #define ACPI_LV_RESOURCES 0x00010000 |
74 | #define ACPI_LV_USER_REQUESTS 0x00020000 | 74 | #define ACPI_LV_USER_REQUESTS 0x00020000 |
75 | #define ACPI_LV_PACKAGE 0x00040000 | 75 | #define ACPI_LV_PACKAGE 0x00040000 |
76 | #define ACPI_LV_VERBOSITY1 0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS | 76 | #define ACPI_LV_EVALUATION 0x00080000 |
77 | #define ACPI_LV_VERBOSITY1 0x000FFF40 | ACPI_LV_ALL_EXCEPTIONS | ||
77 | 78 | ||
78 | /* Trace verbosity level 2 [Function tracing and memory allocation] */ | 79 | /* Trace verbosity level 2 [Function tracing and memory allocation] */ |
79 | 80 | ||
@@ -141,6 +142,7 @@ | |||
141 | #define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS) | 142 | #define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS) |
142 | #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) | 143 | #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) |
143 | #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) | 144 | #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) |
145 | #define ACPI_DB_EVALUATION ACPI_DEBUG_LEVEL (ACPI_LV_EVALUATION) | ||
144 | #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) | 146 | #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) |
145 | #define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS) | 147 | #define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS) |
146 | 148 | ||
@@ -148,7 +150,7 @@ | |||
148 | 150 | ||
149 | /* Defaults for debug_level, debug and normal */ | 151 | /* Defaults for debug_level, debug and normal */ |
150 | 152 | ||
151 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) | 153 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_EVALUATION | ACPI_LV_REPAIR) |
152 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) | 154 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) |
153 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) | 155 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) |
154 | 156 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 14499757338f..de1804aeaf69 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -88,7 +88,14 @@ int acpi_pci_link_free_irq(acpi_handle handle); | |||
88 | 88 | ||
89 | struct pci_bus; | 89 | struct pci_bus; |
90 | 90 | ||
91 | #ifdef CONFIG_PCI | ||
91 | struct pci_dev *acpi_get_pci_dev(acpi_handle); | 92 | struct pci_dev *acpi_get_pci_dev(acpi_handle); |
93 | #else | ||
94 | static inline struct pci_dev *acpi_get_pci_dev(acpi_handle handle) | ||
95 | { | ||
96 | return NULL; | ||
97 | } | ||
98 | #endif | ||
92 | 99 | ||
93 | /* Arch-defined function to add a bus to the system */ | 100 | /* Arch-defined function to add a bus to the system */ |
94 | 101 | ||
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 0c19b68bf060..7aa38b648564 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -12,7 +12,7 @@ | |||
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 0x20181003 | 15 | #define ACPI_CA_VERSION 0x20181213 |
16 | 16 | ||
17 | #include <acpi/acconfig.h> | 17 | #include <acpi/acconfig.h> |
18 | #include <acpi/actypes.h> | 18 | #include <acpi/actypes.h> |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 517addd6b11d..0a977eca0a74 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */ | 38 | #define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */ |
39 | #define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */ | 39 | #define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */ |
40 | #define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */ | 40 | #define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */ |
41 | #define ACPI_OEM_NAME "OEM" /* Short name for OEM, not signature */ | ||
41 | 42 | ||
42 | /* | 43 | /* |
43 | * All tables and structures must be byte-packed to match the ACPI | 44 | * All tables and structures must be byte-packed to match the ACPI |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 501f341d1d92..ea1ca49c9c1b 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
@@ -365,6 +365,29 @@ struct acpi_table_tcpa_server { | |||
365 | * | 365 | * |
366 | ******************************************************************************/ | 366 | ******************************************************************************/ |
367 | 367 | ||
368 | /* Revision 3 */ | ||
369 | |||
370 | struct acpi_table_tpm23 { | ||
371 | struct acpi_table_header header; /* Common ACPI table header */ | ||
372 | u32 reserved; | ||
373 | u64 control_address; | ||
374 | u32 start_method; | ||
375 | }; | ||
376 | |||
377 | /* Value for start_method above */ | ||
378 | |||
379 | #define ACPI_TPM23_ACPI_START_METHOD 2 | ||
380 | |||
381 | /* | ||
382 | * Optional trailer for revision 3. If start method is 2, there is a 4 byte | ||
383 | * reserved area of all zeros. | ||
384 | */ | ||
385 | struct acpi_tmp23_trailer { | ||
386 | u32 reserved; | ||
387 | }; | ||
388 | |||
389 | /* Revision 4 */ | ||
390 | |||
368 | struct acpi_table_tpm2 { | 391 | struct acpi_table_tpm2 { |
369 | struct acpi_table_header header; /* Common ACPI table header */ | 392 | struct acpi_table_header header; /* Common ACPI table header */ |
370 | u16 platform_class; | 393 | u16 platform_class; |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 66ceb12ebc63..2590627dbfcc 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -527,6 +527,10 @@ typedef u64 acpi_integer; | |||
527 | #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) | 527 | #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) |
528 | #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) | 528 | #define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) |
529 | 529 | ||
530 | /* Support for OEMx signature (x can be any character) */ | ||
531 | #define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\ | ||
532 | strnlen (a, ACPI_NAME_SIZE) == ACPI_NAME_SIZE) | ||
533 | |||
530 | /* | 534 | /* |
531 | * Algorithm to obtain access bit width. | 535 | * Algorithm to obtain access bit width. |
532 | * Can be used with access_width of struct acpi_generic_address and access_size of | 536 | * Can be used with access_width of struct acpi_generic_address and access_size of |
@@ -1273,6 +1277,8 @@ typedef enum { | |||
1273 | #define ACPI_OSI_WIN_10_RS1 0x0E | 1277 | #define ACPI_OSI_WIN_10_RS1 0x0E |
1274 | #define ACPI_OSI_WIN_10_RS2 0x0F | 1278 | #define ACPI_OSI_WIN_10_RS2 0x0F |
1275 | #define ACPI_OSI_WIN_10_RS3 0x10 | 1279 | #define ACPI_OSI_WIN_10_RS3 0x10 |
1280 | #define ACPI_OSI_WIN_10_RS4 0x11 | ||
1281 | #define ACPI_OSI_WIN_10_RS5 0x12 | ||
1276 | 1282 | ||
1277 | /* Definitions of getopt */ | 1283 | /* Definitions of getopt */ |
1278 | 1284 | ||
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 7451b3bca83a..e3d21d014fcc 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -33,6 +33,10 @@ | |||
33 | 33 | ||
34 | /* Kernel specific ACPICA configuration */ | 34 | /* Kernel specific ACPICA configuration */ |
35 | 35 | ||
36 | #ifdef CONFIG_PCI | ||
37 | #define ACPI_PCI_CONFIGURED | ||
38 | #endif | ||
39 | |||
36 | #ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY | 40 | #ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY |
37 | #define ACPI_REDUCED_HARDWARE 1 | 41 | #define ACPI_REDUCED_HARDWARE 1 |
38 | #endif | 42 | #endif |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 6afc6e3c4c5c..4b3283cb09ab 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -101,7 +101,7 @@ static inline bool has_acpi_companion(struct device *dev) | |||
101 | static inline void acpi_preset_companion(struct device *dev, | 101 | static inline void acpi_preset_companion(struct device *dev, |
102 | struct acpi_device *parent, u64 addr) | 102 | struct acpi_device *parent, u64 addr) |
103 | { | 103 | { |
104 | ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL)); | 104 | ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, false)); |
105 | } | 105 | } |
106 | 106 | ||
107 | static inline const char *acpi_dev_name(struct acpi_device *adev) | 107 | static inline const char *acpi_dev_name(struct acpi_device *adev) |
@@ -340,7 +340,14 @@ struct pci_dev; | |||
340 | int acpi_pci_irq_enable (struct pci_dev *dev); | 340 | int acpi_pci_irq_enable (struct pci_dev *dev); |
341 | void acpi_penalize_isa_irq(int irq, int active); | 341 | void acpi_penalize_isa_irq(int irq, int active); |
342 | bool acpi_isa_irq_available(int irq); | 342 | bool acpi_isa_irq_available(int irq); |
343 | #ifdef CONFIG_PCI | ||
343 | void acpi_penalize_sci_irq(int irq, int trigger, int polarity); | 344 | void acpi_penalize_sci_irq(int irq, int trigger, int polarity); |
345 | #else | ||
346 | static inline void acpi_penalize_sci_irq(int irq, int trigger, | ||
347 | int polarity) | ||
348 | { | ||
349 | } | ||
350 | #endif | ||
344 | void acpi_pci_irq_disable (struct pci_dev *dev); | 351 | void acpi_pci_irq_disable (struct pci_dev *dev); |
345 | 352 | ||
346 | extern int ec_read(u8 addr, u8 *val); | 353 | extern int ec_read(u8 addr, u8 *val); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 11c71c4ecf75..51a5a5217667 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -1960,7 +1960,11 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev, | |||
1960 | enum pcie_reset_state state); | 1960 | enum pcie_reset_state state); |
1961 | int pcibios_add_device(struct pci_dev *dev); | 1961 | int pcibios_add_device(struct pci_dev *dev); |
1962 | void pcibios_release_device(struct pci_dev *dev); | 1962 | void pcibios_release_device(struct pci_dev *dev); |
1963 | #ifdef CONFIG_PCI | ||
1963 | void pcibios_penalize_isa_irq(int irq, int active); | 1964 | void pcibios_penalize_isa_irq(int irq, int active); |
1965 | #else | ||
1966 | static inline void pcibios_penalize_isa_irq(int irq, int active) {} | ||
1967 | #endif | ||
1964 | int pcibios_alloc_irq(struct pci_dev *dev); | 1968 | int pcibios_alloc_irq(struct pci_dev *dev); |
1965 | void pcibios_free_irq(struct pci_dev *dev); | 1969 | void pcibios_free_irq(struct pci_dev *dev); |
1966 | resource_size_t pcibios_default_alignment(void); | 1970 | resource_size_t pcibios_default_alignment(void); |
diff --git a/tools/power/acpi/tools/acpidump/apmain.c b/tools/power/acpi/tools/acpidump/apmain.c index db213171f8d9..2d9b94b631cb 100644 --- a/tools/power/acpi/tools/acpidump/apmain.c +++ b/tools/power/acpi/tools/acpidump/apmain.c | |||
@@ -106,7 +106,7 @@ static int ap_insert_action(char *argument, u32 to_be_done) | |||
106 | 106 | ||
107 | current_action++; | 107 | current_action++; |
108 | if (current_action > AP_MAX_ACTIONS) { | 108 | if (current_action > AP_MAX_ACTIONS) { |
109 | fprintf(stderr, "Too many table options (max %u)\n", | 109 | fprintf(stderr, "Too many table options (max %d)\n", |
110 | AP_MAX_ACTIONS); | 110 | AP_MAX_ACTIONS); |
111 | return (-1); | 111 | return (-1); |
112 | } | 112 | } |