public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David E. Box" <david.e.box@linux.intel.com>
To: rjw@rjwysocki.net, lenb@kernel.org
Cc: Randy Wright <rwright@hp.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ACPI: Fix bug when acpi reset register is implemented in system memory
Date: Wed,  4 Jun 2014 08:55:59 -0700	[thread overview]
Message-ID: <1401897359-28873-1-git-send-email-david.e.box@linux.intel.com> (raw)

From: Randy Wright <rwright@hp.com>

Use acpi_os_map_generic_address to pre-map the reset register if it is memory
mapped, thereby preventing https://bugzilla.kernel.org/show_bug.cgi?id=77131

Signed-off-by: Randy Wright <rwright@hp.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/acpi/osl.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 6776c59..5325844 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -1798,6 +1798,19 @@ acpi_status __init acpi_os_initialize(void)
 	acpi_os_map_generic_address(&acpi_gbl_FADT.xpm1b_event_block);
 	acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe0_block);
 	acpi_os_map_generic_address(&acpi_gbl_FADT.xgpe1_block);
+	if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) {
+		/*
+		 * Use acpi_os_map_generic_address to pre-map the reset
+		 * register if it's in system memory, thereby preventing
+		 * https://bugzilla.kernel.org/show_bug.cgi?id=77131
+		 */
+		int rv;
+		struct acpi_generic_address *reset_reg
+			= &acpi_gbl_FADT.reset_register;
+		rv = acpi_os_map_generic_address(reset_reg);
+		pr_info(PREFIX
+			"%s: map reset_reg status %d\n", __func__, rv);
+	}
 
 	return AE_OK;
 }
@@ -1826,6 +1839,8 @@ acpi_status acpi_os_terminate(void)
 	acpi_os_unmap_generic_address(&acpi_gbl_FADT.xgpe0_block);
 	acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1b_event_block);
 	acpi_os_unmap_generic_address(&acpi_gbl_FADT.xpm1a_event_block);
+	if (acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER)
+		acpi_os_unmap_generic_address(&acpi_gbl_FADT.reset_register);
 
 	destroy_workqueue(kacpid_wq);
 	destroy_workqueue(kacpi_notify_wq);
-- 
1.7.10.4


             reply	other threads:[~2014-06-04 15:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 15:55 David E. Box [this message]
2014-06-05 12:58 ` [PATCH] ACPI: Fix bug when acpi reset register is implemented in system memory Rafael J. Wysocki

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=1401897359-28873-1-git-send-email-david.e.box@linux.intel.com \
    --to=david.e.box@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rwright@hp.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