Ignore:
Timestamp:
Feb 16, 2011, 7:10:13 PM (14 years ago)
Author:
chris
Message:

atapi.c:

  • Extended workaround for incorrect direction bits to "mode sense" commands; now there's no bus lockup and subsequent port reset during boot anymore.

ahci.c:

  • Fixed timeout handling -- we use milliseconds internally while the IORB uses seconds
  • Replaced IORB completion code with a macro to improve IORB debug logging

ctxhook.c:

  • Fixed an issue which would fail to clear a port command bit if the IORB in question was not the one that caused the port engine to stop. As a result, a subsequent sanity check caused an unecessary port reset. The result was that ejecting a CD via WPS' drive object would cause the next command to fail, a reset to occur and the tray to close again right away
  • Replaced IORB completion code with a macro to improve IORB debug logging
  • added spinlocks around aws_free()

os2ahci.c

  • Replaced IORB completion code with a macro to improve IORB debug logging
  • Improved IORB debug logging to make it easier to spot the lifetime of an IORB without having to read between the lines

os2ahci.h

  • Added macro to complete an IORB including the corresponding debug log
File:
1 edited

Legend:

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

    r74 r75  
    5555 *    given time (even if more are outstanding). This is the case for single
    5656 *    devices or port multipliers without FIS-based command switching. Error
    57  *    recovery is simple because we know which command has failed and can
    58  *    requeue all commands, replacing the failing command with a "request
    59  *    sense" command to get error details.
     57 *    recovery is simple because we know which command has failed and that
     58 *    all other commands have not yet started executing. Thus, we can requeue
     59 *    all of them, replacing the failing command with a "request sense"
     60 *    command to get error details.
    6061 *
    6162 *  - Multiple non-NCQ commands are executed on different devices behind a
     
    128129          if (aws->queued_hw) {
    129130            if (ai->ports[p].ncq_cmds & (1UL << aws->cmd_slot)) {
    130               /* NCQ commands active; force non-NCQ mode and trigger port reset */
     131              /* NCQ command; force non-NCQ mode and trigger port reset */
    131132              ai->ports[p].ncq_cmds &= ~(1UL << aws->cmd_slot);
    132133              aws->no_ncq = 1;
    133134              need_reset = 1;
    134             } else if (aws->cmd_slot == ccs) {
    135               /* this is the non-NCQ comand that failed */
     135            } else {
     136              /* regular command; clear cmd bit and identify problem IORB */
    136137              ai->ports[p].reg_cmds &= ~(1UL << aws->cmd_slot);
    137               problem_iorb = iorb;
     138              if (aws->cmd_slot == ccs) {
     139                /* this is the non-NCQ comand that failed */
     140                problem_iorb = iorb;
     141              }
    138142            }
     143            /* we can requeue all IORBs unconditionally (see function comment) */
    139144            iorb_requeue(iorb);
    140145          }
     
    184189            ADD_WORKSPACE _far *aws = add_workspace(problem_iorb);
    185190            int d = iorb_unit_device(problem_iorb);
    186             int (*req_sense)(IORBH _far *, int) =
    187               (ai->ports[p].devs[d].atapi) ? atapi_req_sense : ata_req_sense;
     191            int (*req_sense)(IORBH _far *, int) = (ai->ports[p].devs[d].atapi) ?
     192                                                  atapi_req_sense : ata_req_sense;
    188193
    189194            aws->processing = 1;
     
    214219  for (iorb = done_queue.root; iorb != NULL; iorb = next) {
    215220    next = iorb->pNxtIORB;
    216     if (iorb->RequestControl & IORB_ASYNC_POST) {
    217       iorb->NotifyAddress(iorb);
    218     }
     221
     222    spin_lock(drv_lock);
     223    aws_free(add_workspace(iorb));
     224    spin_unlock(drv_lock);
     225
     226    complete_iorb(iorb);
    219227  }
    220228
     
    355363  spin_unlock(drv_lock);
    356364
    357   /* call notification routine on all aborted IORBs */
     365  /* complete all aborted IORBs */
    358366  for (iorb = done_queue.root; iorb != NULL; iorb = next) {
    359367    next = iorb->pNxtIORB;
    360     iorb->Status = IORB_DONE | IORB_ERROR;
     368
     369    spin_lock(drv_lock);
    361370    aws_free(add_workspace(iorb));
    362     if (iorb->RequestControl & IORB_ASYNC_POST) {
    363       iorb->NotifyAddress(iorb);
    364     }
     371    spin_unlock(drv_lock);
     372
     373    iorb->Status = IORB_ERROR;
     374    complete_iorb(iorb);
    365375  }
    366376
     
    410420  }
    411421}
     422
Note: See TracChangeset for help on using the changeset viewer.