svn commit: r203867 - stable/8/sys/dev/siis

Alexander Motin mav at FreeBSD.org
Sun Feb 14 12:24:13 UTC 2010


Author: mav
Date: Sun Feb 14 12:24:12 2010
New Revision: 203867
URL: http://svn.freebsd.org/changeset/base/203867

Log:
  MFp4:
  After last running command completed, give commands in timeout state
  second time.

Modified:
  stable/8/sys/dev/siis/siis.c

Modified: stable/8/sys/dev/siis/siis.c
==============================================================================
--- stable/8/sys/dev/siis/siis.c	Sun Feb 14 12:10:49 2010	(r203866)
+++ stable/8/sys/dev/siis/siis.c	Sun Feb 14 12:24:12 2010	(r203867)
@@ -1056,6 +1056,28 @@ siis_process_timeout(device_t dev)
 	}
 }
 
+/* Must be called with channel locked. */
+static void
+siis_rearm_timeout(device_t dev)
+{
+	struct siis_channel *ch = device_get_softc(dev);
+	int i;
+
+	mtx_assert(&ch->mtx, MA_OWNED);
+	for (i = 0; i < SIIS_MAX_SLOTS; i++) {
+		struct siis_slot *slot = &ch->slot[i];
+
+		/* Do we have a running request on slot? */
+		if (slot->state < SIIS_SLOT_RUNNING)
+			continue;
+		if ((ch->toslots & (1 << i)) == 0)
+			continue;
+		callout_reset(&slot->timeout,
+		    (int)slot->ccb->ccb_h.timeout * hz / 1000,
+		    (timeout_t*)siis_timeout, slot);
+	}
+}
+
 /* Locked by callout mechanism. */
 static void
 siis_timeout(struct siis_slot *slot)
@@ -1216,8 +1238,9 @@ siis_end_transaction(struct siis_slot *s
 				siis_issue_read_log(dev);
 		}
 	/* If all the reset of commands are in timeout - abort them. */
-	} else if ((ch->rslots & ~ch->toslots) == 0)
-		siis_process_timeout(dev);
+	} else if ((ch->rslots & ~ch->toslots) == 0 &&
+	    et != SIIS_ERR_TIMEOUT)
+		siis_rearm_timeout(dev);
 }
 
 static void


More information about the svn-src-stable-8 mailing list