From patchwork Tue May 27 17:28:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 4250591 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 746A5BF90B for ; Tue, 27 May 2014 17:28:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8155B202EB for ; Tue, 27 May 2014 17:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B11F202E5 for ; Tue, 27 May 2014 17:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbaE0R22 (ORCPT ); Tue, 27 May 2014 13:28:28 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:54628 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753108AbaE0R2Z (ORCPT ); Tue, 27 May 2014 13:28:25 -0400 Received: by mail-pb0-f50.google.com with SMTP id ma3so9630425pbc.37 for ; Tue, 27 May 2014 10:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=slrmuUX3brSVxbJTB7DvKGjEANupF4buaTI89FYDGAI=; b=y7DwqGdNZjfDxMb7QJPyTnG2ALverbY0MZwABB1sJeoY9HIKATXggGYsTTe/4zk56P ewZ+3FT6HBomrz4GZNUG33DV4D1Ti5f/qTqq8wYmj9Pj+C8ORImLc5ewZZVSPxAhwMq5 sZyHbzBgj+Lc8m0jHNEMyyuIGxoijfSlWw51vtPCM9ZkSVVclUeqTH9vgZ+ZraUMtrim EsfJp1qtNwrXlCZBjApWhrUPnRZ9necwhpZSXjGFp6FrRuEV90UCtg+LPr8L+XhYTb56 dciJy8jrqFzlmE9U1sXrZ1hwr3qSfS5seusIWyH72v8FbbCzmPWt9U2+wVL/wqEsWmKV iXnQ== X-Received: by 10.68.197.39 with SMTP id ir7mr38698360pbc.78.1401211705180; Tue, 27 May 2014 10:28:25 -0700 (PDT) Received: from localhost.localdomain ([180.169.136.70]) by mx.google.com with ESMTPSA id io8sm24250934pbc.96.2014.05.27.10.28.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 May 2014 10:28:24 -0700 (PDT) From: Lv Zheng To: "Rafael J. Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , , linux-acpi@vger.kernel.org, Oswald Buddenhagen Subject: [RFC PATCH 3/6] ACPI: sleep: Update acpi_set_firmware_waking_vector() invocations to favor 32-bit firmware waking vector. Date: Wed, 28 May 2014 01:28:06 +0800 Message-Id: X-Mailer: git-send-email 1.7.10 In-Reply-To: References: <38907770.bupFXhytsS@vostro.rjw.lan> 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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: Lv Zheng This patch updates acpi_set_firmware_waking_vector() invocations in order to keep 32-bit firmware waking vector favor for Linux. 64-bit firmware waking vector has never been enabled by Linux. The (acpi_physical_address)0 for 64-bit address can be used to force ACPICA to set only 32-bit firmware waking vector for Linux. Signed-off-by: Lv Zheng Cc: Oswald Buddenhagen --- arch/ia64/include/asm/acpi.h | 1 + arch/x86/include/asm/acpi.h | 3 ++- drivers/acpi/sleep.c | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index 75dc59a..45e45ec 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h @@ -75,6 +75,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); extern int acpi_suspend_lowlevel(void); extern unsigned long acpi_wakeup_address; +#define acpi_wakeup_address64 ((acpi_physical_address)0) /* * Record the cpei override flag and current logical cpu. This is diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h index e06225e..46a7dd8 100644 --- a/arch/x86/include/asm/acpi.h +++ b/arch/x86/include/asm/acpi.h @@ -71,7 +71,8 @@ static inline void acpi_disable_pci(void) extern int (*acpi_suspend_lowlevel)(void); /* Physical address to resume after wakeup */ -#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start)) +#define acpi_wakeup_address ((acpi_physical_address)(real_mode_header->wakeup_start)) +#define acpi_wakeup_address64 ((acpi_physical_address)(0)) /* * Check if the CPU can handle C2 and deeper diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index c11e379..5ca7ab0 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -23,6 +23,8 @@ #include "internal.h" #include "sleep.h" +#define ACPI_NO_WAKING_VECTOR ((acpi_physical_address)0) + static u8 sleep_states[ACPI_S_STATE_COUNT]; static void acpi_sleep_tts_switch(u32 acpi_state) @@ -59,7 +61,8 @@ static int acpi_sleep_prepare(u32 acpi_state) if (acpi_state == ACPI_STATE_S3) { if (!acpi_wakeup_address) return -EFAULT; - acpi_set_firmware_waking_vector(acpi_wakeup_address); + acpi_set_firmware_waking_vector(acpi_wakeup_address, + acpi_wakeup_address64); } ACPI_FLUSH_CPU_CACHE(); @@ -403,7 +406,8 @@ static void acpi_pm_finish(void) acpi_leave_sleep_state(acpi_state); /* reset firmware waking vector */ - acpi_set_firmware_waking_vector((acpi_physical_address) 0); + acpi_set_firmware_waking_vector(ACPI_NO_WAKING_VECTOR, + ACPI_NO_WAKING_VECTOR); acpi_target_sleep_state = ACPI_STATE_S0;