tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Adding a virtual disk to mpii(4)



After adding a virtual disk to an mfii(4) device (racadm createvirtualdisk, 
in my case), you get a nice
	mfii0: logical drive 2 added (target 2)
message, but
	scsictl scsibus0 scan 2 0
doesn't find any drive.

That's because sc_ld[i].ld_present is still unset from mfii_attach() and so 
mfii_scsipi_request() will return early (with xs->error = XS_SELTIMEOUT).

The attached fix seems pretty dammn obvious and appears to work.

Shall I file a PR?
Index: sys/dev/pci/mfii.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/mfii.c,v
retrieving revision 1.3.2.7
diff -u -p -r1.3.2.7 mfii.c
--- sys/dev/pci/mfii.c	29 Sep 2022 14:41:43 -0000	1.3.2.7
+++ sys/dev/pci/mfii.c	21 Sep 2023 13:38:43 -0000
@@ -1373,6 +1373,7 @@ mfii_aen_ld_update(struct mfii_softc *sc
 		if (old == -1 && nld != -1) {
 			printf("%s: logical drive %d added (target %d)\n",
 			    DEVNAME(sc), i, nld);
+			sc->sc_ld[i].ld_present = 1;
 
 			// XXX scsi_probe_target(sc->sc_scsibus, i);
 
@@ -1381,6 +1382,7 @@ mfii_aen_ld_update(struct mfii_softc *sc
 		} else if (nld == -1 && old != -1) {
 			printf("%s: logical drive %d removed (target %d)\n",
 			    DEVNAME(sc), i, old);
+			sc->sc_ld[i].ld_present = 0;
 
 			scsipi_target_detach(&sc->sc_chan, i, 0, DETACH_FORCE);
 			sysmon_envsys_sensor_detach(sc->sc_sme,


Home | Main Index | Thread Index | Old Index