Re: [PATCH 2/3] Add disk hotswap support to libata RESEND #5

Jeff Garzik
2005-10-03T15:53:33Z

Lukasz Kosewski wrote:
> How about this; I want this SATA hotswapping stuff to be tested, so
> I'll commit my patches for 'SATA only' for the time being. I'll stare
> at them for a while and then see what kind of PATA-specific if
> statements and hooks are necessary in the code?

Ideally we should just create hooks for any SATA-specific behavior, and
ensure that nothing SATA-specific is written into any of the core paths.

One of the SATA controllers, Intel ICH5 & ICH6, does not have a hotplug
interrupt, but yet supports "coldplug":

* user indicates to kernel, to disable the SATA port
* kernel says "OK, it's disabled"
* user disconnects hard drive
and
* SATA port is disabled
* user connects hard drive
* user indicates to kernel, to enable SATA port
* kernel says "OK, I've turned it on" and probes it

This is a real-world, high-volume SATA case, yet it functionally behaves
like PATA.

So that causes us to consider various entry points:

* {something}, be it a hot-unplug interrupt or user write(2) to sysfs,
tells us a device is gone
* {something}, be it a hot-plug interrupt or user write(2) to sysfs,
tells us a new device appeared

So for either SATA or PATA, it should look similar in the core: we just
need a "kick", a function call that triggers one of these two actions.
The handling of those actions [your code] should hopefully be pretty
generic. ;-)

Thanks for working on this!

Jeff