- Timestamp:
- Aug 31, 2011, 11:23:46 PM (14 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/ahci.c
r112 r121 1122 1122 if (func(iorb, 0) == 0) { 1123 1123 /* successfully prepared cmd; issue cmd and wait for completion */ 1124 ddprintf("executing polled cmd ...");1124 ddprintf("executing polled cmd on slot 0..."); 1125 1125 writel(port_mmio + PORT_CMD_ISSUE, 1); 1126 1126 timeout /= 10; -
trunk/src/os2ahci/ata.c
r112 r121 278 278 279 279 if (debug >= 2) { 280 printf("ATA command for %d.%d.%d :\n", ad_no(ai), p, d);280 printf("ATA command for %d.%d.%d, slot %d:\n", ad_no(ai), p, d, slot); 281 281 phex(cmd_hdr, offsetof(AHCI_CMD_HDR, reserved), "cmd_hdr: "); 282 282 phex(&ata_cmd, sizeof(ata_cmd), "ata_cmd: "); -
trunk/src/os2ahci/ctxhook.c
r87 r121 128 128 /* get "current command slot"; only valid if there are no NCQ cmds */ 129 129 ccs = (int) ((readl(port_mmio + PORT_CMD) >> 8) & 0x0f); 130 ddprintf(" PORT_CMD = 0x%x\n", ccs); 130 131 131 132 for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) { … … 143 144 ai->ports[p].reg_cmds &= ~(1UL << aws->cmd_slot); 144 145 if (aws->cmd_slot == ccs) { 145 /* this is the non-NCQ com and that failed */146 /* this is the non-NCQ command that failed */ 146 147 problem_iorb = iorb; 147 148 } 148 149 } 149 150 /* 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 } 151 164 } 152 165 } … … 352 365 /* retry or abort all remaining active commands on this port */ 353 366 for (iorb = ai->ports[p].iorb_queue.root; iorb != NULL; iorb = next) { 367 ADD_WORKSPACE _far *aws = add_workspace(iorb); 354 368 next = iorb->pNxtIORB; 355 if (add_workspace(iorb)->queued_hw) { 369 370 if (aws->queued_hw) { 356 371 /* 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 */ 361 374 iorb_requeue(iorb); 362 375 -
trunk/src/os2ahci/os2ahci.c
r117 r121 1248 1248 u16 no_ncq = aws->no_ncq; 1249 1249 u16 unaligned = aws->unaligned; 1250 u16 retries = aws->retries; 1250 1251 1251 1252 aws_free(aws); 1252 1253 memset(aws, 0x00, sizeof(*aws)); 1254 1253 1255 aws->no_ncq = no_ncq; 1254 1256 aws->unaligned = unaligned; 1257 aws->retries = retries; 1255 1258 } 1256 1259 -
trunk/src/os2ahci/os2ahci.h
r112 r121 82 82 /* default command timeout (can be overwritten in the IORB) */ 83 83 #define DEFAULT_TIMEOUT 30000 84 85 /* Maximum number of retries for commands in the restart/reset context hooks. 86 * 87 * Please note that the corresponding variable in the ADD workspace is a bit 88 * field, thus increasing this value means increasing the size of the bit 89 * field. At the time of writing this comment the 'retries' variable was 2 90 * bits wide (i.e. a maximum number of 3 retries) and there was exactly one 91 * bit left before the ADD workspace structure would become too large... 92 */ 93 #define MAX_RETRIES 3 84 94 85 95 /* max/min macros */ … … 354 364 unsigned complete : 1; /* IORB has completed processing */ 355 365 unsigned unaligned : 1; /* unaligned S/G; need to use transfer buffer */ 366 unsigned retries : 2; /* number of retries for this command */ 356 367 unsigned cmd_slot : 5; /* AHCI command slot for this IORB */ 357 368 } ADD_WORKSPACE; -
trunk/src/os2ahci/version.h
r116 r121 14 14 15 15 16 #define VERSION 11 8/* driver version (2 implied decimals) */16 #define VERSION 119 /* driver version (2 implied decimals) */ 17 17
Note:
See TracChangeset
for help on using the changeset viewer.