diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b3aedb033465..e4c400756b23 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2865,11 +2865,11 @@ static int ata_pio_complete (struct ata_port *ap) | |||
2865 | * msecs, then chk-status again. If still busy, fall back to | 2865 | * msecs, then chk-status again. If still busy, fall back to |
2866 | * HSM_ST_POLL state. | 2866 | * HSM_ST_POLL state. |
2867 | */ | 2867 | */ |
2868 | drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10); | 2868 | drv_stat = ata_busy_wait(ap, ATA_BUSY, 10); |
2869 | if (drv_stat & (ATA_BUSY | ATA_DRQ)) { | 2869 | if (drv_stat & ATA_BUSY) { |
2870 | msleep(2); | 2870 | msleep(2); |
2871 | drv_stat = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 10); | 2871 | drv_stat = ata_busy_wait(ap, ATA_BUSY, 10); |
2872 | if (drv_stat & (ATA_BUSY | ATA_DRQ)) { | 2872 | if (drv_stat & ATA_BUSY) { |
2873 | ap->hsm_task_state = HSM_ST_LAST_POLL; | 2873 | ap->hsm_task_state = HSM_ST_LAST_POLL; |
2874 | ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; | 2874 | ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; |
2875 | return 0; | 2875 | return 0; |
@@ -3236,8 +3236,16 @@ static void ata_pio_block(struct ata_port *ap) | |||
3236 | qc = ata_qc_from_tag(ap, ap->active_tag); | 3236 | qc = ata_qc_from_tag(ap, ap->active_tag); |
3237 | assert(qc != NULL); | 3237 | assert(qc != NULL); |
3238 | 3238 | ||
3239 | /* check error */ | ||
3240 | if (status & (ATA_ERR | ATA_DF)) { | ||
3241 | qc->err_mask |= AC_ERR_DEV; | ||
3242 | ap->hsm_task_state = HSM_ST_ERR; | ||
3243 | return; | ||
3244 | } | ||
3245 | |||
3246 | /* transfer data if any */ | ||
3239 | if (is_atapi_taskfile(&qc->tf)) { | 3247 | if (is_atapi_taskfile(&qc->tf)) { |
3240 | /* no more data to transfer or unsupported ATAPI command */ | 3248 | /* DRQ=0 means no more data to transfer */ |
3241 | if ((status & ATA_DRQ) == 0) { | 3249 | if ((status & ATA_DRQ) == 0) { |
3242 | ap->hsm_task_state = HSM_ST_LAST; | 3250 | ap->hsm_task_state = HSM_ST_LAST; |
3243 | return; | 3251 | return; |