Re: [PATCH] [RFC] Advanced TCA SCSI Disk Hotswap

From: Jeff Garzik (jgarzik@pobox.com)
Date: Thu Oct 24 2002 - 19:20:49 EST


Steven Dake wrote:

> Montavista has discussed at length Compact PCI hotswap using surprise
> removal events.
>
> The key feature of any hotswap operation that happens in a surprise
> fashion is that
> the device driver might want a hint that the hardware is no longer
> present so it can
> immediatly dump its buffers/io maps/etc and totally stop accessing the
> device. An
> expected removal, on the other hand, would give the device driver time
> to flush its
> buffers (for example a scsi driver could dump its outstanding queued
> scsi messages).
> Once the driver is done accessing the device, the blue led on the
> CompactPCI board
> can be lit and it can be removed.
>
> This is the main difference. Since the driver model of Linux doesn't
> support a surprise
> extract method call for drivers, I don't think its been implemented
> here. Further the
> drivers must be modified to actually use the hint instead of doing its
> normal shutdown
> operation.

Wrong. The _only_ supported method so far has been surprise removal.
 For years now. This happens every day in the land of CardBus, which
was the first "PCI" hotplug implementation in the Linux kernel. PCI
HotPlug introduces a new, non-surprise removal.

Thus, the current model should be assumed to be surprise removal, and
you need an additional notification from the system if a "nice" removal
is about to occur.

> Surprise extraction is not a simple problem especially to ensure the
> device drivers exit
> cleanly without dumping more data on the PCI bus to a PCI device that
> may not
> exist.

PCI is electrically safe. Reads to non-existent areas return
0xffffffff, etc. Take a look at net drivers some day, we have been
handling this for years.

Surprise removal is actually easier from many perspectives -- you don't
have to worry about quiescing the hardware, you simply have to error out
all I/Os, and clean up the kernel structures that are left behind (host
info, device info, etc.). The non-surprise removal is more annoying, in
that you could potentially have an indefinite wait (and must actively
avoid such a situation) while shutting down the hardware, completing
I/Os, etc.

    Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:25 EST