eeepc 1000h, rfkill hotkey freezes eeepc when switching off an active wireless connection

Bug #429635 reported by meijer.o
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Linux
Confirmed
Unknown
linux (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

When turning off the Wireless device with Fn+F2 on EeePC 1000h and others, usually the kernel
freezes completely.

Steps to reproduce:
1. Boot EeePC with WiFi off
2. Press Fn+F2: the blue WiFi feedback LED turns on and
3. After having established a connection to a wireless network, press the Fn+F2 again: the blue WiFi LED turns off and the system freezes. A hard reset is needed to restart the computer.

Workaround

Patch the kernel source, (eeepc-laptop.c) with this patch, see also this bug report: http://bugzilla.kernel.org/show_bug.cgi?id=13390. I tested it, it fixes the bug.
-----------------------------------------------------------------------------------------------------------------------------------
Avoid an eeepc-laptop/rt2860sta panic if associated when the hw disappears.

This is a workaround. It is expected to become unnecessary when rt2800pci
makes it into a kernel release.

Signed-off-by: Darren Salt <email address hidden>
-----------------------------------------------------------------------------------------------------------------------------------
--- ./drivers/platform/x86/eeepc-laptop.c.dist 2009-08-14 12:30:30.385461620 +0100
+++ ./drivers/platform/x86/eeepc-laptop.c 2009-08-14 16:33:17.113557519 +0100
@@ -32,6 +32,7 @@
 #include <linux/uaccess.h>
 #include <linux/input.h>
 #include <linux/rfkill.h>
+#include <linux/semaphore.h>
 #include <linux/pci.h>
 #include <linux/pci_hotplug.h>

@@ -139,6 +140,7 @@
  u16 event_count[128]; /* count for each event */
  struct input_dev *inputdev;
  u16 *keycode_map;
+ struct semaphore rfkill_sem;
  struct rfkill *wlan_rfkill;
  struct rfkill *bluetooth_rfkill;
  struct rfkill *wwan3g_rfkill;
@@ -223,6 +225,8 @@
  .get_power_status = eeepc_get_adapter_status,
 };

+static void eeepc_hotplug_work(struct work_struct *work);
+
 /* The backlight device /sys/class/backlight */
 static struct backlight_device *eeepc_backlight_device;

@@ -335,7 +339,16 @@
 static int eeepc_rfkill_set(void *data, bool blocked)
 {
  unsigned long asl = (unsigned long)data;
- return set_acpi(asl, !blocked);
+ int ret;
+
+ if (asl != CM_ASL_WLAN)
+ return set_acpi(asl, !blocked);
+
+ /* hack to avoid panic with rt2860sta */
+ if (blocked)
+ eeepc_hotplug_work(NULL);
+ ret = set_acpi(asl, !blocked);
+ return ret;
 }

 static const struct rfkill_ops eeepc_rfkill_ops = {
@@ -667,18 +680,20 @@
  struct pci_bus *bus = pci_find_bus(0, 1);
  bool blocked;

+ while (down_interruptible(&ehotk->rfkill_sem)) /**/;
+
  if (!bus) {
   pr_warning("Unable to find PCI bus 1?\n");
- return;
+ goto done;
  }

- blocked = eeepc_wlan_rfkill_blocked();
+ blocked = work ? eeepc_wlan_rfkill_blocked() : true;
  if (!blocked) {
   dev = pci_get_slot(bus, 0);
   if (dev) {
    /* Device already present */
    pci_dev_put(dev);
- return;
+ goto done;
   }
   dev = pci_scan_single_device(bus, 0);
   if (dev) {
@@ -695,6 +710,8 @@
  }

  rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
+done:
+ up(&ehotk->rfkill_sem);
 }

 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
@@ -849,6 +866,7 @@
  ehotk = kzalloc(sizeof(struct eeepc_hotk), GFP_KERNEL);
  if (!ehotk)
   return -ENOMEM;
+ sema_init(&ehotk->rfkill_sem, 1);
  ehotk->init_flag = DISABLE_ASL_WLAN | DISABLE_ASL_DISPLAYSWITCH;
  ehotk->handle = device->handle;
  strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME);

meijer.o (meijer-o)
description: updated
description: updated
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Hi meijer.o,

It's preferable for patches to be merged upstream first and then pulled into the Ubuntu kernel. Do you know if the author has submitted for inclusion upstream? As we're now approaching the kernel freeze for Karmic it's likely this may have to wait for Karmic+1 for either rt2800pci or this patch to be merged.

Just for some additional info, the following is a discussion that took place earlier regarding the rt2800pci driver being merged - http://www.linux-archive.org/ubuntu-kernel-team/336204-review-these-rt2x00-adds-rt2800pci.html

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in linux:
status: Unknown → Confirmed
Revision history for this message
Ilja Sekler (ilja-sekler-) wrote :

There is a fix for the rt2860sta driver in the upstream bug now, which applies cleanly to the 2.6.31-14.48 source:

<http://bugzilla.kernel.org/attachment.cgi?id=23368>

Any chance for including it into Karmic release? The present kernel panic is the worst user experience one could imagine.

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

As the ever-quotable mjg said about the Xorg kill keycombo:
"Everyone involved agreed that not having a keystroke that caused
 immediate data loss was a sensible idea." --Matthew Garrett

If you leave things as they are, you are doing precisely this--leaving a keystroke that causes immediate data loss. What's more, the key is *right next to the screen brightness buttons*. I've hit this key accidentally several times in the last few months, with the aforementioned consequences.

This needs high-priority and *some* sort of fix (make the switch work properly, make it not crash the machine, or make it not work at all), and it needs it before Karmic hits gold.

Revision history for this message
Ilja Sekler (ilja-sekler-) wrote :

Actually this is a dupe of <https://bugs.launchpad.net/ubuntu/+bug/404626>.

Revision history for this message
GiuseppeVerde (launchpad-digitasaru) wrote :

Indeed. So marked.

Revision history for this message
Sergio Callegari (callegar) wrote :

Is this fixed in the 2.6.31.15 that arrived today? Knowing would be quite useful to decide whether to continue staying with jaunty or not.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.