Skip to contentSkip to conversation

Problems with wlan on a 1005HA-M

Debian-eeepc-devel Alan Jenkins 1 participant 2 messages Aug 20, 2009 – Aug 28, 2009 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 15 lines · Karsten Jaeger

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:

Quoted 6 lines

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

drivers/platform/x86/eeepc-laptop.c +19 -11
index 222ffb8..1790103 100644
@@ -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");

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 50 lines · Karsten Jaeger

Hi Alan!

Quoted 13 lines · Alan Jenkins
Quoted 12 lines · Karsten Jaeger

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:

Quoted 7 lines
Quoted 3 lines

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.

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.

I do think about it before, but because it worked before upgrading, I am not serios that this is the same.

Quoted 2 lines

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

Yes, I can.

Quoted 5 lines

<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.

There also was an libc update. Not only the kernel-update. So I can't really say, what exactly causes the problem.

Quoted 4 lines

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.

For now, I do an downgrade to 2.6.30 solve the WLAN-problem, it's more needed as LAN. LAN doesn't work by now, but maybe in a few days after the new 2.6.30 is uploaded.

Quoted 6 lines

I give the test.patch a try on the weekend and get you informed.

Thanks very much,
Karsten

PS: Sorry Alan, I have to look more carefully on the TO-Header. ;-/

No worries, I've lost count how many times I did that myself.

2.6.31 is fast approaching and this is a bad regression. Please let me know if it's fixed by the test patch I sent you earlier.

If that doesn't work, the safest approach is to revert my buggy code[1]. I've attached the reversions as a patch you can test.

Thanks
Alan

[1] The change responsible was only intended to improve the case where you toggle the wireless half-way through hibernation. 2.6.31 can live without it.

drivers/platform/x86/eeepc-laptop.c +4 -40
index 222ffb8..5941c3f 100644
@@ -143,7 +143,6 @@ struct eeepc_hotk {
 	struct rfkill *bluetooth_rfkill;
 	struct rfkill *wwan3g_rfkill;
 	struct hotplug_slot *hotplug_slot;
-	struct work_struct hotplug_work;
 };
 
 /* The actual device the driver binds to */
@@ -192,7 +191,6 @@ static struct key_entry eeepc_keymap[] = {
  */
 static int eeepc_hotk_add(struct acpi_device *device);
 static int eeepc_hotk_remove(struct acpi_device *device, int type);
-static int eeepc_hotk_resume(struct acpi_device *device);
 static void eeepc_hotk_notify(struct acpi_device *device, u32 event);
 
 static const struct acpi_device_id eeepc_device_ids[] = {
@@ -209,7 +207,6 @@ static struct acpi_driver eeepc_hotk_driver = {
 	.ops = {
 		.add = eeepc_hotk_add,
 		.remove = eeepc_hotk_remove,
-		.resume = eeepc_hotk_resume,
 		.notify = eeepc_hotk_notify,
 	},
 };
@@ -661,12 +658,15 @@ 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_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct pci_dev *dev;
 	struct pci_bus *bus = pci_find_bus(0, 1);
 	bool blocked;
 
+	if (event != ACPI_NOTIFY_BUS_CHECK)
+		return;
+
 	if (!bus) {
 		pr_warning("Unable to find PCI bus 1?\n");
 		return;
@@ -697,14 +697,6 @@ static void eeepc_hotplug_work(struct work_struct *work)
 	rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
 }
 
-static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
-{
-	if (event != ACPI_NOTIFY_BUS_CHECK)
-		return;
-
-	schedule_work(&ehotk->hotplug_work);
-}
-
 static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
 {
 	static struct key_entry *key;
@@ -877,32 +869,6 @@ static int eeepc_hotk_remove(struct acpi_device *device, int type)
 	return 0;
 }
 
-static int eeepc_hotk_resume(struct acpi_device *device)
-{
-	if (ehotk->wlan_rfkill) {
-		bool wlan;
-
-		/* Workaround - it seems that _PTS disables the wireless
-		   without notification or changing the value read by WLAN.
-		   Normally this is fine because the correct value is restored
-		   from the non-volatile storage on resume, but we need to do
-		   it ourself if case suspend is aborted, or we lose wireless.
-		 */
-		wlan = get_acpi(CM_ASL_WLAN);
-		set_acpi(CM_ASL_WLAN, wlan);
-
-		rfkill_set_sw_state(ehotk->wlan_rfkill, wlan != 1);
-
-		schedule_work(&ehotk->hotplug_work);
-	}
-
-	if (ehotk->bluetooth_rfkill)
-		rfkill_set_sw_state(ehotk->bluetooth_rfkill,
-				    get_acpi(CM_ASL_BLUETOOTH) != 1);
-
-	return 0;
-}
-
 /*
  * Hwmon
  */
@@ -1094,8 +1060,6 @@ static int eeepc_rfkill_init(struct device *dev)
 {
 	int result = 0;
 
-	INIT_WORK(&ehotk->hotplug_work, eeepc_hotplug_work);
-
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
 	eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");