Merge branch 'acpica-cherry-pick' into release
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / acpi / acpica / hwvalid.c
index e26c17d..e1d9c77 100644 (file)
@@ -150,7 +150,7 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
 
        if (last_address > ACPI_UINT16_MAX) {
                ACPI_ERROR((AE_INFO,
-                           "Illegal I/O port address/length above 64K: 0x%p/%X",
+                           "Illegal I/O port address/length above 64K: %p/0x%X",
                            ACPI_CAST_PTR(void, address), byte_width));
                return_ACPI_STATUS(AE_LIMIT);
        }
@@ -222,6 +222,12 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
        u32 one_byte;
        u32 i;
 
+       /* Truncate address to 16 bits if requested */
+
+       if (acpi_gbl_truncate_io_addresses) {
+               address &= ACPI_UINT16_MAX;
+       }
+
        /* Validate the entire request and perform the I/O */
 
        status = acpi_hw_validate_io_request(address, width);
@@ -279,6 +285,12 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
        acpi_status status;
        u32 i;
 
+       /* Truncate address to 16 bits if requested */
+
+       if (acpi_gbl_truncate_io_addresses) {
+               address &= ACPI_UINT16_MAX;
+       }
+
        /* Validate the entire request and perform the I/O */
 
        status = acpi_hw_validate_io_request(address, width);