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
9696 References
9797 ==========
9898
99−.. [1] http://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.pdf
99+.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
100+.. [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
8585 ==========
8686
8787 [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>,
8989 referenced 2018-07-17.
9090
9191 [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>,
9393 referenced 2016-10-04.
Documentation/firmware-guide/acpi/dsd/graph.rst+5−5
@@ -154,23 +154,23 @@ References · 153 unmodified lines
154154 ==========
155155
156156 [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,
158158 referenced 2016-10-03.
159159
160−[2] Devicetree. http://www.devicetree.org, referenced 2016-10-03.
160+[2] Devicetree. https://www.devicetree.org, referenced 2016-10-03.
161161
162162 [3] Documentation/devicetree/bindings/graph.txt
163163
164164 [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,
166166 referenced 2016-10-04.
167167
168168 [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,
170170 referenced 2016-10-04.
171171
172172 [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,
174174 referenced 2016-10-04.
175175
176176 [7] _DSD Device Properties Usage Rules.
Documentation/firmware-guide/acpi/dsd/leds.rst+3−3
@@ -90,7 +90,7 @@ where · 89 unmodified lines
9090 References
9191 ==========
9292
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.
9494
9595 [2] Advanced Configuration and Power Interface Specification.
9696 <URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,
@@ -101,11 +101,11 @@ References · 4 unmodified lines
101101 [4] Documentation/devicetree/bindings/media/video-interfaces.txt
102102
103103 [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>,
105105 referenced 2019-02-21.
106106
107107 [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>,
109109 referenced 2019-02-21.
110110
111111 [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
77 To enumerate platform Low Power Idle states, Intel platforms are using
88 “Low Power Idle Table” (LPIT). More details about this table can be
99 downloaded from:
10−http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
10+https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
1111
1212 Residencies for each low power state can be read via FFH
1313 (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
99
1010 Prefix: 'power_meter'
1111
12− Datasheet: http://acpi.info/, section 10.4.
12+ Datasheet: https://uefi.org/specifications, section 10.4.
1313
1414 Author: Darrick J. Wong
1515
drivers/acpi/Kconfig+2−3
@@ -32,7 +32,7 @@ menuconfig ACPI · 31 unmodified lines
3232 Linux support for ACPI is based on Intel Corporation's ACPI
3333 Component Architecture (ACPI CA). For more information on the
3434 ACPI CA, see:
35− <http://acpica.org/>
35+ <https://acpica.org/>
3636
3737 ACPI is an open industry specification originally co-developed by
3838 Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,
@@ -40,8 +40,7 @@ menuconfig ACPI · 1 unmodified line
4040 the UEFI Forum and any UEFI member can join the ASWG and contribute
4141 to the ACPI specification.
4242 The specification is available at:
43− <http://www.acpi.info>
44− <http://www.uefi.org/acpi/specs>
43+ <https://uefi.org/specifications>
4544
4645 if ACPI
4746
drivers/acpi/ac.c+1−1
@@ -155,7 +155,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event) · 154 unmodified lines
155155 default:
156156 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
157157 "Unsupported event [0x%x]\n", event));
158− /* fall through */
158+ fallthrough;
159159 case ACPI_AC_NOTIFY_STATUS:
160160 case ACPI_NOTIFY_BUS_CHECK:
161161 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
7979 * PIIX4 models.
8080 */
8181 errata.piix4.throttle = 1;
82− /* fall through*/
82+ fallthrough;
8383
8484 case 2: /* PIIX4E */
8585 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
3838 union acpi_operand_object *region_desc =
3939 (union acpi_operand_object *)handle;
4040 struct acpi_mem_space_context *local_region_context;
41+ struct acpi_mem_mapping *mm;
4142
4243 ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);
4344
@@ -46,13 +47,14 @@ acpi_ev_system_memory_region_setup(acpi_handle handle, · 2 unmodified lines
4647 local_region_context =
4748 (struct acpi_mem_space_context *)*region_context;
4849
49− /* Delete a cached mapping if present */
50+ /* Delete memory mappings if present */
5051
51− if (local_region_context->mapped_length) {
52− acpi_os_unmap_memory(local_region_context->
53− mapped_logical_address,
54− local_region_context->
55− mapped_length);
52+ while (local_region_context->first_mm) {
53+ mm = local_region_context->first_mm;
54+ local_region_context->first_mm = mm->next_mm;
55+ acpi_os_unmap_memory(mm->logical_address,
56+ mm->length);
57+ ACPI_FREE(mm);
5658 }
5759 ACPI_FREE(local_region_context);
5860 *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
4141 acpi_status status = AE_OK;
4242 void *logical_addr_ptr = NULL;
4343 struct acpi_mem_space_context *mem_info = region_context;
44+ struct acpi_mem_mapping *mm = mem_info->cur_mm;
4445 u32 length;
4546 acpi_size map_length;
4647 acpi_size page_boundary_map_length;
@@ -96,20 +97,37 @@ acpi_ex_system_memory_space_handler(u32 function, · 49 unmodified lines
9697 * Is 1) Address below the current mapping? OR
9798 * 2) Address beyond the current mapping?
9899 */
99− if ((address < mem_info->mapped_physical_address) ||
100− (((u64) address + length) > ((u64)
101− mem_info->mapped_physical_address +
102− mem_info->mapped_length))) {
100+ if (!mm || (address < mm->physical_address) ||
101+ ((u64) address + length > (u64) mm->physical_address + mm->length)) {
103102 /*
104− * The request cannot be resolved by the current memory mapping;
105− * Delete the existing mapping and create a new one.
103+ * The request cannot be resolved by the current memory mapping.
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.
106108 */
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;
108115
109− /* Valid mapping, delete it */
116+ if ((u64) address + length >
117+ (u64) mm->physical_address + mm->length)
118+ continue;
110119
111− acpi_os_unmap_memory(mem_info->mapped_logical_address,
112− mem_info->mapped_length);
120+ mem_info->cur_mm = mm;
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);
113131 }
114132
115133 /*
@@ -143,29 +161,39 @@ acpi_ex_system_memory_space_handler(u32 function, · 27 unmodified lines
143161
144162 /* Create a new mapping starting at the address given */
145163
146− mem_info->mapped_logical_address =
147− acpi_os_map_memory(address, map_length);
148− if (!mem_info->mapped_logical_address) {
164+ logical_addr_ptr = acpi_os_map_memory(address, map_length);
165+ if (!logical_addr_ptr) {
149166 ACPI_ERROR((AE_INFO,
150167 "Could not map memory at 0x%8.8X%8.8X, size %u",
151168 ACPI_FORMAT_UINT64(address),
152169 (u32)map_length));
153− mem_info->mapped_length = 0;
170+ ACPI_FREE(mm);
154171 return_ACPI_STATUS(AE_NO_MEMORY);
155172 }
156173
157174 /* Save the physical address and mapping size */
158175
159− mem_info->mapped_physical_address = address;
160− mem_info->mapped_length = map_length;
176+ mm->logical_address = logical_addr_ptr;
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;
161188 }
162189
190+access:
163191 /*
164192 * Generate a logical pointer corresponding to the address we want to
165193 * access
166194 */
167− logical_addr_ptr = mem_info->mapped_logical_address +
168− ((u64) address - (u64) mem_info->mapped_physical_address);
195+ logical_addr_ptr = mm->logical_address +
196+ ((u64) address - (u64) mm->physical_address);
169197
170198 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
171199 "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
227227 void __init acpi_hest_init(void)
228228 {
229229 acpi_status status;
230− int rc = -ENODEV;
230+ int rc;
231231 unsigned int ghes_count = 0;
232232
233233 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
405405 switch (event) {
406406 case ACPI_FIXED_HARDWARE_EVENT:
407407 event = ACPI_BUTTON_NOTIFY_STATUS;
408− /* fall through */
408+ fallthrough;
409409 case ACPI_BUTTON_NOTIFY_STATUS:
410410 input = button->input;
411411 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
469469 surprise_removal = 1;
470470 event = ACPI_NOTIFY_EJECT_REQUEST;
471471 /* Fall back */
472− /* fall through */
472+ fallthrough;
473473 case ACPI_NOTIFY_EJECT_REQUEST:
474474 begin_undock(ds);
475475 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
106106
107107 if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
108108 break;
109− /* fall through */
109+ fallthrough;
110110 default:
111111 if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
112112 break;
drivers/acpi/nfit/nfit.h+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
1616 /* ACPI 6.1 */
1717 #define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"
1818
19−/* http://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
19+/* https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
2020 #define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"
2121
2222 /* 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
230230 pxm &= 0xff;
231231
232232 node = acpi_map_pxm_to_node(pxm);
233− if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
233+ if (node == NUMA_NO_NODE) {
234234 pr_err("SRAT: Too many proximity domains.\n");
235235 goto out_err_bad_srat;
236236 }
@@ -291,8 +291,6 @@ acpi_parse_x2apic_affinity(union acpi_subtable_headers *header, · 54 unmodified lines
291291 struct acpi_srat_x2apic_cpu_affinity *processor_affinity;
292292
293293 processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
294− if (!processor_affinity)
295− return -EINVAL;
296294
297295 acpi_table_print_srat_entry(&header->common);
298296
@@ -309,8 +307,6 @@ acpi_parse_processor_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
309307 struct acpi_srat_cpu_affinity *processor_affinity;
310308
311309 processor_affinity = (struct acpi_srat_cpu_affinity *)header;
312− if (!processor_affinity)
313− return -EINVAL;
314310
315311 acpi_table_print_srat_entry(&header->common);
316312
@@ -327,8 +323,6 @@ acpi_parse_gicc_affinity(union acpi_subtable_headers *header, · 10 unmodified lines
327323 struct acpi_srat_gicc_affinity *processor_affinity;
328324
329325 processor_affinity = (struct acpi_srat_gicc_affinity *)header;
330− if (!processor_affinity)
331− return -EINVAL;
332326
333327 acpi_table_print_srat_entry(&header->common);
334328
@@ -347,8 +341,6 @@ acpi_parse_memory_affinity(union acpi_subtable_headers * header, · 12 unmodified lines
347341 struct acpi_srat_mem_affinity *memory_affinity;
348342
349343 memory_affinity = (struct acpi_srat_mem_affinity *)header;
350− if (!memory_affinity)
351− return -EINVAL;
352344
353345 acpi_table_print_srat_entry(&header->common);
354346
drivers/acpi/osl.c+36−27
@@ -77,7 +77,10 @@ struct acpi_ioremap { · 76 unmodified lines
7777 void __iomem *virt;
7878 acpi_physical_address phys;
7979 acpi_size size;
80− unsigned long refcount;
80+ union {
81+ unsigned long refcount;
82+ struct rcu_work rwork;
83+ } track;
8184 };
8285
8386 static LIST_HEAD(acpi_ioremaps);
@@ -250,7 +253,7 @@ void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size) · 166 unmodified lines
250253 map = acpi_map_lookup(phys, size);
251254 if (map) {
252255 virt = map->virt + (phys - map->phys);
253− map->refcount++;
256+ map->track.refcount++;
254257 }
255258 mutex_unlock(&acpi_ioremap_lock);
256259 return virt;
@@ -335,7 +338,7 @@ void __iomem __ref · 78 unmodified lines
335338 /* Check if there's a suitable mapping already. */
336339 map = acpi_map_lookup(phys, size);
337340 if (map) {
338− map->refcount++;
341+ map->track.refcount++;
339342 goto out;
340343 }
341344
@@ -358,7 +361,7 @@ void __iomem __ref · 16 unmodified lines
358361 map->virt = virt;
359362 map->phys = pg_off;
360363 map->size = pg_sz;
361− map->refcount = 1;
364+ map->track.refcount = 1;
362365
363366 list_add_tail_rcu(&map->list, &acpi_ioremaps);
364367
@@ -374,21 +377,26 @@ void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) · 9 unmodified lines
374377 }
375378 EXPORT_SYMBOL_GPL(acpi_os_map_memory);
376379
377−/* Must be called with mutex_lock(&acpi_ioremap_lock) */
378−static unsigned long acpi_os_drop_map_ref(struct acpi_ioremap *map)
380+static void acpi_os_map_remove(struct work_struct *work)
379381 {
380− unsigned long refcount = --map->refcount;
382+ struct acpi_ioremap *map = container_of(to_rcu_work(work),
383+ struct acpi_ioremap,
384+ track.rwork);
381385
382− if (!refcount)
383− list_del_rcu(&map->list);
384− return refcount;
386+ acpi_unmap(map->phys, map->virt);
387+ kfree(map);
385388 }
386389
387−static void acpi_os_map_cleanup(struct acpi_ioremap *map)
390+/* Must be called with mutex_lock(&acpi_ioremap_lock) */
391+static void acpi_os_drop_map_ref(struct acpi_ioremap *map)
388392 {
389− synchronize_rcu_expedited();
390− acpi_unmap(map->phys, map->virt);
391− kfree(map);
393+ if (--map->track.refcount)
394+ return;
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);
392400 }
393401
394402 /**
@@ -397,8 +405,8 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) · 2 unmodified lines
397405 * @size: Size of the address range to drop a reference to.
398406 *
399407 * 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 active
401− * references to it.
408+ * mappings, drop a reference to it and if there are no more active references
409+ * to it, queue it up for later removal.
402410 *
403411 * During early init (when acpi_permanent_mmap has not been set yet) this
404412 * 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
408416 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size)
409417 {
410418 struct acpi_ioremap *map;
411− unsigned long refcount;
412419
413420 if (!acpi_permanent_mmap) {
414421 __acpi_unmap_table(virt, size);
@@ -416,23 +423,27 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) · 1 unmodified line
416423 }
417424
418425 mutex_lock(&acpi_ioremap_lock);
426+
419427 map = acpi_map_lookup_virt(virt, size);
420428 if (!map) {
421429 mutex_unlock(&acpi_ioremap_lock);
422430 WARN(true, PREFIX "%s: bad address %p\n", __func__, virt);
423431 return;
424432 }
425− refcount = acpi_os_drop_map_ref(map);
426− mutex_unlock(&acpi_ioremap_lock);
433+ acpi_os_drop_map_ref(map);
427434
428− if (!refcount)
429− acpi_os_map_cleanup(map);
435+ mutex_unlock(&acpi_ioremap_lock);
430436 }
431437 EXPORT_SYMBOL_GPL(acpi_os_unmap_iomem);
432438
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+ */
433444 void __ref acpi_os_unmap_memory(void *virt, acpi_size size)
434445 {
435− return acpi_os_unmap_iomem((void __iomem *)virt, size);
446+ acpi_os_unmap_iomem((void __iomem *)virt, size);
436447 }
437448 EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
438449
@@ -461,7 +472,6 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 22 unmodified lines
461472 {
462473 u64 addr;
463474 struct acpi_ioremap *map;
464− unsigned long refcount;
465475
466476 if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
467477 return;
@@ -472,16 +482,15 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas) · 4 unmodified lines
472482 return;
473483
474484 mutex_lock(&acpi_ioremap_lock);
485+
475486 map = acpi_map_lookup(addr, gas->bit_width / 8);
476487 if (!map) {
477488 mutex_unlock(&acpi_ioremap_lock);
478489 return;
479490 }
480− refcount = acpi_os_drop_map_ref(map);
481− mutex_unlock(&acpi_ioremap_lock);
491+ acpi_os_drop_map_ref(map);
482492
483− if (!refcount)
484− acpi_os_map_cleanup(map);
493+ mutex_unlock(&acpi_ioremap_lock);
485494 }
486495 EXPORT_SYMBOL(acpi_os_unmap_generic_address);
487496
drivers/acpi/processor_idle.c+1−2
@@ -203,8 +203,7 @@ static void tsc_check_state(int state) · 202 unmodified lines
203203 */
204204 if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
205205 return;
206−
207− /*FALL THROUGH*/
206+ fallthrough;
208207 default:
209208 /* TSC could halt in idle, so notify users */
210209 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
373373 case ACPI_ACTIVE_BOTH:
374374 if (triggering == ACPI_EDGE_SENSITIVE)
375375 return IRQ_TYPE_EDGE_BOTH;
376− /* fall through */
376+ fallthrough;
377377 default:
378378 return IRQ_TYPE_NONE;
379379 }
drivers/acpi/spcr.c+2−2
@@ -111,7 +111,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 110 unmodified lines
111111 table->serial_port.access_width))) {
112112 default:
113113 pr_err("Unexpected SPCR Access Width. Defaulting to byte size\n");
114− /* fall through */
114+ fallthrough;
115115 case 8:
116116 iotype = "mmio";
117117 break;
@@ -128,7 +128,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) · 10 unmodified lines
128128 switch (table->interface_type) {
129129 case ACPI_DBG2_ARM_SBSA_32BIT:
130130 iotype = "mmio32";
131− /* fall through */
131+ fallthrough;
132132 case ACPI_DBG2_ARM_PL011:
133133 case ACPI_DBG2_ARM_SBSA_GENERIC:
134134 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
292292 int errs = 0;
293293 int i;
294294
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−
309295 table_end = (unsigned long)table_header + table_header->length;
310296
311297 /* Parse all entries looking for a match. */
@@ -371,6 +357,9 @@ int __init acpi_table_parse_entries_array(char *id, · 59 unmodified lines
371357 if (!id)
372358 return -EINVAL;
373359
360+ if (!table_size)
361+ return -EINVAL;
362+
374363 if (!strncmp(id, ACPI_SIG_MADT, 4))
375364 instance = acpi_apic_instance;
376365
@@ -490,7 +479,7 @@ static u8 __init acpi_table_checksum(u8 *buffer, u32 length) · 113 unmodified lines
490479 }
491480
492481 /* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */
493−static const char * const table_sigs[] = {
482+static const char table_sigs[][ACPI_NAMESEG_SIZE] __initconst = {
494483 ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
495484 ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,
496485 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
501490 ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,
502491 ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,
503492 ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,
504− ACPI_SIG_NHLT, NULL };
493+ ACPI_SIG_NHLT };
505494
506495 #define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
507496
@@ -548,11 +537,11 @@ void __init acpi_table_upgrade(void) · 40 unmodified lines
548537
549538 table = file.data;
550539
551− for (sig = 0; table_sigs[sig]; sig++)
540+ for (sig = 0; sig < ARRAY_SIZE(table_sigs); sig++)
552541 if (!memcmp(table->signature, table_sigs[sig], 4))
553542 break;
554543
555− if (!table_sigs[sig]) {
544+ if (sig >= ARRAY_SIZE(table_sigs)) {
556545 pr_err("ACPI OVERRIDE: Unknown signature [%s%s]\n",
557546 cpio_path, file.name);
558547 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
527527 return;
528528
529529 break;
530− case HPX_CFG_VEND_CAP: /* Fall through */
531− case HPX_CFG_DVSEC: /* Fall through */
530+ case HPX_CFG_VEND_CAP:
531+ case HPX_CFG_DVSEC:
532532 default:
533533 pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");
534534 return;
@@ -1001,7 +1001,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) · 466 unmodified lines
10011001 error = -EBUSY;
10021002 break;
10031003 }
1004− /* Fall through */
1004+ fallthrough;
10051005 case PCI_D0:
10061006 case PCI_D1:
10071007 case PCI_D2:
include/acpi/actypes.h+9−3
@@ -1201,12 +1201,18 @@ struct acpi_pci_id { · 1200 unmodified lines
12011201 u16 function;
12021202 };
12031203
1204+struct 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+
12041211 struct acpi_mem_space_context {
12051212 u32 length;
12061213 acpi_physical_address address;
1207− acpi_physical_address mapped_physical_address;
1208− u8 *mapped_logical_address;
1209− acpi_size mapped_length;
1214+ struct acpi_mem_mapping *cur_mm;
1215+ struct acpi_mem_mapping *first_mm;
12101216 };
12111217
12121218 /*
include/linux/tboot.h+1−1
@@ -44,7 +44,7 @@ struct tboot_acpi_generic_address { · 43 unmodified lines
4444
4545 /*
4646 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
47− * (http://www.acpi.info/)
47+ * (https://uefi.org/specifications)
4848 */
4949 struct tboot_acpi_sleep_info {
5050 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
7575 other cores is described in the cpupower(1) manpage in the \-\-cpu option
7676 section.
7777 .SH REFERENCES
78−http://www.acpi.info/spec.htm
78+https://uefi.org/specifications
7979 .SH "FILES"
8080 .nf
8181 \fI/sys/devices/system/cpu/cpu*/cpuidle/state*\fP