aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-01-22 23:09:36 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 22:36:27 -0500
commit11a56d2439259892319df81cf1582687d7e7fde5 (patch)
tree976f5ecb7ff61c19620ca482c0550b0b009bfa6a /drivers
parent284b6481cc7112ca6a9e60b7a9b650fba3bf0492 (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')
-rw-r--r--drivers/scsi/ahci.c2
-rw-r--r--drivers/scsi/libata-core.c12
-rw-r--r--drivers/scsi/sata_mv.c2
-rw-r--r--drivers/scsi/sata_sil24.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index a168b525d079..bb3686ae1885 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -680,7 +680,7 @@ static void ahci_eng_timeout(struct ata_port *ap)
680 * not being called from the SCSI EH. 680 * not being called from the SCSI EH.
681 */ 681 */
682 qc->scsidone = scsi_finish_command; 682 qc->scsidone = scsi_finish_command;
683 qc->err_mask |= AC_ERR_OTHER; 683 qc->err_mask |= AC_ERR_TIMEOUT;
684 ata_qc_complete(qc); 684 ata_qc_complete(qc);
685 } 685 }
686 686
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)
3295err_out: 3295err_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
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c
index cd54244058b5..89bcd85fa58c 100644
--- a/drivers/scsi/sata_mv.c
+++ b/drivers/scsi/sata_mv.c
@@ -1866,7 +1866,7 @@ static void mv_eng_timeout(struct ata_port *ap)
1866 */ 1866 */
1867 spin_lock_irqsave(&ap->host_set->lock, flags); 1867 spin_lock_irqsave(&ap->host_set->lock, flags);
1868 qc->scsidone = scsi_finish_command; 1868 qc->scsidone = scsi_finish_command;
1869 qc->err_mask |= AC_ERR_OTHER; 1869 qc->err_mask |= AC_ERR_TIMEOUT;
1870 ata_qc_complete(qc); 1870 ata_qc_complete(qc);
1871 spin_unlock_irqrestore(&ap->host_set->lock, flags); 1871 spin_unlock_irqrestore(&ap->host_set->lock, flags);
1872 } 1872 }
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c
index 923130185a9e..fb59012b9fbe 100644
--- a/drivers/scsi/sata_sil24.c
+++ b/drivers/scsi/sata_sil24.c
@@ -653,7 +653,7 @@ static void sil24_eng_timeout(struct ata_port *ap)
653 */ 653 */
654 printk(KERN_ERR "ata%u: command timeout\n", ap->id); 654 printk(KERN_ERR "ata%u: command timeout\n", ap->id);
655 qc->scsidone = scsi_finish_command; 655 qc->scsidone = scsi_finish_command;
656 qc->err_mask |= AC_ERR_OTHER; 656 qc->err_mask |= AC_ERR_TIMEOUT;
657 ata_qc_complete(qc); 657 ata_qc_complete(qc);
658 658
659 sil24_reset_controller(ap); 659 sil24_reset_controller(ap);