From: Eric W. Biederman > I've just done some investigating, possibly duplicating work, > and dug into the IDE spinup issue. My conclusion, the Linux > kernel is buggy.
To be fair - the Linux kernel doesn't usually have to handle IDE spin up on boot, as this occurs during BIOS initialization. I do wonder how well Linux handles the case where a drive is configured to spin-down after some time. I suspect not at all well :). > IDE spinup is trivial. From my testing all you have to do > is wait until the ide busy bit is clear, and then send > commands. IDE drives do all of the hard work for you. Cool - this matches up with my (admitted faint) memory :). > The tricky part with IDE is to get a reliable drive detection > routine, as this was not an initial design requirement. > > I believe I have accomplished that as well. What I do. After the > busy bit is clear send the IDE channel a software reset. Then I read > the signature bytes from each drive, and if the signature is correct > I have found an IDE drive. I confirm this by read/writing some > registers and veirfying the contents stick. This will require wider > testing to confirm it really is reliable. > > After you know where you have drives running > IDENTIFY_DEVICE/IDENTIFY_PACKET_DEVICE where appropriate is still > needed to get the drive into a usable state. But having confirmed > already that the drive exists this is much easier. > > Anyway after I do a little more code cleanup I will check this code > into the LinuxBIOS tree. > > What I do know. My code handles IDE drive spinup when the kernel > fails, and the kernel doesn't have any trouble after my code has run. You (or someone) might want to submit this code to Linux.
