public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: carlos@strangeworlds.co.uk
Cc: aceracpi@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [PATCH] acer-wmi: don't bother loading on unsupported systems
Date: Mon, 6 Apr 2009 09:40:16 -0400	[thread overview]
Message-ID: <200904060940.16889.jarod@redhat.com> (raw)

Its both a waste of system resources to load this driver on unsupported
systems (which happens often, due to the *Acer* dmi modalias wildcard),
and actually causes problems -- we wind up with a sysfs rfkill entry
that is always disabled, which throws things like NetworkManager for a
loop, causing it to think your wireless card isn't available, even
though the *real* rfkill entry for the card says it is. This is
triggering on multiple Acer Aspire One's here in the office, like so:

NetworkManager: <info> starting...
NetworkManager: <WARN> nm_generic_enable_loopback(): error -17 returned from rtnl_addr_add():#012Sucess#012
NetworkManager: <info> Found radio killswitch /org/freedesktop/Hal/devices/platform_acer_wmi_rfkill_acer_wireless_wlan
NetworkManager: <info> Found radio killswitch /org/freedesktop/Hal/devices/pci_8086_423a_rfkill_5350AGN_wlan
NetworkManager: <info> (eth0): new Ethernet device (driver: 'r8169')
NetworkManager: <info> (eth0): exported as /org/freedesktop/Hal/devices/net_00_1e_68_8a_a1_f8
NetworkManager: <info> (wlan0): driver supports SSID scans (scan_capa 0x01).
NetworkManager: <info> (wlan0): new 802.11 WiFi device (driver: 'iwlagn')
NetworkManager: <info> (wlan0): exported as /org/freedesktop/Hal/devices/net_00_16_eb_04_31_ea
NetworkManager: <info> Trying to start the supplicant...
NetworkManager: <info> Trying to start the system settings daemon...
NetworkManager: <info> Wireless now disabled by radio killswitch
NetworkManager: <info> (wlan0): supplicant manager state: down -> idle

So have acer-wmi just bail on unsupported systems -- includes only my
particular model of the Aspire One atm, but a larger list of unsupported
systems can be found here:

http://code.google.com/p/aceracpi/wiki/SupportedHardware

This might well become unnecessary once the WMI sysfs interface mentioned in
acer-wmi.c exists and the wild-card dmi modalias is gone, but for now... I
prefer to have working wireless, and this isn't exactly an obvious root
cause. I lack the hardware to further extend the blacklist, but doing so is
trivial. Whether or not loading acer-wmi actually negatively impacts
machines other than the AAO is unknown at this time.

Signed-off-by: Jarod Wilson <jarod@redhat.com>

---
 drivers/platform/x86/acer-wmi.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index a6a42e8..eda7eea 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -355,6 +355,25 @@ static struct dmi_system_id acer_quirks[] = {
 	{}
 };
 
+static int __init acer_wmi_unsupported_callback(const struct dmi_system_id *id)
+{
+	printk(ACER_INFO "%s not supported by Acer Laptop ACPI-WMI Extras\n",
+	       id->ident);
+	return 1;
+}
+
+static const struct dmi_system_id __initdata acer_wmi_unsupported[] = {
+	{
+		.callback = acer_wmi_unsupported_callback,
+		.ident = "Acer Aspire One",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+		},
+	},
+	{}
+};
+
 /* Find which quirks are needed for a particular vendor/ model pair */
 static void find_quirks(void)
 {
@@ -1252,6 +1271,10 @@ static int __init acer_wmi_init(void)
 {
 	int err;
 
+	/* Check for unsupported systems and bail */
+	if (dmi_check_system(acer_wmi_unsupported))
+		return -ENODEV;
+
 	printk(ACER_INFO "Acer Laptop ACPI-WMI Extras\n");
 
 	find_quirks();

-- 
Jarod Wilson
jarod@redhat.com

             reply	other threads:[~2009-04-06 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 13:40 Jarod Wilson [this message]
2009-04-06 19:53 ` [PATCH] acer-wmi: don't bother loading on unsupported systems Carlos Corbacho
2009-04-06 20:04   ` Jarod Wilson

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=200904060940.16889.jarod@redhat.com \
    --to=jarod@redhat.com \
    --cc=aceracpi@googlegroups.com \
    --cc=carlos@strangeworlds.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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