30c30 < __FBSDID("$FreeBSD: src/sys/dev/ata/ata-queue.c,v 1.29 2004/06/01 12:26:08 sos Exp $"); --- > __FBSDID("$FreeBSD: /repoman/r/ncvs/src/sys/dev/ata/ata-queue.c,v 1.34 2004/08/27 14:48:32 sos Exp $"); 72a73 > untimeout((timeout_t *)ata_timeout,request,request->timeout_handle); 121c122 < request->retries = -1; --- > request->retries = 0; 163,170d163 < /* lock the ATA HW for this request */ < mtx_lock(&ch->queue_mtx); < ch->locking(ch, ATA_LF_LOCK); < if (!ATA_LOCK_CH(ch)) { < mtx_unlock(&ch->queue_mtx); < return; < } < 171a165 > mtx_lock(&ch->queue_mtx); 179a174,175 > > /* if we have work todo, try to lock the ATA HW and start transaction */ 180a177,182 > ch->locking(ch, ATA_LF_LOCK); > if (!ATA_LOCK_CH(ch)) { > mtx_unlock(&ch->queue_mtx); > return; > } > 195,199d196 < } < < /* unlock ATA channel HW */ < ATA_UNLOCK_CH(ch); < ch->locking(ch, ATA_LF_UNLOCK); 201,202c198 < /* if we have a request here it failed and should be completed */ < if (request) --- > /* finish up this (failed) request */ 203a200 > } 210a208 > struct ata_channel *ch = request->device->channel; 212a211,216 > /* if we timed out the unlocking of the ATA channel is done later */ > if (!(request->flags & ATA_R_TIMEOUT)) { > ATA_UNLOCK_CH(ch); > ch->locking(ch, ATA_LF_UNLOCK); > } > 214c218 < if (request->device->channel->flags & ATA_IMMEDIATE_MODE) { --- > if (ch->flags & ATA_IMMEDIATE_MODE) { 237,240c241,242 < < /* if negative retry count just give up and unlock channel HW */ < if (request->retries < 0) { < if (!(request->flags & ATA_R_QUIET)) --- > /* workarounds for devices failing to interrupt */ > if (!request->status) { 244c246,253 < request->result = EIO; --- > request->result = ENXIO; > ATA_UNLOCK_CH(channel); > channel->locking(channel, ATA_LF_UNLOCK); > } > else if (request->status == (ATA_S_READY | ATA_S_DSC)) { > ata_prtdev(request->device, > "WARNING - %s no interrupt but good status\n", > ata_cmd2str(request)); 249d257 < 425,429c433 < printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); < // Changed by Israel Herraiz, in order to avoid locks after resume from ACPI suspend < // Dangerous??? < request->retries++; < --- > printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); 465c469,487 < return; --- > } > > void > ata_catch_inflight(struct ata_channel *ch) > { > struct ata_request *request = ch->running; > > ch->running = NULL; > if (request) { > untimeout((timeout_t *)ata_timeout, request, request->timeout_handle); > ata_prtdev(request->device, > "WARNING - %s requeued due to channel reset", > ata_cmd2str(request)); > if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL))) > printf(" LBA=%llu", (unsigned long long)request->u.ata.lba); > printf("\n"); > request->flags |= ATA_R_REQUEUE; > ata_queue_request(request); > } 490,492c512 < ATA_UNLOCK_CH(request->device->channel); < request->device->channel->locking(request->device->channel, < ATA_LF_UNLOCK); --- > ch->running = NULL;