Skip to content

Commit

Permalink
Merge branches 'acpi-mm', 'acpi-tables', 'acpi-apei' and 'acpi-misc'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Rafael J. Wysocki committed Aug 3, 2020
5 parents 3fa5faf + 5003ad7 + 5b1e802 + eb27e5a + 4ce7796 commit db1da2f
Show file tree
Hide file tree
Showing 26 changed files with 139 additions and 115 deletions.
4 changes: 2 additions & 2 deletions Documentation/firmware-guide/acpi/DSD-properties-rules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ contents.
References
==========

.. [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
.. [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
.. [2] https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ References
==========

[1] Hierarchical Data Extension UUID For _DSD.
<http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
<https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
referenced 2018-07-17.

[2] Device Properties UUID For _DSD.
<http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
<https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
referenced 2016-10-04.
10 changes: 5 additions & 5 deletions Documentation/firmware-guide/acpi/dsd/graph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,23 +154,23 @@ References
==========

[1] _DSD (Device Specific Data) Implementation Guide.
http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,
https://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel-1_1.htm,
referenced 2016-10-03.

[2] Devicetree. http://www.devicetree.org, referenced 2016-10-03.
[2] Devicetree. https://www.devicetree.org, referenced 2016-10-03.

[3] Documentation/devicetree/bindings/graph.txt

[4] Device Properties UUID For _DSD.
http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf,
referenced 2016-10-04.

[5] Hierarchical Data Extension UUID For _DSD.
http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf,
referenced 2016-10-04.

[6] Advanced Configuration and Power Interface Specification.
http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,
https://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf,
referenced 2016-10-04.

[7] _DSD Device Properties Usage Rules.
Expand Down
6 changes: 3 additions & 3 deletions Documentation/firmware-guide/acpi/dsd/leds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ where
References
==========

[1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.
[1] Device tree. <URL:https://www.devicetree.org>, referenced 2019-02-21.

[2] Advanced Configuration and Power Interface Specification.
<URL:https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf>,
Expand All @@ -101,11 +101,11 @@ References
[4] Documentation/devicetree/bindings/media/video-interfaces.txt

[5] Device Properties UUID For _DSD.
<URL:http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
<URL:https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf>,
referenced 2019-02-21.

[6] Hierarchical Data Extension UUID For _DSD.
<URL:http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
<URL:https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf>,
referenced 2019-02-21.

[7] Documentation/firmware-guide/acpi/dsd/data-node-references.rst
2 changes: 1 addition & 1 deletion Documentation/firmware-guide/acpi/lpit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Low Power Idle Table (LPIT)
To enumerate platform Low Power Idle states, Intel platforms are using
“Low Power Idle Table” (LPIT). More details about this table can be
downloaded from:
http://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf
https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf

Residencies for each low power state can be read via FFH
(Function fixed hardware) or a memory mapped interface.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/acpi_power_meter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Supported systems:

Prefix: 'power_meter'

Datasheet: http://acpi.info/, section 10.4.
Datasheet: https://uefi.org/specifications, section 10.4.

Author: Darrick J. Wong

Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ menuconfig ACPI
Linux support for ACPI is based on Intel Corporation's ACPI
Component Architecture (ACPI CA). For more information on the
ACPI CA, see:
<http://acpica.org/>
<https://acpica.org/>

ACPI is an open industry specification originally co-developed by
Hewlett-Packard, Intel, Microsoft, Phoenix, and Toshiba. Currently,
it is developed by the ACPI Specification Working Group (ASWG) under
the UEFI Forum and any UEFI member can join the ASWG and contribute
to the ACPI specification.
The specification is available at:
<http://www.acpi.info>
<http://www.uefi.org/acpi/specs>
<https://uefi.org/specifications>

if ACPI

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
/* fall through */
fallthrough;
case ACPI_AC_NOTIFY_STATUS:
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
* PIIX4 models.
*/
errata.piix4.throttle = 1;
/* fall through*/
fallthrough;

case 2: /* PIIX4E */
case 3: /* PIIX4M */
Expand Down
14 changes: 8 additions & 6 deletions drivers/acpi/acpica/evrgnini.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
union acpi_operand_object *region_desc =
(union acpi_operand_object *)handle;
struct acpi_mem_space_context *local_region_context;
struct acpi_mem_mapping *mm;

ACPI_FUNCTION_TRACE(ev_system_memory_region_setup);

Expand All @@ -46,13 +47,14 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
local_region_context =
(struct acpi_mem_space_context *)*region_context;

/* Delete a cached mapping if present */
/* Delete memory mappings if present */

if (local_region_context->mapped_length) {
acpi_os_unmap_memory(local_region_context->
mapped_logical_address,
local_region_context->
mapped_length);
while (local_region_context->first_mm) {
mm = local_region_context->first_mm;
local_region_context->first_mm = mm->next_mm;
acpi_os_unmap_memory(mm->logical_address,
mm->length);
ACPI_FREE(mm);
}
ACPI_FREE(local_region_context);
*region_context = NULL;
Expand Down
64 changes: 46 additions & 18 deletions drivers/acpi/acpica/exregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ acpi_ex_system_memory_space_handler(u32 function,
acpi_status status = AE_OK;
void *logical_addr_ptr = NULL;
struct acpi_mem_space_context *mem_info = region_context;
struct acpi_mem_mapping *mm = mem_info->cur_mm;
u32 length;
acpi_size map_length;
acpi_size page_boundary_map_length;
Expand Down Expand Up @@ -96,20 +97,37 @@ acpi_ex_system_memory_space_handler(u32 function,
* Is 1) Address below the current mapping? OR
* 2) Address beyond the current mapping?
*/
if ((address < mem_info->mapped_physical_address) ||
(((u64) address + length) > ((u64)
mem_info->mapped_physical_address +
mem_info->mapped_length))) {
if (!mm || (address < mm->physical_address) ||
((u64) address + length > (u64) mm->physical_address + mm->length)) {
/*
* The request cannot be resolved by the current memory mapping;
* Delete the existing mapping and create a new one.
* The request cannot be resolved by the current memory mapping.
*
* Look for an existing saved mapping covering the address range
* at hand. If found, save it as the current one and carry out
* the access.
*/
if (mem_info->mapped_length) {
for (mm = mem_info->first_mm; mm; mm = mm->next_mm) {
if (mm == mem_info->cur_mm)
continue;

if (address < mm->physical_address)
continue;

/* Valid mapping, delete it */
if ((u64) address + length >
(u64) mm->physical_address + mm->length)
continue;

acpi_os_unmap_memory(mem_info->mapped_logical_address,
mem_info->mapped_length);
mem_info->cur_mm = mm;
goto access;
}

/* Create a new mappings list entry */
mm = ACPI_ALLOCATE_ZEROED(sizeof(*mm));
if (!mm) {
ACPI_ERROR((AE_INFO,
"Unable to save memory mapping at 0x%8.8X%8.8X, size %u",
ACPI_FORMAT_UINT64(address), length));
return_ACPI_STATUS(AE_NO_MEMORY);
}

/*
Expand Down Expand Up @@ -143,29 +161,39 @@ acpi_ex_system_memory_space_handler(u32 function,

/* Create a new mapping starting at the address given */

mem_info->mapped_logical_address =
acpi_os_map_memory(address, map_length);
if (!mem_info->mapped_logical_address) {
logical_addr_ptr = acpi_os_map_memory(address, map_length);
if (!logical_addr_ptr) {
ACPI_ERROR((AE_INFO,
"Could not map memory at 0x%8.8X%8.8X, size %u",
ACPI_FORMAT_UINT64(address),
(u32)map_length));
mem_info->mapped_length = 0;
ACPI_FREE(mm);
return_ACPI_STATUS(AE_NO_MEMORY);
}

/* Save the physical address and mapping size */

mem_info->mapped_physical_address = address;
mem_info->mapped_length = map_length;
mm->logical_address = logical_addr_ptr;
mm->physical_address = address;
mm->length = map_length;

/*
* Add the new entry to the mappigs list and save it as the
* current mapping.
*/
mm->next_mm = mem_info->first_mm;
mem_info->first_mm = mm;

mem_info->cur_mm = mm;
}

access:
/*
* Generate a logical pointer corresponding to the address we want to
* access
*/
logical_addr_ptr = mem_info->mapped_logical_address +
((u64) address - (u64) mem_info->mapped_physical_address);
logical_addr_ptr = mm->logical_address +
((u64) address - (u64) mm->physical_address);

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ __setup("hest_disable", setup_hest_disable);
void __init acpi_hest_init(void)
{
acpi_status status;
int rc = -ENODEV;
int rc;
unsigned int ghes_count = 0;

if (hest_disable) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
switch (event) {
case ACPI_FIXED_HARDWARE_EVENT:
event = ACPI_BUTTON_NOTIFY_STATUS;
/* fall through */
fallthrough;
case ACPI_BUTTON_NOTIFY_STATUS:
input = button->input;
if (button->type == ACPI_BUTTON_TYPE_LID) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ int dock_notify(struct acpi_device *adev, u32 event)
surprise_removal = 1;
event = ACPI_NOTIFY_EJECT_REQUEST;
/* Fall back */
/* fall through */
fallthrough;
case ACPI_NOTIFY_EJECT_REQUEST:
begin_undock(ds);
if ((immediate_undock && !(ds->flags & DOCK_IS_ATA))
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/evged.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static acpi_status acpi_ged_request_interrupt(struct acpi_resource *ares,

if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
break;
/* fall through */
fallthrough;
default:
if (ACPI_SUCCESS(acpi_get_handle(handle, "_EVT", &evt_handle)))
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/nfit/nfit.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/* ACPI 6.1 */
#define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"

/* http://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
/* https://pmem.io/documents/NVDIMM_DSM_Interface-V1.6.pdf */
#define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"

/* https://github.com/HewlettPackard/hpe-nvm/blob/master/Documentation/ */
Expand Down
10 changes: 1 addition & 9 deletions drivers/acpi/numa/srat.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
pxm &= 0xff;

node = acpi_map_pxm_to_node(pxm);
if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
if (node == NUMA_NO_NODE) {
pr_err("SRAT: Too many proximity domains.\n");
goto out_err_bad_srat;
}
Expand Down Expand Up @@ -291,8 +291,6 @@ acpi_parse_x2apic_affinity(union acpi_subtable_headers *header,
struct acpi_srat_x2apic_cpu_affinity *processor_affinity;

processor_affinity = (struct acpi_srat_x2apic_cpu_affinity *)header;
if (!processor_affinity)
return -EINVAL;

acpi_table_print_srat_entry(&header->common);

Expand All @@ -309,8 +307,6 @@ acpi_parse_processor_affinity(union acpi_subtable_headers *header,
struct acpi_srat_cpu_affinity *processor_affinity;

processor_affinity = (struct acpi_srat_cpu_affinity *)header;
if (!processor_affinity)
return -EINVAL;

acpi_table_print_srat_entry(&header->common);

Expand All @@ -327,8 +323,6 @@ acpi_parse_gicc_affinity(union acpi_subtable_headers *header,
struct acpi_srat_gicc_affinity *processor_affinity;

processor_affinity = (struct acpi_srat_gicc_affinity *)header;
if (!processor_affinity)
return -EINVAL;

acpi_table_print_srat_entry(&header->common);

Expand All @@ -347,8 +341,6 @@ acpi_parse_memory_affinity(union acpi_subtable_headers * header,
struct acpi_srat_mem_affinity *memory_affinity;

memory_affinity = (struct acpi_srat_mem_affinity *)header;
if (!memory_affinity)
return -EINVAL;

acpi_table_print_srat_entry(&header->common);

Expand Down
Loading

0 comments on commit db1da2f

Please sign in to comment.