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

From: Mukker, Atul
Date: Tue Jan 25 2005 - 11:31:22 EST


>
> > After the new logical drives are created with "- - -" written to the
> > scsi_host scan attribute, there is a highly noticeable delay before
> device
> > names (e.g., sda) appears in the /dev directory. If the management
> > application tried to access the device immediately after creating new,
> the
> > access fails. Putting a 1 second delay helped, but of course this is not
> a
> > deterministic solution.
> >
> > What are the other possibilities?
>
> Well, how about hotplug. The device addition actually triggers a hot
> plug event already (there's no need to add anything, it's done by the
> mid-layer), so if you just listen for that, you'll know when the scan
> has detected a device.


After writing the "- - -" to the scan attribute, the management applications
assume the udev has created the relevant entries in the /dev directly and
try to use the devices _immediately_ and fail to see the devices

Is there a hotplug event which would tell the management applications that
the device nodes have actually been created now and ready to be used?

I tried this simple script to re-create the failure. Assume there is one
scsi disk, which is the installation disk. Now load the megaraid driver,
with a few logical drive already created.

# insmod megaraid_mm.ko; insmod megaraid_mbox.ko; ls -l /dev/sd*
<driver loads>
<not all scsi devices are available>

<try again after a brief delay>
# ls -l /dev/sd* # all devices show up now

Thanks
-Atul
-
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/