Reduced waiting time between retries of WRITE commands

This commit is contained in:
2011-12-30 14:27:45 +00:00
parent 8f725bab11
commit 4afaaf3fb6
4 changed files with 57 additions and 5 deletions

View File

@ -1671,8 +1671,18 @@ int scsi_eval_cmd_outcome(struct burn_drive *d, struct command *c, void *fp,
if (outcome == RETRY && c->retry && !(flag & 1)) {
/* Calming down retries and breaking up endless cycle
*/
usleep_time = Libburn_scsi_retry_usleeP +
loop_count * Libburn_scsi_retry_incR;
if (c->opcode[0] == 0x2A || c->opcode[0] == 0xAA) {
/* WRITE(10) , WRITE(12) */
usleep_time = Libburn_scsi_write_retry_usleeP +
loop_count * Libburn_scsi_write_retry_incR;
if (usleep_time > Libburn_scsi_write_retry_umaX)
usleep_time = Libburn_scsi_write_retry_umaX;
} else {
usleep_time = Libburn_scsi_retry_usleeP +
loop_count * Libburn_scsi_retry_incR;
if (usleep_time > Libburn_scsi_retry_umaX)
usleep_time = Libburn_scsi_retry_umaX;
}
if (time(NULL) + usleep_time / 1000000 - start_time >
timeout_ms / 1000 + 1) {
BURN_ALLOC_MEM(msg, char, 320);
@ -1688,7 +1698,8 @@ int scsi_eval_cmd_outcome(struct burn_drive *d, struct command *c, void *fp,
}
if (d->cancel)
{done = 1; goto ex;}
usleep(usleep_time);
if (usleep_time > 0)
usleep(usleep_time);
if (d->cancel)
{done = 1; goto ex;}
if (burn_sg_log_scsi & 3)