From patchwork Wed Jun 4 15:55:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "David E. Box" X-Patchwork-Id: 4295151 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD9D6BEEA7 for ; Wed, 4 Jun 2014 15:58:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F205120260 for ; Wed, 4 Jun 2014 15:58:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A8EF20254 for ; Wed, 4 Jun 2014 15:58:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320AbaFDP6E (ORCPT ); Wed, 4 Jun 2014 11:58:04 -0400 Received: from mga09.intel.com ([134.134.136.24]:36460 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbaFDP6D (ORCPT ); Wed, 4 Jun 2014 11:58:03 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 04 Jun 2014 08:52:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.98,973,1392192000"; d="scan'208";a="522676857" Received: from pathfinder.jf.intel.com ([10.7.198.145]) by orsmga001.jf.intel.com with ESMTP; 04 Jun 2014 08:58:02 -0700 From: "David E. Box" To: rjw@rjwysocki.net, lenb@kernel.org Cc: Randy Wright , 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 Message-Id: <1401897359-28873-1-git-send-email-david.e.box@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Wright 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 Signed-off-by: David E. Box --- 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);