Leedberg.com

The online home for Greg Leedberg, since 1995.

Sunday, November 06, 2005

Linux / WiFi / USB / FireWire: A Deadly Combination

For all two of you that read my My Computers blog, you'll know that I recently built a third computer, "Waldorf", out of parts that have been recycled out of other computers. There was one new component to Waldorf -- a Linksys 802.11g wireless LAN card. In the process of building this computer, I ran into a massive, confusing, week-long problem. Surprisingly, the problem had nothing to do with the process of setting up the WiFi card itself. I've done this before (in my laptop), and now know the secret process of getting a wireless LAN connection to work under Linux. The problem here was much more enigmatic.

Upon first boot, all was well. Wireless was working, USB was working, everything was working. I had no sound card installed, since I don't have a spare sound card currently. But everything that was installed worked fine.

Then I rebooted. Suddenly, weird things start happening. During bootup I got "IRQ #11 disabled" messages, then various error messages related to the WiFi card. Once booted, the wireless connection no longer worked, nor did USB. I tinkered around with lots of settings, kept rebooting, but after each boot the same strange problems would occur.

The next day, I booted up from a cold start, and everything worked fine again. Phew, problem must have been transient. Then I played with some settings, and rebooted.

And the problems came right back.

The problem, it appears, only occurs on reboots -- not cold starts. Very strange. But this is only the first strange thing to occur.

I did some Googling and found that this specific problem ("Disabling IRQ #11") is frequently caused by ACPI in the BIOS, and so you should disable it when booting the Linux kernel. I tried this, but discovered that since my BIOS is pre-2000, the ACPI support in the kernel was being disabled by default, so this wasn't the problem.

I tried 2 different distributions of Linux -- Fedora Core 3 and Fedora Core 4. Same problem on both. I tried several different kernels for both. Same problem on every kernel I tried.

Upon more Googling (I was now on page ~30 of the results), I learned that IRQ 11 is shared between all of the PCI devices, as well as USB and Firewire. In many cases this is caused by having a Wireless card and sound card. I don't have a sound card, so this simplified my debugging.

From what I could gather, what was probably happening was that the USB driver was loading, and grabbing IRQ 11, seemingly randomly. Since my WiFi card is PCI, it needs IRQ 11 as well, so when the WiFi driver tries to load, it can't communicate with the device, which ends up disabling the WLAN connection and also degrading USB performance.

I disabled USB in my BIOS. On first try, this seemed to work. However, on subsequent boots, the problem kept appearing. I tried to disable the USB subsystem from loading by playing around with the boot scripts for Linux, but no matter what I tried, it seemed that the USB system would try and load.

I tried to do the same thing for FireWire (I don't have any FireWire devices). However, as with USB, it seemed that nothing I did would prevent the driver from loading.

I was able to look at the system boot messages and actually see the ohci (usb/ firewire) system loading and outputting the fact that it was grabbing IRQ 11. I've never been so stressed out -- seeing it do it, but not being able to stop it.

In the end, I'm sorry to say that I have no solution to offer here -- I certainly was hoping this would be a "how-to" post, not a "I have no idea what just happened" post. I decided to just not reboot the machine. It's a secondary machine anyways, so I'll just turn it on and turn it off. I find it completely inexplicable that this problem only happens on reboots.

I'm posting this with two hopes. One, so that anyone else who runs into this problem will at least have an idea of what I tried, what didn't work, and what information on possible causes I was able to collect online. Two, so that if anyone else has this problem and finds a way around it, they can let me know!

I love Linux, but it's partially because of things like this that I took Linux off of Fozzie, my primary machine.