*/
if (!NCR5380_select(instance, tmp)) {
- break;
+ /* OK or bad target */
} else {
+ /* Need to retry */
LIST(tmp, hostdata->issue_queue);
tmp->host_scribble = (unsigned char *) hostdata->issue_queue;
hostdata->issue_queue = tmp;
done = 0;
dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main(): select() failed, returned to issue_queue\n", instance->host_no);
}
+ if (hostdata->connected ||
+ hostdata->selecting)
+ break;
/* lock held here still */
} /* if target/lun is not busy */
} /* for */
tmp = (struct scsi_cmnd *) hostdata->selecting;
/* Selection will drop and retake the lock */
if (!NCR5380_select(instance, tmp)) {
- /* Ok ?? */
+ /* OK or bad target */
} else {
/* RvC: device failed, so we wait a long time
this is needed for Mustek scanners, that
cmd_get_tag(tmp, tmp->cmnd[0] != REQUEST_SENSE);
#endif
if (!NCR5380_select(instance, tmp)) {
+ /* OK or bad target */
local_irq_disable();
hostdata->retain_dma_intr--;
- /* release if target did not response! */
maybe_release_dma_irq(instance);
local_irq_restore(flags);
- break;
} else {
+ /* Need to retry */
local_irq_disable();
LIST(tmp, hostdata->issue_queue);
SET_NEXT(tmp, hostdata->issue_queue);
local_irq_restore(flags);
dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, "
"returned to issue_queue\n", HOSTNO);
- if (hostdata->connected)
- break;
}
+ if (hostdata->connected)
+ break;
} /* if target/lun/target queue is not busy */
} /* for issue_queue */
} /* if (!hostdata->connected) */