summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2000-10-09 19:54:54 +0000
committergibbs <gibbs@FreeBSD.org>2000-10-09 19:54:54 +0000
commit873869f78cae7dde730641c0cee234e65f1764a2 (patch)
treeded5c7d6872d22e6480308f971f4f651fbc1b202
parentf46adaf572d02ece2fdf79088d06e1801bb5f7d9 (diff)
downloadFreeBSD-src-873869f78cae7dde730641c0cee234e65f1764a2.zip
FreeBSD-src-873869f78cae7dde730641c0cee234e65f1764a2.tar.gz
Close a race condition that doesn't really exist in -current. When
a resource shortage occurs, freeze our queue and then set the resource shortage flag while the controller data structure is locked. The old code did these in the wrong order potentially allowing our interrupt handler to release the queue and clear the flag before the freeze ever occurred.
-rw-r--r--sys/dev/aic7xxx/aic7xxx_freebsd.c2
-rw-r--r--sys/dev/aic7xxx/aic7xxx_osm.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx_freebsd.c b/sys/dev/aic7xxx/aic7xxx_freebsd.c
index 04d83b9..eb56508 100644
--- a/sys/dev/aic7xxx/aic7xxx_freebsd.c
+++ b/sys/dev/aic7xxx/aic7xxx_freebsd.c
@@ -433,9 +433,9 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
ahc_lock(ahc, &s);
if ((scb = ahc_get_scb(ahc)) == NULL) {
+ xpt_freeze_simq(sim, /*count*/1);
ahc->flags |= AHC_RESOURCE_SHORTAGE;
ahc_unlock(ahc, &s);
- xpt_freeze_simq(sim, /*count*/1);
ccb->ccb_h.status = CAM_REQUEUE_REQ;
xpt_done(ccb);
return;
diff --git a/sys/dev/aic7xxx/aic7xxx_osm.c b/sys/dev/aic7xxx/aic7xxx_osm.c
index 04d83b9..eb56508 100644
--- a/sys/dev/aic7xxx/aic7xxx_osm.c
+++ b/sys/dev/aic7xxx/aic7xxx_osm.c
@@ -433,9 +433,9 @@ ahc_action(struct cam_sim *sim, union ccb *ccb)
ahc_lock(ahc, &s);
if ((scb = ahc_get_scb(ahc)) == NULL) {
+ xpt_freeze_simq(sim, /*count*/1);
ahc->flags |= AHC_RESOURCE_SHORTAGE;
ahc_unlock(ahc, &s);
- xpt_freeze_simq(sim, /*count*/1);
ccb->ccb_h.status = CAM_REQUEUE_REQ;
xpt_done(ccb);
return;
OpenPOWER on IntegriCloud