It Takes Two Hollidays to NOT Fix a Bug

Last Holliday, Easter, I was testing the last Linux tree, after 2.6.30-rc1 was released. After building it, I booted it using kexec, wonderful tool if you want to avoid some boot delay.

As usual, it had its hiccups. The most obvious one was that my ethernet driver did not load. It had problems loading the EEPROM contents. Although I was at my parents' and I would not use my ethernet device, the message in the log and the result (no eth0) were so obvious, I could not avoid digging it.

After days and nights bisecting, reading code, patching, building, testing, I find out that the bug has been in Linux since long ago, it was hit because I was using kexec to load the kernel and it was in the executing kernel, not in the loaded/booted one.

It happens that the shutdown function for the e100 driver puts the device in a deep sleep state and it does not come back properly in the probe function in the next kernel.

So, I had to work on two bugs: shut the device down properly and recover from a deeply sleeping device when probing. The first one was easy, and this Holliday, I've just submitted a second version, which is very likely to go to someone's tree.

However, I have tried lots of things to get the device back working after a deep shutdown. The same thing is done when suspending the device and it comes back properly after a resume. Even when doing hibernation, it has worked for many releases. In fact, it has worked even when using kexec in some conditions that have put me in a goose chase when first looking at the bug.

Although I still has to look closer into the issue of waking up device in a deep state when probing after a kexec, it will probably be possible to kexec from Linux 2.6.30 and get your e100 still working. As a side effect, I have also studied about the PCI and Power Management systems in Linux and submitted some trivial patches fixing some typos and a series I may speak about later.