History

Merge branches 'acpi-mm', 'acpi-tables', 'acpi-apei' and 'acpi-misc'

* acpi-mm: ACPI: OSL: Clean up the removal of unused memory mappings ACPI: OSL: Use deferred unmapping in acpi_os_unmap_iomem() ACPI: OSL: Use deferred unmapping in acpi_os_unmap_generic_address() ACPICA: Preserve memory opregion mappings ACPI: OSL: Implement deferred unmapping of ACPI memory * acpi-tables: ACPI: NUMA: Remove the useless 'node >= MAX_NUMNODES' check ACPI: NUMA: Remove the useless sub table pointer check ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array() ACPI: tables: avoid relocations for table signature array * acpi-apei: ACPI: APEI: remove redundant assignment to variable rc * acpi-misc: ACPI: Replace HTTP links with HTTPS ones ACPI: Use valid link to the ACPI specification ACPI: Use fallthrough pseudo-keyword

Rafael J. Wysocki committed 6 years ago

Commit db1da2f5 parents 3fa5faf 5003ad7 5b1e802 eb27e5a 4ce779626 files · +139 −115Browse files

Unified · Split

26 files
  1. Documentation/firmware-guide/acpi/DSD-properties-rules.rst +2 −2
  2. Documentation/firmware-guide/acpi/dsd/data-node-references.rst +2 −2
  3. Documentation/firmware-guide/acpi/dsd/graph.rst +5 −5
  4. Documentation/firmware-guide/acpi/dsd/leds.rst +3 −3
  5. Documentation/firmware-guide/acpi/lpit.rst +1 −1
  6. Documentation/hwmon/acpi_power_meter.rst +1 −1
  7. drivers/acpi/Kconfig +2 −3
  8. drivers/acpi/ac.c +1 −1
  9. drivers/acpi/acpi_processor.c +1 −1
  10. drivers/acpi/acpica/evrgnini.c +8 −6
  11. drivers/acpi/acpica/exregion.c +46 −18
  12. drivers/acpi/apei/hest.c +1 −1
  13. drivers/acpi/button.c +1 −1
  14. drivers/acpi/dock.c +1 −1
  15. drivers/acpi/evged.c +1 −1
  16. drivers/acpi/nfit/nfit.h +1 −1
  17. drivers/acpi/numa/srat.c +1 −9
  18. drivers/acpi/osl.c +36 −27
  19. drivers/acpi/processor_idle.c +1 −2
  20. drivers/acpi/resource.c +1 −1
  21. drivers/acpi/spcr.c +2 −2
  22. drivers/acpi/tables.c +7 −18
  23. drivers/pci/pci-acpi.c +3 −3
  24. include/acpi/actypes.h +9 −3
  25. include/linux/tboot.h +1 −1
  26. tools/power/cpupower/man/cpupower-idle-info.1 +1 −1
Documentation/firmware-guide/acpi/DSD-properties-rules.rst+2−2
@@ -96,5 +96,5 @@ contents. · 95 unmodified lines
96References96References
97==========97==========
98 98
99.. [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf99.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
100.. [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf100.. [2] https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
Documentation/firmware-guide/acpi/dsd/data-node-references.rst+2−2
@@ -85,9 +85,9 @@ References · 84 unmodified lines
85==========85==========
86 86
87[1] Hierarchical Data Extension UUID For _DSD.87[1] Hierarchical Data Extension UUID For _DSD.
88<http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,88<https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
89referenced 2018-07-17.89referenced 2018-07-17.
90 90
91[2] Device Properties UUID For _DSD.91[2] Device Properties UUID For _DSD.
92<http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,92<https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
93referenced 2016-10-04.93referenced 2016-10-04.
Documentation/firmware-guide/acpi/dsd/graph.rst+5−5
@@ -154,23 +154,23 @@ References · 153 unmodified lines
154==========154==========
155 155
156[1] _DSD (Device Specific Data) Implementation Guide.156[1] _DSD (Device Specific Data) Implementation Guide.
157 http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,157 https://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,
158 referenced 2016-10-03.158 referenced 2016-10-03.
159 159
160[2] Devicetree. http://www.devicetree.org, referenced 2016-10-03.160[2] Devicetree. https://www.devicetree.org, referenced 2016-10-03.
161 161
162[3] Documentation/devicetree/bindings/graph.txt162[3] Documentation/devicetree/bindings/graph.txt
163 163
164[4] Device Properties UUID For _DSD.164[4] Device Properties UUID For _DSD.
165 http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,165 https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
166 referenced 2016-10-04.166 referenced 2016-10-04.
167 167
168[5] Hierarchical Data Extension UUID For _DSD.168[5] Hierarchical Data Extension UUID For _DSD.
169 http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,169 https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
170 referenced 2016-10-04.170 referenced 2016-10-04.
171 171
172[6] Advanced Configuration and Power Interface Specification.172[6] Advanced Configuration and Power Interface Specification.
173 http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,173 https://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,
174 referenced 2016-10-04.174 referenced 2016-10-04.
175 175
176[7] _DSD Device Properties Usage Rules.176[7] _DSD Device Properties Usage Rules.
Documentation/firmware-guide/acpi/dsd/leds.rst+3−3
@@ -90,7 +90,7 @@ where · 89 unmodified lines
90References90References
91==========91==========
92 92
93[1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.93[1] Device tree. <URL:https://www.devicetree.org>, referenced 2019-02-21.
94 94
95[2] Advanced Configuration and Power Interface Specification.95[2] Advanced Configuration and Power Interface Specification.
96 <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,96 <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,
@@ -101,11 +101,11 @@ References · 4 unmodified lines
101[4] Documentation/devicetree/bindings/media/video-interfaces.txt101[4] Documentation/devicetree/bindings/media/video-interfaces.txt
102 102
103[5] Device Properties UUID For _DSD.103[5] Device Properties UUID For _DSD.
104 <URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,104 <URL:https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
105 referenced 2019-02-21.105 referenced 2019-02-21.
106 106
107[6] Hierarchical Data Extension UUID For _DSD.107[6] Hierarchical Data Extension UUID For _DSD.
108 <URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,108 <URL:https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
109 referenced 2019-02-21.109 referenced 2019-02-21.
110 110
111[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst111[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
Documentation/firmware-guide/acpi/lpit.rst+1−1
@@ -7,7 +7,7 @@ Low Power Idle Table (LPIT) · 6 unmodified lines
7To enumerate platform Low Power Idle states, Intel platforms are using7To enumerate platform Low Power Idle states, Intel platforms are using
8“Low Power Idle Table” (LPIT). More details about this table can be8“Low Power Idle Table” (LPIT). More details about this table can be
9downloaded from:9downloaded from:
10http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf10https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
11 11
12Residencies for each low power state can be read via FFH12Residencies for each low power state can be read via FFH
13(Function fixed hardware) or a memory mapped interface.13(Function fixed hardware) or a memory mapped interface.
Documentation/hwmon/acpi_power_meter.rst+1−1
@@ -9,7 +9,7 @@ Supported systems: · 8 unmodified lines
9 9
10 Prefix: 'power_meter'10 Prefix: 'power_meter'
11 11
12 Datasheet: http://acpi.info/, section 10.4.12 Datasheet: https://uefi.org/specifications, section 10.4.
13 13
14Author: Darrick J. Wong14Author: Darrick J. Wong
15 15
drivers/acpi/Kconfig+2−3
@@ -32,7 +32,7 @@ menuconfig ACPI · 31 unmodified lines
32 Linux support for ACPI is based on Intel Corporation's ACPI32 Linux support for ACPI is based on Intel Corporation's ACPI
33 Component Architecture (ACPI CA). For more information on the33 Component Architecture (ACPI CA). For more information on the
34 ACPI CA, see:34 ACPI CA, see:
35 <http://acpica.org/>35 <https://acpica.org/>
36 36
37 ACPI is an open industry specification originally co-developed by37 ACPI is an open industry specification originally co-developed by
38 Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,38 Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,
@@ -40,8 +40,7 @@ menuconfig ACPI · 1 unmodified line
40 the UEFI Forum and any UEFI member can join the ASWG and contribute40 the UEFI Forum and any UEFI member can join the ASWG and contribute
41 to the ACPI specification.41 to the ACPI specification.
42 The specification is available at:42 The specification is available at:
43 <http://www.acpi.info>43 <https://uefi.org/specifications>
44 <http://www.uefi.org/acpi/specs>
45 44
46if ACPI45if ACPI
47 46
drivers/acpi/ac.c+1−1
@@ -155,7 +155,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event) · 154 unmodified lines
155 default:155 default:
156 ACPI_DEBUG_PRINT((ACPI_DB_INFO,156 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
157 "Unsupported event [0x%x]\n", event));157 "Unsupported event [0x%x]\n", event));
158 /* fall through */158 fallthrough;
159 case ACPI_AC_NOTIFY_STATUS:159 case ACPI_AC_NOTIFY_STATUS:
160 case ACPI_NOTIFY_BUS_CHECK:160 case ACPI_NOTIFY_BUS_CHECK:
161 case ACPI_NOTIFY_DEVICE_CHECK:161 case ACPI_NOTIFY_DEVICE_CHECK:
drivers/acpi/acpi_processor.c+1−1
@@ -79,7 +79,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) · 78 unmodified lines
79 * PIIX4 models.79 * PIIX4 models.
80 */80 */
81 errata.piix4.throttle = 1;81 errata.piix4.throttle = 1;
82 /* fall through*/82 fallthrough;
83 83
84 case 2: /* PIIX4E */84 case 2: /* PIIX4E */
85 case 3: /* PIIX4M */85 case 3: /* PIIX4M */
drivers/acpi/acpica/evrgnini.c+8−6
@@ -38,6 +38,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, · 37 unmodified lines
38 union acpi_operand_object *region_desc =38 union acpi_operand_object *region_desc =
39 (union acpi_operand_object *)handle;39 (union acpi_operand_object *)handle;
40 struct acpi_mem_space_context *local_region_context;40 struct acpi_mem_space_context *local_region_context;
41 struct acpi_mem_mapping *mm;
41 42
42 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);43 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);
43 44
@@ -46,13 +47,14 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, · 2 unmodified lines
46 local_region_context =47 local_region_context =
47 (struct acpi_mem_space_context *)*region_context;48 (struct acpi_mem_space_context *)*region_context;
48 49
49 /* Delete a cached mapping if present */50 /* Delete memory mappings if present */
50 51
51 if (local_region_context->mapped_length) {52 while (local_region_context->first_mm) {
52 acpi_os_unmap_memory(local_region_context->53 mm = local_region_context->first_mm;
53 mapped_logical_address,54 local_region_context->first_mm = mm->next_mm;
54 local_region_context->55 acpi_os_unmap_memory(mm->logical_address,
55 mapped_length);56 mm->length);
57 ACPI_FREE(mm);
56 }58 }
57 ACPI_FREE(local_region_context);59 ACPI_FREE(local_region_context);
58 *region_context = NULL;60 *region_context = NULL;
drivers/acpi/acpica/exregion.c+46−18
@@ -41,6 +41,7 @@ acpi_ex_system_memory_space_handler(u32 function, · 40 unmodified lines
41 acpi_status status = AE_OK;41 acpi_status status = AE_OK;
42 void *logical_addr_ptr = NULL;42 void *logical_addr_ptr = NULL;
43 struct acpi_mem_space_context *mem_info = region_context;43 struct acpi_mem_space_context *mem_info = region_context;
44 struct acpi_mem_mapping *mm = mem_info->cur_mm;
44 u32 length;45 u32 length;
45 acpi_size map_length;46 acpi_size map_length;
46 acpi_size page_boundary_map_length;47 acpi_size page_boundary_map_length;
@@ -96,20 +97,37 @@ acpi_ex_system_memory_space_handler(u32 function, · 49 unmodified lines
96 * Is 1) Address below the current mapping? OR97 * Is 1) Address below the current mapping? OR
97 * 2) Address beyond the current mapping?98 * 2) Address beyond the current mapping?
98 */99 */
99 if ((address < mem_info->mapped_physical_address) ||100 if (!mm || (address < mm->physical_address) ||
100 (((u64) address + length) > ((u64)101 ((u64) address + length > (u64) mm->physical_address + mm->length)) {
101 mem_info->mapped_physical_address +
102 mem_info->mapped_length))) {
103 /*102 /*
104 * The request cannot be resolved by the current memory mapping;103 * The request cannot be resolved by the current memory mapping.
105 * Delete the existing mapping and create a new one.104 *
105 * Look for an existing saved mapping covering the address range
106 * at hand. If found, save it as the current one and carry out
107 * the access.
106 */108 */
107 if (mem_info->mapped_length) {109 for (mm = mem_info->first_mm; mm; mm = mm->next_mm) {
110 if (mm == mem_info->cur_mm)
111 continue;
112
113 if (address < mm->physical_address)
114 continue;
108 115
109 /* Valid mapping, delete it */116 if ((u64) address + length >
117 (u64) mm->physical_address + mm->length)
118 continue;
110 119
111 acpi_os_unmap_memory(mem_info->mapped_logical_address,120 mem_info->cur_mm = mm;
112 mem_info->mapped_length);121 goto access;
122 }
123
124 /* Create a new mappings list entry */
125 mm = ACPI_ALLOCATE_ZEROED(sizeof(*mm));
126 if (!mm) {
127 ACPI_ERROR((AE_INFO,
128 "Unable to save memory mapping at 0x%8.8X%8.8X, size %u",
129 ACPI_FORMAT_UINT64(address), length));
130 return_ACPI_STATUS(AE_NO_MEMORY);
113 }131 }
114 132
115 /*133 /*
@@ -143,29 +161,39 @@ acpi_ex_system_memory_space_handler(u32 function, · 27 unmodified lines
143 161
144 /* Create a new mapping starting at the address given */162 /* Create a new mapping starting at the address given */
145 163
146 mem_info->mapped_logical_address =164 logical_addr_ptr = acpi_os_map_memory(address, map_length);
147 acpi_os_map_memory(address, map_length);165 if (!logical_addr_ptr) {
148 if (!mem_info->mapped_logical_address) {
149 ACPI_ERROR((AE_INFO,166 ACPI_ERROR((AE_INFO,
150 "Could not map memory at 0x%8.8X%8.8X, size %u",167 "Could not map memory at 0x%8.8X%8.8X, size %u",
151 ACPI_FORMAT_UINT64(address),168 ACPI_FORMAT_UINT64(address),
152 (u32)map_length));169 (u32)map_length));
153 mem_info->mapped_length = 0;170 ACPI_FREE(mm);
154 return_ACPI_STATUS(AE_NO_MEMORY);171 return_ACPI_STATUS(AE_NO_MEMORY);
155 }172 }
156 173
157 /* Save the physical address and mapping size */174 /* Save the physical address and mapping size */
158 175
159 mem_info->mapped_physical_address = address;176 mm->logical_address = logical_addr_ptr;
160 mem_info->mapped_length = map_length;177 mm->physical_address = address;
178 mm->length = map_length;
179
180 /*
181 * Add the new entry to the mappigs list and save it as the
182 * current mapping.
183 */
184 mm->next_mm = mem_info->first_mm;
185 mem_info->first_mm = mm;
186
187 mem_info->cur_mm = mm;
161 }188 }
162 189
190access:
163 /*191 /*
164 * Generate a logical pointer corresponding to the address we want to192 * Generate a logical pointer corresponding to the address we want to
165 * access193 * access
166 */194 */
167 logical_addr_ptr = mem_info->mapped_logical_address +195 logical_addr_ptr = mm->logical_address +
168 ((u64) address - (u64) mem_info->mapped_physical_address);196 ((u64) address - (u64) mm->physical_address);
169 197
170 ACPI_DEBUG_PRINT((ACPI_DB_INFO,198 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
171 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",199 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
drivers/acpi/apei/hest.c+1−1
@@ -227,7 +227,7 @@ __setup("hest_disable", setup_hest_disable); · 226 unmodified lines
227void __init acpi_hest_init(void)227void __init acpi_hest_init(void)
228{228{
229 acpi_status status;229 acpi_status status;
230 int rc = -ENODEV;230 int rc;
231 unsigned int ghes_count = 0;231 unsigned int ghes_count = 0;
232 232
233 if (hest_disable) {233 if (hest_disable) {
drivers/acpi/button.c+1−1
@@ -405,7 +405,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) · 404 unmodified lines
405 switch (event) {405 switch (event) {
406 case ACPI_FIXED_HARDWARE_EVENT:406 case ACPI_FIXED_HARDWARE_EVENT:
407 event = ACPI_BUTTON_NOTIFY_STATUS;407 event = ACPI_BUTTON_NOTIFY_STATUS;
408 /* fall through */408 fallthrough;
409 case ACPI_BUTTON_NOTIFY_STATUS:409 case ACPI_BUTTON_NOTIFY_STATUS:
410 input = button->input;410 input = button->input;
411 if (button->type == ACPI_BUTTON_TYPE_LID) {411 if (button->type == ACPI_BUTTON_TYPE_LID) {
drivers/acpi/dock.c+1−1
@@ -469,7 +469,7 @@ int dock_notify(struct acpi_device *adev, u32 event) · 468 unmodified lines
469 surprise_removal = 1;469 surprise_removal = 1;
470 event = ACPI_NOTIFY_EJECT_REQUEST;470 event = ACPI_NOTIFY_EJECT_REQUEST;
471 /* Fall back */471 /* Fall back */
472 /* fall through */472 fallthrough;
473 case ACPI_NOTIFY_EJECT_REQUEST:473 case ACPI_NOTIFY_EJECT_REQUEST:
474 begin_undock(ds);474 begin_undock(ds);
475 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))475 if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))
drivers/acpi/evged.c+1−1
@@ -106,7 +106,7 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares, · 105 unmodified lines
106 106
107 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))107 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
108 break;108 break;
109 /* fall through */109 fallthrough;
110 default:110 default:
111 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))111 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
112 break;112 break;
drivers/acpi/nfit/nfit.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
16/* ACPI 6.1 */16/* ACPI 6.1 */
17#define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"17#define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"
18 18
19/* http://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */19/* https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
20#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"20#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"
21 21
22/* https://github.com/HewlettPackard/hpe-nvm/blob/master/Documentation/ */22/* https://github.com/HewlettPackard/hpe-nvm/blob/master/Documentation/ */
drivers/acpi/numa/srat.c+1−9
@@ -230,7 +230,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) · 229 unmodified lines
230 pxm &= 0xff;230 pxm &= 0xff;
231 231
232 node = acpi_map_pxm_to_node(pxm);232 node = acpi_map_pxm_to_node(pxm);
233 if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {233 if (node == NUMA_NO_NODE) {
234 pr_err("SRAT: Too many proximity domains.\n");234 pr_err("SRAT: Too many proximity domains.\n");
235 goto out_err_bad_srat;235 goto out_err_bad_srat;
236 }236 }
@@ -291,8 +291,6 @@ acpi_parse_x2apic_affinity(union acpi_subtable_headers *header, · 54 unmodified lines
291 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;291 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
292 292
293 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;293 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
294 if (!processor_affinity)
295 return -EINVAL;
296 294
297 acpi_table_print_srat_entry(&header->common);295 acpi_table_print_srat_entry(&header->common);
298 296
@@ -309,8 +307,6 @@ acpi_parse_processor_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
309 struct acpi_srat_cpu_affinity *processor_affinity;307 struct acpi_srat_cpu_affinity *processor_affinity;
310 308
311 processor_affinity = (struct acpi_srat_cpu_affinity *)header;309 processor_affinity = (struct acpi_srat_cpu_affinity *)header;
312 if (!processor_affinity)
313 return -EINVAL;
314 310
315 acpi_table_print_srat_entry(&header->common);311 acpi_table_print_srat_entry(&header->common);
316 312
@@ -327,8 +323,6 @@ acpi_parse_gicc_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
327 struct acpi_srat_gicc_affinity *processor_affinity;323 struct acpi_srat_gicc_affinity *processor_affinity;
328 324
329 processor_affinity = (struct acpi_srat_gicc_affinity *)header;325 processor_affinity = (struct acpi_srat_gicc_affinity *)header;
330 if (!processor_affinity)
331 return -EINVAL;
332 326
333 acpi_table_print_srat_entry(&header->common);327 acpi_table_print_srat_entry(&header->common);
334 328
@@ -347,8 +341,6 @@ acpi_parse_memory_affinity(union acpi_subtable_headers * header, · 12 unmodified lines
347 struct acpi_srat_mem_affinity *memory_affinity;341 struct acpi_srat_mem_affinity *memory_affinity;
348 342
349 memory_affinity = (struct acpi_srat_mem_affinity *)header;343 memory_affinity = (struct acpi_srat_mem_affinity *)header;
350 if (!memory_affinity)
351 return -EINVAL;
352 344
353 acpi_table_print_srat_entry(&header->common);345 acpi_table_print_srat_entry(&header->common);
354 346
drivers/acpi/osl.c+36−27
@@ -77,7 +77,10 @@ struct acpi_ioremap { · 76 unmodified lines
77 void __iomem *virt;77 void __iomem *virt;
78 acpi_physical_address phys;78 acpi_physical_address phys;
79 acpi_size size;79 acpi_size size;
80 unsigned long refcount;80 union {
81 unsigned long refcount;
82 struct rcu_work rwork;
83 } track;
81};84};
82 85
83static LIST_HEAD(acpi_ioremaps);86static LIST_HEAD(acpi_ioremaps);
@@ -250,7 +253,7 @@ void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size) · 166 unmodified lines
250 map = acpi_map_lookup(phys, size);253 map = acpi_map_lookup(phys, size);
251 if (map) {254 if (map) {
252 virt = map->virt + (phys - map->phys);255 virt = map->virt + (phys - map->phys);
253 map->refcount++;256 map->track.refcount++;
254 }257 }
255 mutex_unlock(&acpi_ioremap_lock);258 mutex_unlock(&acpi_ioremap_lock);
256 return virt;259 return virt;
@@ -335,7 +338,7 @@ void __iomem __ref · 78 unmodified lines
335 /* Check if there's a suitable mapping already. */338 /* Check if there's a suitable mapping already. */
336 map = acpi_map_lookup(phys, size);339 map = acpi_map_lookup(phys, size);
337 if (map) {340 if (map) {
338 map->refcount++;341 map->track.refcount++;
339 goto out;342 goto out;
340 }343 }
341 344
@@ -358,7 +361,7 @@ void __iomem __ref · 16 unmodified lines
358 map->virt = virt;361 map->virt = virt;
359 map->phys = pg_off;362 map->phys = pg_off;
360 map->size = pg_sz;363 map->size = pg_sz;
361 map->refcount = 1;364 map->track.refcount = 1;
362 365
363 list_add_tail_rcu(&map->list, &acpi_ioremaps);366 list_add_tail_rcu(&map->list, &acpi_ioremaps);
364 367
@@ -374,21 +377,26 @@ void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) · 9 unmodified lines
374}377}
375EXPORT_SYMBOL_GPL(acpi_os_map_memory);378EXPORT_SYMBOL_GPL(acpi_os_map_memory);
376 379
377/* Must be called with mutex_lock(&acpi_ioremap_lock) */380static void acpi_os_map_remove(struct work_struct *work)
378static unsigned long acpi_os_drop_map_ref(struct acpi_ioremap *map)
379{381{
380 unsigned long refcount = --map->refcount;382 struct acpi_ioremap *map = container_of(to_rcu_work(work),
383 struct acpi_ioremap,
384 track.rwork);
381 385
382 if (!refcount)386 acpi_unmap(map->phys, map->virt);
383 list_del_rcu(&map->list);387 kfree(map);
384 return refcount;
385}388}
386 389
387static void acpi_os_map_cleanup(struct acpi_ioremap *map)390/* Must be called with mutex_lock(&acpi_ioremap_lock) */
391static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
388{392{
389 synchronize_rcu_expedited();393 if (--map->track.refcount)
390 acpi_unmap(map->phys, map->virt);394 return;
391 kfree(map);395
396 list_del_rcu(&map->list);
397
398 INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove);
399 queue_rcu_work(system_wq, &map->track.rwork);
392}400}
393 401
394/**402/**
@@ -397,8 +405,8 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) · 2 unmodified lines
397 * @size: Size of the address range to drop a reference to.405 * @size: Size of the address range to drop a reference to.
398 *406 *
399 * Look up the given virtual address range in the list of existing ACPI memory407 * Look up the given virtual address range in the list of existing ACPI memory
400 * mappings, drop a reference to it and unmap it if there are no more active408 * mappings, drop a reference to it and if there are no more active references
401 * references to it.409 * to it, queue it up for later removal.
402 *410 *
403 * During early init (when acpi_permanent_mmap has not been set yet) this411 * During early init (when acpi_permanent_mmap has not been set yet) this
404 * routine simply calls __acpi_unmap_table() to get the job done. Since412 * routine simply calls __acpi_unmap_table() to get the job done. Since
@@ -408,7 +416,6 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) · 3 unmodified lines
408void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)416void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
409{417{
410 struct acpi_ioremap *map;418 struct acpi_ioremap *map;
411 unsigned long refcount;
412 419
413 if (!acpi_permanent_mmap) {420 if (!acpi_permanent_mmap) {
414 __acpi_unmap_table(virt, size);421 __acpi_unmap_table(virt, size);
@@ -416,23 +423,27 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) · 1 unmodified line
416 }423 }
417 424
418 mutex_lock(&acpi_ioremap_lock);425 mutex_lock(&acpi_ioremap_lock);
426
419 map = acpi_map_lookup_virt(virt, size);427 map = acpi_map_lookup_virt(virt, size);
420 if (!map) {428 if (!map) {
421 mutex_unlock(&acpi_ioremap_lock);429 mutex_unlock(&acpi_ioremap_lock);
422 WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);430 WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
423 return;431 return;
424 }432 }
425 refcount = acpi_os_drop_map_ref(map);433 acpi_os_drop_map_ref(map);
426 mutex_unlock(&acpi_ioremap_lock);
427 434
428 if (!refcount)435 mutex_unlock(&acpi_ioremap_lock);
429 acpi_os_map_cleanup(map);
430}436}
431EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);437EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);
432 438
439/**
440 * acpi_os_unmap_memory - Drop a memory mapping reference.
441 * @virt: Start of the address range to drop a reference to.
442 * @size: Size of the address range to drop a reference to.
443 */
433void __ref acpi_os_unmap_memory(void *virt, acpi_size size)444void __ref acpi_os_unmap_memory(void *virt, acpi_size size)
434{445{
435 return acpi_os_unmap_iomem((void __iomem *)virt, size);446 acpi_os_unmap_iomem((void __iomem *)virt, size);
436}447}
437EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);448EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
438 449
@@ -461,7 +472,6 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 22 unmodified lines
461{472{
462 u64 addr;473 u64 addr;
463 struct acpi_ioremap *map;474 struct acpi_ioremap *map;
464 unsigned long refcount;
465 475
466 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)476 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
467 return;477 return;
@@ -472,16 +482,15 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 4 unmodified lines
472 return;482 return;
473 483
474 mutex_lock(&acpi_ioremap_lock);484 mutex_lock(&acpi_ioremap_lock);
485
475 map = acpi_map_lookup(addr, gas->bit_width / 8);486 map = acpi_map_lookup(addr, gas->bit_width / 8);
476 if (!map) {487 if (!map) {
477 mutex_unlock(&acpi_ioremap_lock);488 mutex_unlock(&acpi_ioremap_lock);
478 return;489 return;
479 }490 }
480 refcount = acpi_os_drop_map_ref(map);491 acpi_os_drop_map_ref(map);
481 mutex_unlock(&acpi_ioremap_lock);
482 492
483 if (!refcount)493 mutex_unlock(&acpi_ioremap_lock);
484 acpi_os_map_cleanup(map);
485}494}
486EXPORT_SYMBOL(acpi_os_unmap_generic_address);495EXPORT_SYMBOL(acpi_os_unmap_generic_address);
487 496
drivers/acpi/processor_idle.c+1−2
@@ -203,8 +203,7 @@ static void tsc_check_state(int state) · 202 unmodified lines
203 */203 */
204 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))204 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
205 return;205 return;
206 206 fallthrough;
207 /*FALL THROUGH*/
208 default:207 default:
209 /* TSC could halt in idle, so notify users */208 /* TSC could halt in idle, so notify users */
210 if (state > ACPI_STATE_C1)209 if (state > ACPI_STATE_C1)
drivers/acpi/resource.c+1−1
@@ -373,7 +373,7 @@ unsigned int acpi_dev_get_irq_type(int triggering, int polarity) · 372 unmodified lines
373 case ACPI_ACTIVE_BOTH:373 case ACPI_ACTIVE_BOTH:
374 if (triggering == ACPI_EDGE_SENSITIVE)374 if (triggering == ACPI_EDGE_SENSITIVE)
375 return IRQ_TYPE_EDGE_BOTH;375 return IRQ_TYPE_EDGE_BOTH;
376 /* fall through */376 fallthrough;
377 default:377 default:
378 return IRQ_TYPE_NONE;378 return IRQ_TYPE_NONE;
379 }379 }
drivers/acpi/spcr.c+2−2
@@ -111,7 +111,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 110 unmodified lines
111 table->serial_port.access_width))) {111 table->serial_port.access_width))) {
112 default:112 default:
113 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");113 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
114 /* fall through */114 fallthrough;
115 case 8:115 case 8:
116 iotype = "mmio";116 iotype = "mmio";
117 break;117 break;
@@ -128,7 +128,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 10 unmodified lines
128 switch (table->interface_type) {128 switch (table->interface_type) {
129 case ACPI_DBG2_ARM_SBSA_32BIT:129 case ACPI_DBG2_ARM_SBSA_32BIT:
130 iotype = "mmio32";130 iotype = "mmio32";
131 /* fall through */131 fallthrough;
132 case ACPI_DBG2_ARM_PL011:132 case ACPI_DBG2_ARM_PL011:
133 case ACPI_DBG2_ARM_SBSA_GENERIC:133 case ACPI_DBG2_ARM_SBSA_GENERIC:
134 case ACPI_DBG2_BCM2835:134 case ACPI_DBG2_BCM2835:
drivers/acpi/tables.c+7−18
@@ -292,20 +292,6 @@ static int __init acpi_parse_entries_array(char *id, unsigned long table_size, · 291 unmodified lines
292 int errs = 0;292 int errs = 0;
293 int i;293 int i;
294 294
295 if (acpi_disabled)
296 return -ENODEV;
297
298 if (!id)
299 return -EINVAL;
300
301 if (!table_size)
302 return -EINVAL;
303
304 if (!table_header) {
305 pr_warn("%4.4s not present\n", id);
306 return -ENODEV;
307 }
308
309 table_end = (unsigned long)table_header + table_header->length;295 table_end = (unsigned long)table_header + table_header->length;
310 296
311 /* Parse all entries looking for a match. */297 /* Parse all entries looking for a match. */
@@ -371,6 +357,9 @@ int __init acpi_table_parse_entries_array(char *id, · 59 unmodified lines
371 if (!id)357 if (!id)
372 return -EINVAL;358 return -EINVAL;
373 359
360 if (!table_size)
361 return -EINVAL;
362
374 if (!strncmp(id, ACPI_SIG_MADT, 4))363 if (!strncmp(id, ACPI_SIG_MADT, 4))
375 instance = acpi_apic_instance;364 instance = acpi_apic_instance;
376 365
@@ -490,7 +479,7 @@ static u8 __init acpi_table_checksum(u8 *buffer, u32 length) · 113 unmodified lines
490}479}
491 480
492/* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */481/* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */
493static const char * const table_sigs[] = {482static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst = {
494 ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,483 ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
495 ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,484 ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,
496 ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,485 ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,
@@ -501,7 +490,7 @@ static const char * const table_sigs[] = { · 4 unmodified lines
501 ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,490 ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,
502 ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,491 ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,
503 ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,492 ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,
504 ACPI_SIG_NHLT, NULL };493 ACPI_SIG_NHLT };
505 494
506#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)495#define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
507 496
@@ -548,11 +537,11 @@ void __init acpi_table_upgrade(void) · 40 unmodified lines
548 537
549 table = file.data;538 table = file.data;
550 539
551 for (sig = 0; table_sigs[sig]; sig++)540 for (sig = 0; sig < ARRAY_SIZE(table_sigs); sig++)
552 if (!memcmp(table->signature, table_sigs[sig], 4))541 if (!memcmp(table->signature, table_sigs[sig], 4))
553 break;542 break;
554 543
555 if (!table_sigs[sig]) {544 if (sig >= ARRAY_SIZE(table_sigs)) {
556 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",545 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",
557 cpio_path, file.name);546 cpio_path, file.name);
558 continue;547 continue;
drivers/pci/pci-acpi.c+3−3
@@ -527,8 +527,8 @@ static void program_hpx_type3_register(struct pci_dev *dev, · 526 unmodified lines
527 return;527 return;
528 528
529 break;529 break;
530 case HPX_CFG_VEND_CAP: /* Fall through */530 case HPX_CFG_VEND_CAP:
531 case HPX_CFG_DVSEC: /* Fall through */531 case HPX_CFG_DVSEC:
532 default:532 default:
533 pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");533 pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");
534 return;534 return;
@@ -1001,7 +1001,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) · 466 unmodified lines
1001 error = -EBUSY;1001 error = -EBUSY;
1002 break;1002 break;
1003 }1003 }
1004 /* Fall through */1004 fallthrough;
1005 case PCI_D0:1005 case PCI_D0:
1006 case PCI_D1:1006 case PCI_D1:
1007 case PCI_D2:1007 case PCI_D2:
include/acpi/actypes.h+9−3
@@ -1201,12 +1201,18 @@ struct acpi_pci_id { · 1200 unmodified lines
1201 u16 function;1201 u16 function;
1202};1202};
1203 1203
1204struct acpi_mem_mapping {
1205 acpi_physical_address physical_address;
1206 u8 *logical_address;
1207 acpi_size length;
1208 struct acpi_mem_mapping *next_mm;
1209};
1210
1204struct acpi_mem_space_context {1211struct acpi_mem_space_context {
1205 u32 length;1212 u32 length;
1206 acpi_physical_address address;1213 acpi_physical_address address;
1207 acpi_physical_address mapped_physical_address;1214 struct acpi_mem_mapping *cur_mm;
1208 u8 *mapped_logical_address;1215 struct acpi_mem_mapping *first_mm;
1209 acpi_size mapped_length;
1210};1216};
1211 1217
1212/*1218/*
include/linux/tboot.h+1−1
@@ -44,7 +44,7 @@ struct tboot_acpi_generic_address { · 43 unmodified lines
44 44
45/*45/*
46 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec46 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
47 * (http://www.acpi.info/)47 * (https://uefi.org/specifications)
48 */48 */
49struct tboot_acpi_sleep_info {49struct tboot_acpi_sleep_info {
50 struct tboot_acpi_generic_address pm1a_cnt_blk;50 struct tboot_acpi_generic_address pm1a_cnt_blk;
tools/power/cpupower/man/cpupower-idle-info.1+1−1
@@ -75,7 +75,7 @@ By default only values of core zero are displayed. How to display settings of · 74 unmodified lines
75other cores is described in the cpupower(1) manpage in the \-\-cpu option75other cores is described in the cpupower(1) manpage in the \-\-cpu option
76section.76section.
77.SH REFERENCES77.SH REFERENCES
78http://www.acpi.info/spec.htm78https://uefi.org/specifications
79.SH "FILES"79.SH "FILES"
80.nf80.nf
81\fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP81\fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP