Telling Linux that a SATA device has gone away
I have a laptop (Dell Latitude D610) that has a removable DVD drive. It appears to be a PATA device, but is presented under ata_piix so behaves like a SCSI drive. With the ACPI generic hotkey driver, I can get events when it's removed and reinserted. Is there any way I can tell Linux that the device has been removed? hdparm's bus registration support (unsurprisingly) doesn't seem to work too well on sr0, but echoing "remove-single-device 1 0 0 0" to /proc/scsi/scsi doesn't seem to do anything either.
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 2 lines · Matthew Garrett
the device has been removed? hdparm's bus registration support (unsurprisingly) doesn't seem to work too well on sr0
It won't work on hd* either. 2.4-ac supports drive plugging but nothing else ever did. For the SATA case see Jeff's sata status page 8) and join in the fun. Most of what is needed is already there.
Alan
Quoted 3 lines · Alan Cox
It won't work on hd* either. 2.4-ac supports drive plugging but nothing else ever did. For the SATA case see Jeff's sata status page 8) and join in the fun. Most of what is needed is already there.
Ok. The machine in question has an ICH6 controller, which is in theory capable of hotplugging. However, the ahci driver fails to load with ENOMEM and so I end up with ata_piix. According to
http://linux.yyz.us/sata/software-status.html#hotplug , this /doesn't/ support hotplug. Now, Windows seems to be dealing somehow - it's entirely happy with the drive vanishing without warning. This confuses me a little.
Is there any hope of 2.6 gaining IDE hotswap? Given how easy it is to capture removal events with ACPI, it would be nice to be able to do something useful with it (rather than just tending to crash the machine)
Signature · 1 line
Matthew Garrett | [email protected]
Quoted 3 lines
Is there any hope of 2.6 gaining IDE hotswap? Given how easy it is to capture removal events with ACPI, it would be nice to be able to do something useful with it (rather than just tending to crash the machine)
For the SATA layer I see no real barriers. The core scsi code/block code can handle it all now without the trickery 2.4-ac IDE had to do. The scsi layer itself is happy with drive hot unplug (witness just how much better 2.6 USB storage is than 2.4).
Handling drive removal is essetially a case of not issuing more commands to it and cleaning up the others as they error out, something the layer handles ok.
New drive attachment means running the entire probe state machine for the drive and the essential commands (figure out the modes, clipping, power management, set up modes etc). Thats more complex for PATA where adding one drive can require reprogramming the other.
Porting the 2.4 old IDE code is probably 2-3 weeks work and I doubt worth it long term.