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

Lukasz Kosewski
2005-10-03T15:19:58Z

Hey Alan,

On 9/28/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> For PATA the requirements I'm aware of are
>
> - Interface for user to say "am about to swap"

You mean something like "echo scsi-remove-single-device a b c d" >
/proc/scsi/scsi? I guess the sysfs equivalent?

> - Interface for user to say "have swapped"

I suppose ditto.

> - Must quiesce both master and slave before swap (or one per cable)

The way I've written my infrastructure, this seems as if it'll just
require another carefully placed hook function.

> - Must reset to PIO_SLOW and then recompute modes for both devices
> becuse it is possible that changing one changes the other timings

This shouldn't be hard since I already do a similar reset by resetting
udma_flags to a pre-init state. Probably in an if (!(ap->flags &
ATA_FLAG_SATA)).

> - The above is true for *unplug* too. A straight unplug may speed up the
> other drive!
> - Post hotswap need to reconfigure both drives as if from scratch

Hmm, this seems far more complicated... basically during a swap
operation, we have to shut down all I/O to the other drive on the
cable (if there is one), if I read you correctly, and then reconfigure
both drives once one is plugged in.

>From what you're saying, it seems to me that the infrastructure I put
forth will work as is, plus some if statements and extraneous
PATA-only functions (and functionality like shutting down the other
disk on the cable until the user calls the 'warm-swap complete'
function').

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?

Luke