AHD: Add a DELAY() in the XPT_RESET_BUS path to avoid a race.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 23 Jul 2009 09:06:24 +0000 (02:06 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 23 Jul 2009 09:06:24 +0000 (02:06 -0700)
The exact race isn't known but adding the DELAY() appears to fix
it.  It could be related to ccb's queued prior to the bus reset
which we have to abort.

With-help-from: Peter Avalos <pavalos@theshell.com>

sys/dev/disk/aic7xxx/aic79xx_osm.c

index 3d9afb9..430f48e 100644 (file)
@@ -549,6 +549,14 @@ ahd_action(struct cam_sim *sim, union ccb *ccb)
                        kprintf("SCSI bus reset delivered. "
                               "%d SCBs aborted.\n", found);
                }
+               /*
+                * There seems to be some sort of race  between the
+                * chipset and queueing new commands after a bus
+                * reset.  Add a DELAY().  Note: tsleep() cannot be
+                * used here because the ahd lock deadlocks the callout
+                * thread.
+                */
+               DELAY(100000);
                ccb->ccb_h.status = CAM_REQ_CMP;
                xpt_done(ccb);
                break;