diff mbox

[Debian-eeepc-devel] Problems with wlan on a 1005HA-M

Message ID 9b2b86520908200638y75c0c80cm4faf9a5c67b61397@mail.gmail.com (mailing list archive)
State RFC, archived
Headers show

Commit Message

Alan Jenkins Aug. 20, 2009, 1:38 p.m. UTC
On 8/20/09, Karsten Jaeger <lists@oss42.com> wrote:
> Hi there,
>
> I've just ask in IRC for help and was ask to write it to the list.
>
> Last week I bought my EeePC 1005HA-M. It comes with Windows and Ubuntu
> Installation, everything works fine.
> Because my favorite OS is Debian I install it on the EeePC with
> Standard-Lenny and kernel linux-image-2.6.31-rc5, updating it to sid and
> everything worked fine. I updated it last sunday with latest sid and
> kernel linux-image-2.6.31-rc6, put in in sleep mode (which worked fine
> before) and want to restart it again on monday but nothing worked, I
> have a black screen and it do not return from sleep. So I do an cold reboot.
> After that, my wlan said, it have an segmentation fault and also gives
> the line back:
>
> SIOCSIFFLAGS: Unknown error 132
> Because I want to change some more, I do reinstalling it all, but since
> than, I can't get wlan to work again.
>
> As attachment I give you some files, that I do think are nessesary. If
> you need more, just give a hint.

That looks like the new rfkill error code.  Basically it means the
wireless has been disabled.  I guess the segmentation fault is a
userspace bug, unless you also see a BUG message in dmesg.

You should definitely be able to re-enable the wireless using the BIOS
setup screen... try these instructions:

<http://www.1-script.com/forums/wireless-card-and-camera-no-longer-work-or-show-in-hardware-article46509--25.htm>

Are you able to confirm that this happens just by upgrading the
kernel?  If so, there's only one eeepc-laptop commit between -rc5 and
-rc6, and I'm afraid it's mine.

I re-wrote it again for 2.6.32 in a slightly more sensible way.  If
we're lucky, your problem is fixed by the re-write and it can be
expedited for 2.6.31.  I've attached the relevant changes as a test
patch; it should apply cleanly to 2.6.31-rc6.

Regards
Alan
diff mbox

Patch

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 222ffb8..1790103 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -143,7 +143,7 @@  struct eeepc_hotk {
 	struct rfkill *bluetooth_rfkill;
 	struct rfkill *wwan3g_rfkill;
 	struct hotplug_slot *hotplug_slot;
-	struct work_struct hotplug_work;
+	struct mutex hotplug_lock;
 };
 
 /* The actual device the driver binds to */
@@ -661,24 +661,31 @@  static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
 	return 0;
 }
 
-static void eeepc_hotplug_work(struct work_struct *work)
+static void eeepc_rfkill_hotplug(void)
 {
 	struct pci_dev *dev;
-	struct pci_bus *bus = pci_find_bus(0, 1);
-	bool blocked;
+	struct pci_bus *bus;
+	bool blocked = eeepc_wlan_rfkill_blocked();
+
+	rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
+
+	mutex_lock(&ehotk->hotplug_lock);
 
+	if (ehotk->hotplug_slot == NULL)
+		goto out_unlock;
+
+	bus = pci_find_bus(0, 1);
 	if (!bus) {
 		pr_warning("Unable to find PCI bus 1?\n");
-		return;
+		goto out_unlock;
 	}
 
-	blocked = eeepc_wlan_rfkill_blocked();
 	if (!blocked) {
 		dev = pci_get_slot(bus, 0);
 		if (dev) {
 			/* Device already present */
 			pci_dev_put(dev);
-			return;
+			goto out_unlock;
 		}
 		dev = pci_scan_single_device(bus, 0);
 		if (dev) {
@@ -694,7 +701,8 @@  static void eeepc_hotplug_work(struct work_struct *work)
 		}
 	}
 
-	rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
+out_unlock:
+	mutex_unlock(&ehotk->hotplug_lock);
 }
 
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
@@ -702,7 +710,7 @@  static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 	if (event != ACPI_NOTIFY_BUS_CHECK)
 		return;
 
-	schedule_work(&ehotk->hotplug_work);
+	eeepc_rfkill_hotplug();
 }
 
 static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
@@ -893,7 +901,7 @@  static int eeepc_hotk_resume(struct acpi_device *device)
 
 		rfkill_set_sw_state(ehotk->wlan_rfkill, wlan != 1);
 
-		schedule_work(&ehotk->hotplug_work);
+		eeepc_rfkill_hotplug();
 	}
 
 	if (ehotk->bluetooth_rfkill)
@@ -1094,7 +1102,7 @@  static int eeepc_rfkill_init(struct device *dev)
 {
 	int result = 0;
 
-	INIT_WORK(&ehotk->hotplug_work, eeepc_hotplug_work);
+	mutex_init(&ehotk->hotplug_lock);
 
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");