Skip to content

Commit

Permalink
[PATCH] libata: determine the err_mask directly in atapi_packet_task()
Browse files Browse the repository at this point in the history
  - set qc->err_mask directly when we found the error
  - remove the code to determine err_mask from device status

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>

============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Albert Lee authored and Jeff Garzik committed Dec 6, 2005
1 parent 1c84898 commit d8fe452
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4083,13 +4083,17 @@ static void atapi_packet_task(void *_data)

/* sleep-wait for BSY to clear */
DPRINTK("busy wait\n");
if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB))
goto err_out_status;
if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB)) {
qc->err_mask |= AC_ERR_ATA_BUS;
goto err_out;
}

/* make sure DRQ is set */
status = ata_chk_status(ap);
if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ)
if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ) {
qc->err_mask |= AC_ERR_ATA_BUS;
goto err_out;
}

/* send SCSI cdb */
DPRINTK("send cdb\n");
Expand Down Expand Up @@ -4121,10 +4125,7 @@ static void atapi_packet_task(void *_data)

return;

err_out_status:
status = ata_chk_status(ap);
err_out:
qc->err_mask |= __ac_err_mask(status);
ata_poll_qc_complete(qc);
}

Expand Down

0 comments on commit d8fe452

Please sign in to comment.