RE: How to add/drop SCSI drives from within the driver?

From: Mukker, Atul
Date: Thu Dec 09 2004 - 09:20:57 EST



> > >The real way I'd like to handle this is via hotplug. The hotplug
> > >event would transmit the HCTL in the environment.
> > >Whether the drive actually gets incorporated into the system and
> > >where is user policy, so it's appropriate that it should be in
> > >userland.
> >
> > James, it is the application that is adding the drive. So
> it is not a
> > hotplug event for the driver.
>
> Then perhaps I don't understand what the issue is. If the
> application is adding the drive, then surely it would know
> the numbers. If not, then the driver must communicate this
> back, and that's what the hotplug would be about.
>
> James
>
>
Let me elaborate it.

1. The management applications decide to created new logical drives or
remove some of the existing ones.

2. How applications would do this, is by sending commands to the megaraid
firmware via driver. Driver does not intercept these commands for a simple
reason that the driver code would become unnecessarily bulky to understanad
all the possible ways applications can change the number of logical devices.

3. Once the change in configuration has happened, someone must notify kernel
about new or removed devices.

4. Since megaraid driver does not know about these changes, it cannot notify
kernel.

5. So this becomes the responsibility of the application which caused the
change in configuration. Application dilemma is, all it know is it created a
few devices and removed some. But there is no way for it to relate the
affected devices with the way how kernel was or would be seeing them, that
is, the affected device's scsi address. Remember, the affected devices are
only logical, there is no physical bus, target, lun associated with them.
Driver creates this mapping on the fly.

6. That's where application seeks help from driver and requests for the scsi
address driver would be using for the affected devices.

7. Once it has the scsi address for the devices in question, depending on
the application and system administrator's preference, application would
either use sysfs to add/remove affected devices or cause a hotplug event
resulting in the configured behavior.

8. So, all driver has to do to assist applications is to provide the logical
drive number to scsi address mapping. Application would say, hey! I
added/removed logical drive number 5, driver reverts, here is the scsi
address for it "host:2, channel:5, target:5 lun:0" :-)

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