|
@@ -2539,7 +2539,7 @@ static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
|
|
ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer));
|
|
ata_sg_init_one(qc, cmd->sense_buffer, sizeof(cmd->sense_buffer));
|
|
qc->dma_dir = DMA_FROM_DEVICE;
|
|
qc->dma_dir = DMA_FROM_DEVICE;
|
|
|
|
|
|
- memset(&qc->cdb, 0, sizeof(ap->cdb_len));
|
|
|
|
|
|
+ memset(&qc->cdb, 0, ap->cdb_len);
|
|
qc->cdb[0] = REQUEST_SENSE;
|
|
qc->cdb[0] = REQUEST_SENSE;
|
|
qc->cdb[4] = SCSI_SENSE_BUFFERSIZE;
|
|
qc->cdb[4] = SCSI_SENSE_BUFFERSIZE;
|
|
|
|
|
|
@@ -2811,6 +2811,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat)
|
|
|
|
|
|
/* call completion callback */
|
|
/* call completion callback */
|
|
rc = qc->complete_fn(qc, drv_stat);
|
|
rc = qc->complete_fn(qc, drv_stat);
|
|
|
|
+ qc->flags &= ~ATA_QCFLAG_ACTIVE;
|
|
|
|
|
|
/* if callback indicates not to complete command (non-zero),
|
|
/* if callback indicates not to complete command (non-zero),
|
|
* return immediately
|
|
* return immediately
|
|
@@ -3229,7 +3230,8 @@ irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs)
|
|
struct ata_queued_cmd *qc;
|
|
struct ata_queued_cmd *qc;
|
|
|
|
|
|
qc = ata_qc_from_tag(ap, ap->active_tag);
|
|
qc = ata_qc_from_tag(ap, ap->active_tag);
|
|
- if (qc && (!(qc->tf.ctl & ATA_NIEN)))
|
|
|
|
|
|
+ if (qc && (!(qc->tf.ctl & ATA_NIEN)) &&
|
|
|
|
+ (qc->flags & ATA_QCFLAG_ACTIVE))
|
|
handled |= ata_host_intr(ap, qc);
|
|
handled |= ata_host_intr(ap, qc);
|
|
}
|
|
}
|
|
}
|
|
}
|