linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: linux-acpi@vger.kernel.org
Cc: robert.moore@intel.com, lenb@kernel.org,
	Matthew Garrett <mjg@redhat.com>
Subject: [PATCH] ACPI: Ignore the upper bits of SystemIO addresses
Date: Tue, 18 May 2010 14:07:15 -0400	[thread overview]
Message-ID: <1274206035-10571-1-git-send-email-mjg@redhat.com> (raw)

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


             reply	other threads:[~2010-05-18 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 18:07 Matthew Garrett [this message]
2010-05-18 18:50 ` [PATCH] ACPI: Ignore the upper bits of SystemIO addresses Moore, Robert
2010-05-18 20:56 ` Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274206035-10571-1-git-send-email-mjg@redhat.com \
    --to=mjg@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).