make io device be a little nicer about scheduling retries on the bus
authorAli Saidi <saidi@eecs.umich.edu>
Wed, 31 May 2006 17:45:37 +0000 (13:45 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Wed, 31 May 2006 17:45:37 +0000 (13:45 -0400)
--HG--
extra : convert_revision : 19a1f0c7bf79d6d8ef235aae60cdbbbcb7de2b79

src/dev/io_device.cc

index 563fdb7593bf9eafa1e86cbf6cf63a5d3c34e308..adf41799c6b34635816513bc26d7d01b35be5112 100644 (file)
@@ -143,15 +143,19 @@ void
 DmaPort::recvRetry()
 {
     Packet* pkt = transmitList.front();
-    DPRINTF(DMA, "Retry on  Packet %#x with senderState: %#x\n",
-               pkt, pkt->senderState);
-    if (sendTiming(pkt)) {
-        DPRINTF(DMA, "-- Done\n");
-        transmitList.pop_front();
-        pendingCount--;
-        assert(pendingCount >= 0);
-    } else {
-        DPRINTF(DMA, "-- Failed, queued\n");
+    bool result = true;
+    while (result && transmitList.size()) {
+        DPRINTF(DMA, "Retry on  Packet %#x with senderState: %#x\n",
+                   pkt, pkt->senderState);
+        result = sendTiming(pkt);
+        if (result) {
+            DPRINTF(DMA, "-- Done\n");
+            transmitList.pop_front();
+            pendingCount--;
+            assert(pendingCount >= 0);
+        } else {
+            DPRINTF(DMA, "-- Failed, queued\n");
+        }
     }
 }
 
@@ -201,7 +205,7 @@ DmaPort::sendDma(Packet *pkt)
    if (state == Timing) {  */
        DPRINTF(DMA, "Attempting to send Packet %#x with senderState: %#x\n",
                pkt, pkt->senderState);
-       if (!sendTiming(pkt)) {
+       if (transmitList.size() || !sendTiming(pkt)) {
            transmitList.push_back(pkt);
            DPRINTF(DMA, "-- Failed: queued\n");
        } else {