aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index aa38ed3e59a8..bf00d2b2e404 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -3865,10 +3865,16 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
3865 unsigned int ireason, bc_lo, bc_hi, bytes; 3865 unsigned int ireason, bc_lo, bc_hi, bytes;
3866 int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0; 3866 int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0;
3867 3867
3868 ap->ops->tf_read(ap, &qc->tf); 3868 /* Abuse qc->result_tf for temp storage of intermediate TF
3869 ireason = qc->tf.nsect; 3869 * here to save some kernel stack usage.
3870 bc_lo = qc->tf.lbam; 3870 * For normal completion, qc->result_tf is not relevant. For
3871 bc_hi = qc->tf.lbah; 3871 * error, qc->result_tf is later overwritten by ata_qc_complete().
3872 * So, the correctness of qc->result_tf is not affected.
3873 */
3874 ap->ops->tf_read(ap, &qc->result_tf);
3875 ireason = qc->result_tf.nsect;
3876 bc_lo = qc->result_tf.lbam;
3877 bc_hi = qc->result_tf.lbah;
3872 bytes = (bc_hi << 8) | bc_lo; 3878 bytes = (bc_hi << 8) | bc_lo;
3873 3879
3874 /* shall be cleared to zero, indicating xfer of data */ 3880 /* shall be cleared to zero, indicating xfer of data */