Skip to contentSkip to conversation

ACPI: Ignore the upper bits of SystemIO addresses

PATCH In review Matthew Garrett 3 participants 3 messages May 18, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: Ignore the upper bits of SystemIO addresses

Various machines (https://bugzilla.redhat.com/show_bug.cgi?id=585756 for instance) contain SystemIO spaces with addresses > 16 bits. acpica throws an error for this, while Windows silently ignores the upper 16 bits and carries on happily. Implement the latter behaviour for bug compatibility.

---
 drivers/acpi/acpica/hwvalid.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
drivers/acpi/acpica/hwvalid.c +8 -9
index e26c17d..ddfb4f1 100644
@@ -146,15 +146,6 @@ acpi_hw_validate_io_request(acpi_io_address address, u32 bit_width)
 								      last_address),
 			  byte_width));
 
-	/* Maximum 16-bit address in I/O space */
-
-	if (last_address > ACPI_UINT16_MAX) {
-		ACPI_ERROR((AE_INFO,
-			    "Illegal I/O port address/length above 64K: 0x%p/%X",
-			    ACPI_CAST_PTR(void, address), byte_width));
-		return_ACPI_STATUS(AE_LIMIT);
-	}
-
 	/* Exit if requested address is not within the protected port table */
 
 	if (address > acpi_protected_ports[ACPI_PORT_INFO_ENTRIES - 1].end) {
@@ -222,6 +213,10 @@ acpi_status acpi_hw_read_port(acpi_io_address address, u32 *value, u32 width)
 	u32 one_byte;
 	u32 i;
 
+	/* Windows only uses the lower 16 bits of an address. Emulate that */
+
+	address &= 0xffff;
+
 	/* Validate the entire request and perform the I/O */
 
 	status = acpi_hw_validate_io_request(address, width);
@@ -279,6 +274,10 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width)
 	acpi_status status;
 	u32 i;
 
+	/* Windows only uses the lower 16 bits of an address. Emulate that */
+
+	address &= 0xffff;
+
 	/* Validate the entire request and perform the I/O */
 
 	status = acpi_hw_validate_io_request(address, width);
Signature · 1 line
1.7.0.1
#1 lore raw

Ok, will backport to ACPICA.
Thanks,
Bob

Quoted 65 lines

-----Original Message-----
From: Matthew Garrett [mailto:[email protected]]
Sent: Tuesday, May 18, 2010 11:07 AM
To: [email protected]
Cc: Moore, Robert; [email protected]; Matthew Garrett
Subject: [PATCH] ACPI: Ignore the upper bits of SystemIO addresses

Various machines (https://bugzilla.redhat.com/show_bug.cgi?id=585756 for instance) contain SystemIO spaces with addresses > 16 bits. acpica throws an error for this, while Windows silently ignores the upper 16 bits and carries on happily. Implement the latter behaviour for bug compatibility.

---
drivers/acpi/acpica/hwvalid.c | 17 ++++++++---------

1 files changed, 8 insertions(+), 9 deletions(-)
drivers/acpi/acpica/hwvalid.c +0 -9
index e26c17d..ddfb4f1 100644
@@ -146,15 +146,6 @@ acpi_hw_validate_io_request(acpi_io_address address,
 u32 bit_width)
 								      last_address),
 			  byte_width));
 
-	/* Maximum 16-bit address in I/O space */
-
-	if (last_address > ACPI_UINT16_MAX) {
-		ACPI_ERROR((AE_INFO,
-			    "Illegal I/O port address/length above 64K: 0x%p/%X",
-			    ACPI_CAST_PTR(void, address), byte_width));
-		return_ACPI_STATUS(AE_LIMIT);
-	}
-
 	/* Exit if requested address is not within the protected port table
 */
	if (address > acpi_protected_ports[ACPI_PORT_INFO_ENTRIES - 1].end) {
drivers/acpi/acpica/hwvalid.c +4 -0
@@ -222,6 +213,10 @@ acpi_status acpi_hw_read_port(acpi_io_address address,
 u32 *value, u32 width)
 	u32 one_byte;
 	u32 i;
 
+	/* Windows only uses the lower 16 bits of an address. Emulate that */
+
+	address &= 0xffff;
+
 	/* Validate the entire request and perform the I/O */
 
	status = acpi_hw_validate_io_request(address, width);
drivers/acpi/acpica/hwvalid.c +4 -0
@@ -279,6 +274,10 @@ acpi_status acpi_hw_write_port(acpi_io_address
 address, u32 value, u32 width)
 	acpi_status status;
 	u32 i;
 
+	/* Windows only uses the lower 16 bits of an address. Emulate that */
+
+	address &= 0xffff;
+
 	/* Validate the entire request and perform the I/O */
 
	status = acpi_hw_validate_io_request(address, width);

--
1.7.0.1