aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-30 04:50:22 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-10-30 04:50:22 -0500
commit054ee8fd39f1b5d50e803f126b63f400d631eea4 (patch)
tree2819e388f853de88e09635de8e38017b563069bc /drivers/scsi/libata-core.c
parentf0612bbc41f65f5a684f69d714a1a17a6f0f40c5 (diff)
parenta7dac447bb9cef27d4d29cdf63e2d7809c50b1f4 (diff)
Merge branch 'upstream'
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 0d58f4d3e5ce..6cab14965cc8 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2750,7 +2750,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
2750 * None. (grabs host lock) 2750 * None. (grabs host lock)
2751 */ 2751 */
2752 2752
2753void ata_poll_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) 2753void ata_poll_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
2754{ 2754{
2755 struct ata_port *ap = qc->ap; 2755 struct ata_port *ap = qc->ap;
2756 unsigned long flags; 2756 unsigned long flags;
@@ -2758,7 +2758,7 @@ void ata_poll_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
2758 spin_lock_irqsave(&ap->host_set->lock, flags); 2758 spin_lock_irqsave(&ap->host_set->lock, flags);
2759 ap->flags &= ~ATA_FLAG_NOINTR; 2759 ap->flags &= ~ATA_FLAG_NOINTR;
2760 ata_irq_on(ap); 2760 ata_irq_on(ap);
2761 ata_qc_complete(qc, drv_stat); 2761 ata_qc_complete(qc, err_mask);
2762 spin_unlock_irqrestore(&ap->host_set->lock, flags); 2762 spin_unlock_irqrestore(&ap->host_set->lock, flags);
2763} 2763}
2764 2764
@@ -2855,7 +2855,7 @@ static int ata_pio_complete (struct ata_port *ap)
2855 2855
2856 ap->hsm_task_state = HSM_ST_IDLE; 2856 ap->hsm_task_state = HSM_ST_IDLE;
2857 2857
2858 ata_poll_qc_complete(qc, drv_stat); 2858 ata_poll_qc_complete(qc, 0);
2859 2859
2860 /* another command may start at this point */ 2860 /* another command may start at this point */
2861 2861
@@ -3223,18 +3223,15 @@ static void ata_pio_block(struct ata_port *ap)
3223static void ata_pio_error(struct ata_port *ap) 3223static void ata_pio_error(struct ata_port *ap)
3224{ 3224{
3225 struct ata_queued_cmd *qc; 3225 struct ata_queued_cmd *qc;
3226 u8 drv_stat; 3226
3227 printk(KERN_WARNING "ata%u: PIO error\n", ap->id);
3227 3228
3228 qc = ata_qc_from_tag(ap, ap->active_tag); 3229 qc = ata_qc_from_tag(ap, ap->active_tag);
3229 assert(qc != NULL); 3230 assert(qc != NULL);
3230 3231
3231 drv_stat = ata_chk_status(ap);
3232 printk(KERN_WARNING "ata%u: PIO error, drv_stat 0x%x\n",
3233 ap->id, drv_stat);
3234
3235 ap->hsm_task_state = HSM_ST_IDLE; 3232 ap->hsm_task_state = HSM_ST_IDLE;
3236 3233
3237 ata_poll_qc_complete(qc, drv_stat | ATA_ERR); 3234 ata_poll_qc_complete(qc, AC_ERR_ATA_BUS);
3238} 3235}
3239 3236
3240static void ata_pio_task(void *_data) 3237static void ata_pio_task(void *_data)
@@ -3357,7 +3354,7 @@ static void ata_qc_timeout(struct ata_queued_cmd *qc)
3357 ap->id, qc->tf.command, drv_stat, host_stat); 3354 ap->id, qc->tf.command, drv_stat, host_stat);
3358 3355
3359 /* complete taskfile transaction */ 3356 /* complete taskfile transaction */
3360 ata_qc_complete(qc, drv_stat); 3357 ata_qc_complete(qc, ac_err_mask(drv_stat));
3361 break; 3358 break;
3362 } 3359 }
3363 3360
@@ -3462,7 +3459,7 @@ struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
3462 return qc; 3459 return qc;
3463} 3460}
3464 3461
3465int ata_qc_complete_noop(struct ata_queued_cmd *qc, u8 drv_stat) 3462int ata_qc_complete_noop(struct ata_queued_cmd *qc, unsigned int err_mask)
3466{ 3463{
3467 return 0; 3464 return 0;
3468} 3465}
@@ -3521,7 +3518,7 @@ void ata_qc_free(struct ata_queued_cmd *qc)
3521 * spin_lock_irqsave(host_set lock) 3518 * spin_lock_irqsave(host_set lock)
3522 */ 3519 */
3523 3520
3524void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) 3521void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
3525{ 3522{
3526 int rc; 3523 int rc;
3527 3524
@@ -3538,7 +3535,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
3538 qc->flags &= ~ATA_QCFLAG_ACTIVE; 3535 qc->flags &= ~ATA_QCFLAG_ACTIVE;
3539 3536
3540 /* call completion callback */ 3537 /* call completion callback */
3541 rc = qc->complete_fn(qc, drv_stat); 3538 rc = qc->complete_fn(qc, err_mask);
3542 3539
3543 /* if callback indicates not to complete command (non-zero), 3540 /* if callback indicates not to complete command (non-zero),
3544 * return immediately 3541 * return immediately
@@ -3976,7 +3973,7 @@ inline unsigned int ata_host_intr (struct ata_port *ap,
3976 ap->ops->irq_clear(ap); 3973 ap->ops->irq_clear(ap);
3977 3974
3978 /* complete taskfile transaction */ 3975 /* complete taskfile transaction */
3979 ata_qc_complete(qc, status); 3976 ata_qc_complete(qc, ac_err_mask(status));
3980 break; 3977 break;
3981 3978
3982 default: 3979 default:
@@ -4071,7 +4068,7 @@ static void atapi_packet_task(void *_data)
4071 /* sleep-wait for BSY to clear */ 4068 /* sleep-wait for BSY to clear */
4072 DPRINTK("busy wait\n"); 4069 DPRINTK("busy wait\n");
4073 if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB)) 4070 if (ata_busy_sleep(ap, ATA_TMOUT_CDB_QUICK, ATA_TMOUT_CDB))
4074 goto err_out; 4071 goto err_out_status;
4075 4072
4076 /* make sure DRQ is set */ 4073 /* make sure DRQ is set */
4077 status = ata_chk_status(ap); 4074 status = ata_chk_status(ap);
@@ -4108,8 +4105,10 @@ static void atapi_packet_task(void *_data)
4108 4105
4109 return; 4106 return;
4110 4107
4108err_out_status:
4109 status = ata_chk_status(ap);
4111err_out: 4110err_out:
4112 ata_poll_qc_complete(qc, ATA_ERR); 4111 ata_poll_qc_complete(qc, __ac_err_mask(status));
4113} 4112}
4114 4113
4115 4114