mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: Matthew Garrett <mjg59@srcf.ucam.org>,
	platform-driver-x86@vger.kernel.org
Cc: Azael Avalos <coproscefalo@gmail.com>,
	Thomas Renninger <trenn@suse.de>,
	linux-kernel@vger.kernel.org,
	Seth Forshee <seth.forshee@canonical.com>
Subject: [PATCH 3/3] toshiba_acpi: Refuse to load on machines with buggy INFO implementations
Date: Mon,  5 Mar 2012 21:30:33 -0600	[thread overview]
Message-ID: <1331004633-11862-4-git-send-email-seth.forshee@canonical.com> (raw)
In-Reply-To: <1331004633-11862-1-git-send-email-seth.forshee@canonical.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 <seth.forshee@canonical.com>
---
 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 f995e6e..b420389f 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 293a320..95ce3a1 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 621b207..b6d0566 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
 
@@ -1263,6 +1265,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");
-- 
1.7.9


  parent reply	other threads:[~2012-03-06  3:30 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 19:44 [PATCH v3 0/4] toshiba_acpi: Expanded hotkey support Seth Forshee
2012-01-18 19:44 ` [PATCH v3 1/4] ACPI: EC: Add ec_get_handle() Seth Forshee
2012-01-18 19:44 ` [PATCH v3 2/4] toshiba_acpi: Support alternate hotkey interfaces Seth Forshee
2012-01-18 19:44 ` [PATCH v3 3/4] toshiba_acpi: Support additional hotkey scancodes Seth Forshee
2012-01-18 19:44 ` [PATCH v3 4/4] toshiba_acpi: Refuse to load on machines with buggy INFO implementations Seth Forshee
2012-02-06 15:06 ` [PATCH v3 0/4] toshiba_acpi: Expanded hotkey support Seth Forshee
2012-02-06 15:15   ` Matthew Garrett
2012-02-10 16:56     ` Seth Forshee
2012-02-22 21:43       ` Seth Forshee
2012-03-05 22:04     ` Seth Forshee
2012-03-05 23:01       ` Randy Dunlap
2012-03-05 23:34         ` Seth Forshee
2012-03-06  0:55           ` Randy Dunlap
2012-03-06  3:20             ` Seth Forshee
2012-03-06  3:30       ` [PATCH v4 0/3] " Seth Forshee
2012-03-06  3:30         ` [PATCH v4 1/3] toshiba_acpi: Support alternate hotkey interfaces Seth Forshee
2012-03-06  3:30         ` [PATCH 2/3] toshiba_acpi: Support additional hotkey scancodes Seth Forshee
2012-03-06  3:30         ` Seth Forshee [this message]
2012-03-09 18:06         ` [PATCH v4 0/3] Expanded hotkey support Seth Forshee
2012-03-12 14:06         ` Matthew Garrett
2012-03-15 15:51           ` Seth Forshee
2012-03-15 16:10             ` 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=1331004633-11862-4-git-send-email-seth.forshee@canonical.com \
    --to=seth.forshee@canonical.com \
    --cc=coproscefalo@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=trenn@suse.de \
    /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

all inboxes | Powered by JetHome®