diff options
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 0b5d3a5b7eda..ee9b96da841e 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1253,11 +1253,11 @@ void __sata_phy_reset(struct ata_port *ap) | |||
1253 | unsigned long timeout = jiffies + (HZ * 5); | 1253 | unsigned long timeout = jiffies + (HZ * 5); |
1254 | 1254 | ||
1255 | if (ap->flags & ATA_FLAG_SATA_RESET) { | 1255 | if (ap->flags & ATA_FLAG_SATA_RESET) { |
1256 | scr_write(ap, SCR_CONTROL, 0x301); /* issue phy wake/reset */ | 1256 | /* issue phy wake/reset */ |
1257 | scr_read(ap, SCR_STATUS); /* dummy read; flush */ | 1257 | scr_write_flush(ap, SCR_CONTROL, 0x301); |
1258 | udelay(400); /* FIXME: a guess */ | 1258 | udelay(400); /* FIXME: a guess */ |
1259 | } | 1259 | } |
1260 | scr_write(ap, SCR_CONTROL, 0x300); /* issue phy wake/clear reset */ | 1260 | scr_write_flush(ap, SCR_CONTROL, 0x300); /* phy wake/clear reset */ |
1261 | 1261 | ||
1262 | /* wait for phy to become ready, if necessary */ | 1262 | /* wait for phy to become ready, if necessary */ |
1263 | do { | 1263 | do { |
@@ -2539,7 +2539,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev, | |||
2539 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); | 2539 | ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer)); |
2540 | qc->dma_dir = DMA_FROM_DEVICE; | 2540 | qc->dma_dir = DMA_FROM_DEVICE; |
2541 | 2541 | ||
2542 | memset(&qc->cdb, 0, sizeof(ap->cdb_len)); | 2542 | memset(&qc->cdb, 0, ap->cdb_len); |
2543 | qc->cdb[0] = REQUEST_SENSE; | 2543 | qc->cdb[0] = REQUEST_SENSE; |
2544 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; | 2544 | qc->cdb[4] = SCSI_SENSE_BUFFERSIZE; |
2545 | 2545 | ||
@@ -2811,6 +2811,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat) | |||
2811 | 2811 | ||
2812 | /* call completion callback */ | 2812 | /* call completion callback */ |
2813 | rc = qc->complete_fn(qc, drv_stat); | 2813 | rc = qc->complete_fn(qc, drv_stat); |
2814 | qc->flags &= ~ATA_QCFLAG_ACTIVE; | ||
2814 | 2815 | ||
2815 | /* if callback indicates not to complete command (non-zero), | 2816 | /* if callback indicates not to complete command (non-zero), |
2816 | * return immediately | 2817 | * return immediately |
@@ -3229,7 +3230,8 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs) | |||
3229 | struct ata_queued_cmd *qc; | 3230 | struct ata_queued_cmd *qc; |
3230 | 3231 | ||
3231 | qc = ata_qc_from_tag(ap, ap->active_tag); | 3232 | qc = ata_qc_from_tag(ap, ap->active_tag); |
3232 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) | 3233 | if (qc && (!(qc->tf.ctl & ATA_NIEN)) && |
3234 | (qc->flags & ATA_QCFLAG_ACTIVE)) | ||
3233 | handled |= ata_host_intr(ap, qc); | 3235 | handled |= ata_host_intr(ap, qc); |
3234 | } | 3236 | } |
3235 | } | 3237 | } |