Ignore:
Timestamp:
Aug 31, 2011, 11:23:46 PM (14 years ago)
Author:
cjm
Message:

OS2AHCI Version 1.19
====================

  • Added retry counters to all commands (IORBs) in order to prevent infinite retry loops. This was necessary because Virtualbox 4.x doesn't seem to set the "current command index" in specific ATAPI error situations, causing the failing command to be retried indefinitely instead of asking for a sense buffer
  • Minor changes to debug logging
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/os2ahci/ctxhook.c

    r87 r121  
    128128        /* get "current command slot"; only valid if there are no NCQ cmds */
    129129        ccs = (int) ((readl(port_mmio + PORT_CMD) >> 8) & 0x0f);
     130        ddprintf(" PORT_CMD      = 0x%x\n", ccs);
    130131
    131132        for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
     
    143144              ai->ports[p].reg_cmds &= ~(1UL << aws->cmd_slot);
    144145              if (aws->cmd_slot == ccs) {
    145                 /* this is the non-NCQ comand that failed */
     146                /* this is the non-NCQ command that failed */
    146147                problem_iorb = iorb;
    147148              }
    148149            }
    149150            /* we can requeue all IORBs unconditionally (see function comment) */
    150             iorb_requeue(iorb);
     151            if (aws->retries++ < MAX_RETRIES) {
     152              iorb_requeue(iorb);
     153
     154            } else {
     155              /* retry count exceeded; consider IORB aborted */
     156              iorb_seterr(iorb, IOERR_CMD_ABORTED);
     157              iorb_queue_del(&ai->ports[p].iorb_queue, iorb);
     158              iorb_queue_add(&done_queue, iorb);
     159              if (iorb == problem_iorb) {
     160                /* no further analysis -- we're done with this one */
     161                problem_iorb = NULL;
     162              }
     163            }
    151164          }
    152165        }
     
    352365        /* retry or abort all remaining active commands on this port */
    353366        for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) {
     367          ADD_WORKSPACE _far *aws = add_workspace(iorb);
    354368          next = iorb->pNxtIORB;
    355           if (add_workspace(iorb)->queued_hw) {
     369
     370          if (aws->queued_hw) {
    356371            /* this IORB had already been queued to HW when we reset the port */
    357             if (add_workspace(iorb)->idempotent) {
    358               /* We can retry this IORB; just reset its status and it will be
    359                * picked up by subsequent trigger_engine() calls.
    360                */
     372            if (aws->idempotent && aws->retries++ < MAX_RETRIES) {
     373              /* we can retry this IORB */
    361374              iorb_requeue(iorb);
    362375
Note: See TracChangeset for help on using the changeset viewer.