Bugzilla – Bug 136866
IDE crashed on hdparm -U
Last modified: 2005-12-14 15:14:48 UTC
To support device hotswap we have to execute 'hdparm -U' to remove the drive from the IDE layer. This results in a kernel oops.
Created attachment 59784 [details] hotswap.oops Dmesg output with the oops.
Created attachment 59786 [details] ide-cd.diff Patch to fix ide-cd.
The above patch tries to fix this. The first hunk shouldn't be needed (strictly speaking), as it's just a quick exit in case the door status hasn't changed. The second and the third hunk are an obvious fix. One should not call any function from a _remove call which tries to access the device and expect this call to succeed. The device is already halfway gone at this point. The fourth hunk is the most interesting. Someone is removing the driver_data pointer from underneath us. As this pointer is basically the backlink to the encompassing data structure we don't actually have any information lost and can just restore the pointer. Main point still stands: Who is removing the pointer? I couldn't see anything obvious; the most obvious candidate (ie ide_cd_release) is called during the remove calls only and is out of the race. Greg, any ideas?
Hannes, I think that looks pretty hackish :-) Hotplug isn't really supported in the pata ide driver (not sata, for that matter). It likely needs a lot more fixing to work reliably.
Yes, that is pretty hackish. It just corrects the most glaring errors within the IDE core. Unless someone really digs into it and actually rewrites the IDE driver to be driver core conformant proper hotplug support is not going to happen.