From patchwork Thu Mar 29 17:02:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 149437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 18D67B6EEF for ; Fri, 30 Mar 2012 04:02:43 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDIk1-0002G1-1a; Thu, 29 Mar 2012 17:02:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDIjx-0002EU-LR for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 17:02:25 +0000 Received: from 64-126-113-183.dyn.everestkc.net ([64.126.113.183] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SDIjx-0002Ro-Cd for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 17:02:25 +0000 From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/5][Precise] UBUNTU: SAUCE: (drop after 3.3) toshiba_acpi: Refuse to load on machines with buggy INFO implementations Date: Thu, 29 Mar 2012 12:02:08 -0500 Message-Id: <1333040528-26202-6-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1333040528-26202-1-git-send-email-seth.forshee@canonical.com> References: <1333040528-26202-1-git-send-email-seth.forshee@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Several Satellite models have a buggy implementation of the INFO method that causes ACPI exceptions when executed: ACPI Error: Result stack is empty! State=ffff88012d70f800 (20110413/dswstate-98) ACPI Exception: AE_AML_NO_RETURN_VALUE, Missing or null operand (20110413/dsutils-646) ACPI Exception: AE_AML_NO_RETURN_VALUE, While creating Arg 0 (20110413/dsutils-763) ACPI Error: Method parse/execution failed [\_SB_.VALZ.GETE] (Node ffff880131175eb0), AE_AML_NO_RETURN_VALUE (20110413/psparse-536) ACPI Error: Method parse/execution failed [\_SB_.VALZ.INFO] (Node ffff880131175ed8), AE_AML_NO_RETURN_VALUE (20110413/psparse-536) toshiba_acpi: ACPI INFO method execution failed toshiba_acpi: Failed to query hotkey event All known machines with this implementation also have a WMI interface with event GUID 59142400-C6A3-40FA-BADB-8A2652834100 which is not seen on any other models. Refuse to load toshiba_acpi on machines with this guid. Signed-off-by: Seth Forshee Signed-off-by: Matthew Garrett (cherry picked from commit f11f999e989061952f1a27bd0c49645a46d13173) BugLink: http://bugs.launchpad.net/bugs/810015 --- drivers/platform/x86/Kconfig | 1 + drivers/platform/x86/Makefile | 4 ++++ drivers/platform/x86/toshiba_acpi.c | 10 ++++++++++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 1f503de..5e99ce9 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig @@ -580,6 +580,7 @@ config TOPSTAR_LAPTOP config ACPI_TOSHIBA tristate "Toshiba Laptop Extras" depends on ACPI + depends on ACPI_WMI select LEDS_CLASS select NEW_LEDS depends on BACKLIGHT_CLASS_DEVICE diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile index a49c891..f23b49b 100644 --- a/drivers/platform/x86/Makefile +++ b/drivers/platform/x86/Makefile @@ -29,7 +29,11 @@ obj-$(CONFIG_ACPI_WMI) += wmi.o obj-$(CONFIG_MSI_WMI) += msi-wmi.o obj-$(CONFIG_ACPI_ASUS) += asus_acpi.o obj-$(CONFIG_TOPSTAR_LAPTOP) += topstar-laptop.o + +# toshiba_acpi must link after wmi to ensure that wmi devices are found +# before toshiba_acpi initializes obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o + obj-$(CONFIG_TOSHIBA_BT_RFKILL) += toshiba_bluetooth.o obj-$(CONFIG_INTEL_SCU_IPC) += intel_scu_ipc.o obj-$(CONFIG_INTEL_SCU_IPC_UTIL) += intel_scu_ipcutil.o diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index e3e1fa6..ee79ce6 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -63,6 +63,8 @@ MODULE_AUTHOR("John Belmonte"); MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); MODULE_LICENSE("GPL"); +#define TOSHIBA_WMI_EVENT_GUID "59142400-C6A3-40FA-BADB-8A2652834100" + /* Scan code for Fn key on TOS1900 models */ #define TOS1900_FN_SCAN 0x6e @@ -1249,6 +1251,14 @@ static int __init toshiba_acpi_init(void) { int ret; + /* + * Machines with this WMI guid aren't supported due to bugs in + * their AML. This check relies on wmi initializing before + * toshiba_acpi to guarantee guids have been identified. + */ + if (wmi_has_guid(TOSHIBA_WMI_EVENT_GUID)) + return -ENODEV; + toshiba_proc_dir = proc_mkdir(PROC_TOSHIBA, acpi_root_dir); if (!toshiba_proc_dir) { pr_err("Unable to create proc dir " PROC_TOSHIBA "\n");