hi guys,
this makes mpii properly detach devices, which helps a lot if they
have commands in flight. to relevant changes are:
- call the activate(DVACT_DEACTIVATE) function against all the luns
on the target that is going away.
- issue the target reset BEFORE detaching the children devices.
this is needed now tha the midlayer will sleep until all outstanding
commands on a device come back from the adapter before calling the
child devices attach routine.
i have tested this on straight disks, but not on raid volumes. i
need someone to test disk removal behind a raid set before i can
commit it.
assuming testing goes well, can i get oks too?
dlg
Index: mpii.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/mpii.c,v
retrieving revision 1.35
diff -u -p -r1.35 mpii.c
--- mpii.c 23 Aug 2010 00:53:36 -0000 1.35
+++ mpii.c 24 Dec 2010 05:46:34 -0000
@@ -3417,6 +3417,8 @@ mpii_event_sas(struct mpii_softc *sc, st
mpii_remove_dev(sc, dev);
if (sc->sc_scsibus) {
SET(dev->flags, MPII_DF_DETACH);
+ scsi_activate(sc->sc_scsibus, dev->slot, -1,
+ DVACT_DEACTIVATE);
if (scsi_task(mpii_event_defer, sc,
dev, 0) != 0)
printf("%s: unable to run device "
@@ -3529,27 +3531,19 @@ mpii_event_defer(void *xsc, void *arg)
struct mpii_softc *sc = xsc;
struct mpii_device *dev = arg;
- /*
- * SAS and IR events are delivered separately, so it won't hurt
- * to wait for a second.
- */
- tsleep(sc, PRIBIO, "mpiipause", hz);
-
- if (!ISSET(dev->flags, MPII_DF_HIDDEN)) {
- if (ISSET(dev->flags, MPII_DF_ATTACH))
- scsi_probe_target(sc->sc_scsibus, dev->slot);
- else if (ISSET(dev->flags, MPII_DF_DETACH))
- scsi_detach_target(sc->sc_scsibus, dev->slot,
- DETACH_FORCE);
- }
-
if (ISSET(dev->flags, MPII_DF_DETACH)) {
mpii_sas_remove_device(sc, dev->dev_handle);
+ if (!ISSET(dev->flags, MPII_DF_HIDDEN)) {
+ scsi_detach_target(sc->sc_scsibus, dev->slot,
+ ...If testing goes well, ok krw@. Alas I don't have any to test.
ive had no takers on testing. i cant see how raid and sas events will race in the current code, so i think the 1second sleep to avoid confusion is unecessary. i will put it in and deal with fallout if it comes up.
Works for me. Full moral support from krw@.
i didn't look thru the diff yet, sorry for that.
the race you're talking about is that for IR enabled setups
you first get an event for SAS and then for IR, and the purpose
of the IR event handler is to set the MPII_DF_HIDDEN flag.
as you can see handling for SAS drives and volume drives is
different:
if (!ISSET(dev->flags, MPII_DF_HIDDEN)) {
if (ISSET(dev->flags, MPII_DF_ATTACH))
scsi_probe_target(sc->sc_scsibus, dev->slot);
else if (ISSET(dev->flags, MPII_DF_DETACH))
scsi_detach_target(sc->sc_scsibus, dev->slot,
DETACH_FORCE);
}
if (ISSET(dev->flags, MPII_DF_DETACH)) {
mpii_sas_remove_device(sc, dev->dev_handle);
free(dev, M_DEVBUF);
return;
}
we're not supposed to call scsi_detach_target on volume disks.
so your change looks wrong to me, iirc how it works.
i'll wire up an IR volume and muck around then. does this mean that the physical and logical disks have colliding or overlapping entries in the sc_devs array? dlg
no, the border value is controlled by sc_pd_id_start and sc_vd_id_low. a quick test would be pulling out a drive which is part of the mirror volume while doing io to it.
| Greg KH | Og dreams of kernels |
| Jens Axboe | [PATCH 31/33] Fusion: sg chaining support |
| Arnd Bergmann | Re: finding your own dead "CONFIG_" variables |
| Mark Brown | [PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset |
| Tony Breeds | [LGUEST] Look in object dir for .config |
git: | |
| Brian Downing | Re: Git in a Nutshell guide |
| John Benes | Re: master has some toys |
| Matthias Lederhofer | [PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree |
| Alexander Sulfrian | [RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set |
| Junio C Hamano | Re: Rss produced by git is not valid xml? |
| Linux Kernel Mailing List | iSeries: fix section mismatch in iseries_veth |
| Linux Kernel Mailing List | ixbge: remove TX lock and redo TX accounting. |
| Linux Kernel Mailing List | ixgbe: fix several counter register errata |
| Linux Kernel Mailing List | b43: fix build with CONFIG_SSB_PCIHOST=n |
| Linux Kernel Mailing List | 9p: block-based virtio client |
