diff options
author | Tejun Heo <htejun@gmail.com> | 2006-01-22 23:09:36 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-26 22:36:27 -0500 |
commit | 11a56d2439259892319df81cf1582687d7e7fde5 (patch) | |
tree | 976f5ecb7ff61c19620ca482c0550b0b009bfa6a /drivers/scsi/libata-core.c | |
parent | 284b6481cc7112ca6a9e60b7a9b650fba3bf0492 (diff) |
[PATCH] libata: add detailed AC_ERR_* flags
Add detailed AC_ERR_* flags and use them. Long-term goal is to
describe all errors with err_mask and tf combination (tf for failed
sector information, etc...). After proper error diagnosis is
implemented, sense data should also be generated from err_mask instead
of directly from hardware tf registers as it is currently.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 43a23286d6fe..f5519f01491c 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1142,7 +1142,7 @@ ata_exec_internal(struct ata_port *ap, struct ata_device *dev, | |||
1142 | * spurious interrupt. We can live with that. | 1142 | * spurious interrupt. We can live with that. |
1143 | */ | 1143 | */ |
1144 | if (qc->flags & ATA_QCFLAG_ACTIVE) { | 1144 | if (qc->flags & ATA_QCFLAG_ACTIVE) { |
1145 | qc->err_mask = AC_ERR_OTHER; | 1145 | qc->err_mask = AC_ERR_TIMEOUT; |
1146 | ata_qc_complete(qc); | 1146 | ata_qc_complete(qc); |
1147 | printk(KERN_WARNING "ata%u: qc timeout (cmd 0x%x)\n", | 1147 | printk(KERN_WARNING "ata%u: qc timeout (cmd 0x%x)\n", |
1148 | ap->id, command); | 1148 | ap->id, command); |
@@ -2917,7 +2917,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap) | |||
2917 | status = ata_chk_status(ap); | 2917 | status = ata_chk_status(ap); |
2918 | if (status & ATA_BUSY) { | 2918 | if (status & ATA_BUSY) { |
2919 | if (time_after(jiffies, ap->pio_task_timeout)) { | 2919 | if (time_after(jiffies, ap->pio_task_timeout)) { |
2920 | qc->err_mask |= AC_ERR_ATA_BUS; | 2920 | qc->err_mask |= AC_ERR_TIMEOUT; |
2921 | ap->hsm_task_state = HSM_ST_TMOUT; | 2921 | ap->hsm_task_state = HSM_ST_TMOUT; |
2922 | return 0; | 2922 | return 0; |
2923 | } | 2923 | } |
@@ -3295,7 +3295,7 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc) | |||
3295 | err_out: | 3295 | err_out: |
3296 | printk(KERN_INFO "ata%u: dev %u: ATAPI check failed\n", | 3296 | printk(KERN_INFO "ata%u: dev %u: ATAPI check failed\n", |
3297 | ap->id, dev->devno); | 3297 | ap->id, dev->devno); |
3298 | qc->err_mask |= AC_ERR_ATA_BUS; | 3298 | qc->err_mask |= AC_ERR_HSM; |
3299 | ap->hsm_task_state = HSM_ST_ERR; | 3299 | ap->hsm_task_state = HSM_ST_ERR; |
3300 | } | 3300 | } |
3301 | 3301 | ||
@@ -3353,7 +3353,7 @@ static void ata_pio_block(struct ata_port *ap) | |||
3353 | } else { | 3353 | } else { |
3354 | /* handle BSY=0, DRQ=0 as error */ | 3354 | /* handle BSY=0, DRQ=0 as error */ |
3355 | if ((status & ATA_DRQ) == 0) { | 3355 | if ((status & ATA_DRQ) == 0) { |
3356 | qc->err_mask |= AC_ERR_ATA_BUS; | 3356 | qc->err_mask |= AC_ERR_HSM; |
3357 | ap->hsm_task_state = HSM_ST_ERR; | 3357 | ap->hsm_task_state = HSM_ST_ERR; |
3358 | return; | 3358 | return; |
3359 | } | 3359 | } |
@@ -4159,14 +4159,14 @@ static void atapi_packet_task(void *_data) | |||
4159 | /* sleep-wait for BSY to clear */ | 4159 | /* sleep-wait for BSY to clear */ |
4160 | DPRINTK("busy wait\n"); | 4160 | DPRINTK("busy wait\n"); |
4161 | if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB)) { | 4161 | if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB)) { |
4162 | qc->err_mask |= AC_ERR_ATA_BUS; | 4162 | qc->err_mask |= AC_ERR_TIMEOUT; |
4163 | goto err_out; | 4163 | goto err_out; |
4164 | } | 4164 | } |
4165 | 4165 | ||
4166 | /* make sure DRQ is set */ | 4166 | /* make sure DRQ is set */ |
4167 | status = ata_chk_status(ap); | 4167 | status = ata_chk_status(ap); |
4168 | if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ) { | 4168 | if ((status & (ATA_BUSY | ATA_DRQ)) != ATA_DRQ) { |
4169 | qc->err_mask |= AC_ERR_ATA_BUS; | 4169 | qc->err_mask |= AC_ERR_HSM; |
4170 | goto err_out; | 4170 | goto err_out; |
4171 | } | 4171 | } |
4172 | 4172 | ||