diff options
author | Albert Lee <albertcc@tw.ibm.com> | 2005-12-05 02:40:15 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-06 04:49:23 -0500 |
commit | 1c8489840e6b080e810e588423c1b6dd5913cf18 (patch) | |
tree | 3b0061fc1f571570e8ddf6069277b497a951f385 /drivers/scsi | |
parent | a22e2eb0710798009b8e696ae911aef745089dd6 (diff) |
[PATCH] libata: determine the err_mask when the error is found
- move "qc->err_mask |= AC_ERR_ATA_BUS" to where the error is found
- add "assert(qc->err_mask)" to ata_pio_error() to make sure qc->err_mask was available when we enter the error state
Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
============
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libata-core.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index f56b4daf4189..cc003f2c6d9b 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2830,6 +2830,7 @@ static unsigned long ata_pio_poll(struct ata_port *ap) | |||
2830 | status = ata_chk_status(ap); | 2830 | status = ata_chk_status(ap); |
2831 | if (status & ATA_BUSY) { | 2831 | if (status & ATA_BUSY) { |
2832 | if (time_after(jiffies, ap->pio_task_timeout)) { | 2832 | if (time_after(jiffies, ap->pio_task_timeout)) { |
2833 | qc->err_mask |= AC_ERR_ATA_BUS; | ||
2833 | ap->hsm_task_state = HSM_ST_TMOUT; | 2834 | ap->hsm_task_state = HSM_ST_TMOUT; |
2834 | return 0; | 2835 | return 0; |
2835 | } | 2836 | } |
@@ -2880,6 +2881,7 @@ static int ata_pio_complete (struct ata_port *ap) | |||
2880 | 2881 | ||
2881 | drv_stat = ata_wait_idle(ap); | 2882 | drv_stat = ata_wait_idle(ap); |
2882 | if (!ata_ok(drv_stat)) { | 2883 | if (!ata_ok(drv_stat)) { |
2884 | qc->err_mask |= __ac_err_mask(drv_stat); | ||
2883 | ap->hsm_task_state = HSM_ST_ERR; | 2885 | ap->hsm_task_state = HSM_ST_ERR; |
2884 | return 0; | 2886 | return 0; |
2885 | } | 2887 | } |
@@ -3195,6 +3197,7 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc) | |||
3195 | err_out: | 3197 | err_out: |
3196 | printk(KERN_INFO "ata%u: dev %u: ATAPI check failed\n", | 3198 | printk(KERN_INFO "ata%u: dev %u: ATAPI check failed\n", |
3197 | ap->id, dev->devno); | 3199 | ap->id, dev->devno); |
3200 | qc->err_mask |= AC_ERR_ATA_BUS; | ||
3198 | ap->hsm_task_state = HSM_ST_ERR; | 3201 | ap->hsm_task_state = HSM_ST_ERR; |
3199 | } | 3202 | } |
3200 | 3203 | ||
@@ -3244,6 +3247,7 @@ static void ata_pio_block(struct ata_port *ap) | |||
3244 | } else { | 3247 | } else { |
3245 | /* handle BSY=0, DRQ=0 as error */ | 3248 | /* handle BSY=0, DRQ=0 as error */ |
3246 | if ((status & ATA_DRQ) == 0) { | 3249 | if ((status & ATA_DRQ) == 0) { |
3250 | qc->err_mask |= AC_ERR_ATA_BUS; | ||
3247 | ap->hsm_task_state = HSM_ST_ERR; | 3251 | ap->hsm_task_state = HSM_ST_ERR; |
3248 | return; | 3252 | return; |
3249 | } | 3253 | } |
@@ -3261,9 +3265,13 @@ static void ata_pio_error(struct ata_port *ap) | |||
3261 | qc = ata_qc_from_tag(ap, ap->active_tag); | 3265 | qc = ata_qc_from_tag(ap, ap->active_tag); |
3262 | assert(qc != NULL); | 3266 | assert(qc != NULL); |
3263 | 3267 | ||
3268 | /* make sure qc->err_mask is available to | ||
3269 | * know what's wrong and recover | ||
3270 | */ | ||
3271 | assert(qc->err_mask); | ||
3272 | |||
3264 | ap->hsm_task_state = HSM_ST_IDLE; | 3273 | ap->hsm_task_state = HSM_ST_IDLE; |
3265 | 3274 | ||
3266 | qc->err_mask |= AC_ERR_ATA_BUS; | ||
3267 | ata_poll_qc_complete(qc); | 3275 | ata_poll_qc_complete(qc); |
3268 | } | 3276 | } |
3269 | 3277 | ||