Bug 136866 - IDE crashed on hdparm -U
Summary: IDE crashed on hdparm -U
Status: RESOLVED WONTFIX
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Kernel (show other bugs)
Version: Alpha 3plus
Hardware: x86 Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Jens Axboe
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-05 08:55 UTC by Hannes Reinecke
Modified: 2005-12-14 15:14 UTC (History)
2 users (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
hotswap.oops (21.92 KB, text/plain)
2005-12-05 08:55 UTC, Hannes Reinecke
Details
ide-cd.diff (2.08 KB, patch)
2005-12-05 09:10 UTC, Hannes Reinecke
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Reinecke 2005-12-05 08:55:16 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.
Comment 1 Hannes Reinecke 2005-12-05 08:55:55 UTC
Created attachment 59784 [details]
hotswap.oops

Dmesg output with the oops.
Comment 4 Hannes Reinecke 2005-12-05 09:10:01 UTC
Created attachment 59786 [details]
ide-cd.diff

Patch to fix ide-cd.
Comment 5 Hannes Reinecke 2005-12-05 09:16:30 UTC
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?
Comment 6 Jens Axboe 2005-12-12 15:45:51 UTC
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.
Comment 10 Hannes Reinecke 2005-12-14 15:14:48 UTC
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.