linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: Ignore the upper bits of SystemIO addresses
@ 2010-05-18 18:07 Matthew Garrett
  2010-05-18 18:50 ` Moore, Robert
  2010-05-18 20:56 ` Matthew Garrett
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Garrett @ 2010-05-18 18:07 UTC (permalink / raw)
  To: linux-acpi; +Cc: robert.moore, lenb, Matthew Garrett

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.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/acpi/acpica/hwvalid.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index e26c17d..ddfb4f1 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -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);
-- 
1.7.0.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] ACPI: Ignore the upper bits of SystemIO addresses
  2010-05-18 18:07 [PATCH] ACPI: Ignore the upper bits of SystemIO addresses Matthew Garrett
@ 2010-05-18 18:50 ` Moore, Robert
  2010-05-18 20:56 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Moore, Robert @ 2010-05-18 18:50 UTC (permalink / raw)
  To: Matthew Garrett, linux-acpi@vger.kernel.org; +Cc: lenb@kernel.org

Ok, will backport to ACPICA.
Thanks,
Bob


>-----Original Message-----
>From: Matthew Garrett [mailto:mjg@redhat.com]
>Sent: Tuesday, May 18, 2010 11:07 AM
>To: linux-acpi@vger.kernel.org
>Cc: Moore, Robert; lenb@kernel.org; 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.
>
>Signed-off-by: Matthew Garrett <mjg@redhat.com>
>---
> drivers/acpi/acpica/hwvalid.c |   17 ++++++++---------
> 1 files changed, 8 insertions(+), 9 deletions(-)
>
>diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
>index e26c17d..ddfb4f1 100644
>--- a/drivers/acpi/acpica/hwvalid.c
>+++ b/drivers/acpi/acpica/hwvalid.c
>@@ -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);
>--
>1.7.0.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: Ignore the upper bits of SystemIO addresses
  2010-05-18 18:07 [PATCH] ACPI: Ignore the upper bits of SystemIO addresses Matthew Garrett
  2010-05-18 18:50 ` Moore, Robert
@ 2010-05-18 20:56 ` Matthew Garrett
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2010-05-18 20:56 UTC (permalink / raw)
  To: linux-acpi; +Cc: robert.moore, lenb

Actually, let's ignore this one for now - it makes more sense for this 
to be a conditional workaround.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-18 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18 18:07 [PATCH] ACPI: Ignore the upper bits of SystemIO addresses Matthew Garrett
2010-05-18 18:50 ` Moore, Robert
2010-05-18 20:56 ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).