Skip to contentSkip to conversation

EeePC 1005PE rfkill fix

PATCH In review Paul Brook 2 participants 3 messages Jan 28, 2010

Subsystems (3)
lore
Share & tools
lore

Paul Brook

author
#0 lore raw

PATCH 1/1 EeePC 1005PE rfkill fix

The EeePC 1005PE has the wireless card on PCI bus 2.

---
Same as before, but without mail client mangling the patch.

I couldn't figure out a smart way of figuring out the correct bus, so I hardcoded the device name. lspci and acpi dumps available at
http://www.pbrook80.webspace.virginmedia.com/

My guess is that the 1005HA is configured similarly, however I don't have hardware to test. The preceding comments imply that the 1005HA does not require the pci hotplug bits. On my 1005PE the hotplug bits are definitely required (the device stops responding when the rfkill is activated), we just need to make sure we disable the right bus. PCI bus 1 contains the wired Ethernet controller.

 drivers/platform/x86/eeepc-laptop.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
drivers/platform/x86/eeepc-laptop.c +12 -3
index e2be6bb..6b53701 100644
@@ -161,6 +161,7 @@ struct eeepc_laptop {
 					   by this BIOS */
 	bool cpufv_disabled;
 	bool hotplug_disabled;
+	int hotplug_bus;
 	u16 event_count[128];		/* count for each event */
 
 	struct platform_device *platform_device;
@@ -585,9 +586,10 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
 	mutex_lock(&eeepc->hotplug_lock);
 
 	if (eeepc->hotplug_slot) {
-		bus = pci_find_bus(0, 1);
+		bus = pci_find_bus(0, eeepc->hotplug_bus);
 		if (!bus) {
-			pr_warning("Unable to find PCI bus 1?\n");
+			pr_warning("Unable to find PCI bus %d?\n",
+				   eeepc->hotplug_bus);
 			goto out_unlock;
 		}
 
@@ -695,7 +697,7 @@ static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
 static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc)
 {
 	int ret = -ENOMEM;
-	struct pci_bus *bus = pci_find_bus(0, 1);
+	struct pci_bus *bus = pci_find_bus(0, eeepc->hotplug_bus);
 
 	if (!bus) {
 		pr_err("Unable to find wifi PCI bus\n");
@@ -1281,6 +1283,13 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
 		eeepc->hotplug_disabled = true;
 		pr_info("wlan hotplug disabled\n");
 	}
+
+	/* The eeepc 1005PE has the wireless chip on the second PCIe bus.  */
+	if (strcmp(model, "1005PE") == 0) {
+	    eeepc->hotplug_bus = 2;
+	} else {
+	    eeepc->hotplug_bus = 1;
+	}
 }
 
 static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
Signature · 1 line
1.6.6
maintainer
#1 lore raw
Quoted 69 lines · Paul Brook

The EeePC 1005PE has the wireless card on PCI bus 2.

---
Same as before, but without mail client mangling the patch.

I couldn't figure out a smart way of figuring out the correct bus, so I hardcoded the device name. lspci and acpi dumps available at
http://www.pbrook80.webspace.virginmedia.com/

My guess is that the 1005HA is configured similarly, however I don't have hardware to test. The preceding comments imply that the 1005HA does not require the pci hotplug bits. On my 1005PE the hotplug bits are definitely required (the device stops responding when the rfkill is activated), we just need to make sure we disable the right bus. PCI bus 1 contains the wired Ethernet controller.

 drivers/platform/x86/eeepc-laptop.c |   15 ++++++++++++---

 1 files changed, 12 insertions(+), 3 deletions(-)
drivers/platform/x86/eeepc-laptop.c +0 -0
index e2be6bb..6b53701 100644
@@ -161,6 +161,7 @@ struct eeepc_laptop {

                                          by this BIOS */ bool cpufv_disabled;
       bool hotplug_disabled;
+       int hotplug_bus;
       u16 event_count[128];           /* count for each event */

       struct platform_device *platform_device;

drivers/platform/x86/eeepc-laptop.c +11 -4
@@ -585,9 +586,10 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc)
        mutex_lock(&eeepc->hotplug_lock);
 
        if (eeepc->hotplug_slot) {
-               bus = pci_find_bus(0, 1);
+               bus = pci_find_bus(0, eeepc->hotplug_bus);
                if (!bus) {
-                       pr_warning("Unable to find PCI bus 1?\n");
+                       pr_warning("Unable to find PCI bus %d?\n",
+                                  eeepc->hotplug_bus);
                        goto out_unlock;
                }
 
@@ -695,7 +697,7 @@ static struct hotplug_slot_ops eeepc_hotplug_slot_ops = {
  static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc)
  {
        int ret = -ENOMEM;
-       struct pci_bus *bus = pci_find_bus(0, 1);
+       struct pci_bus *bus = pci_find_bus(0, eeepc->hotplug_bus);
 
        if (!bus) {
                pr_err("Unable to find wifi PCI bus\n");
@@ -1281,6 +1283,13 @@ static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
                eeepc->hotplug_disabled = true;
                pr_info("wlan hotplug disabled\n");
        }
+
+       /* The eeepc 1005PE has the wireless chip on the second PCIe bus.  */
+       if (strcmp(model, "1005PE") == 0) {
+           eeepc->hotplug_bus = 2;
+       } else {
+           eeepc->hotplug_bus = 1;
+       }
  }
 
  static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
--
Quoted 1 line

1.6.6

Hi Paul,
First did you try your patch with an updated bios ?
It's weird that 1005HA and 1005PE don't have the same behavior :/. Any objection about this patch someone ?
If not, I'll add it to acpi4asus tree, but it may not be included in 2.6.33. Thanks,

Signature · 6 lines
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#2 lore raw
Quoted 1 line

First did you try your patch with an updated bios ?

Good point. The updated bios seems to behave better (the same as the 1005HA), so consider the original patch withdrawn. We just need to add 1005PE to the existing blacklist.

Paul

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com