diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index a52c07198839..13dcef809e5c 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4536,6 +4536,14 @@ void __ata_qc_complete(struct ata_queued_cmd *qc) | |||
4536 | qc->complete_fn(qc); | 4536 | qc->complete_fn(qc); |
4537 | } | 4537 | } |
4538 | 4538 | ||
4539 | static void fill_result_tf(struct ata_queued_cmd *qc) | ||
4540 | { | ||
4541 | struct ata_port *ap = qc->ap; | ||
4542 | |||
4543 | ap->ops->tf_read(ap, &qc->result_tf); | ||
4544 | qc->result_tf.flags = qc->tf.flags; | ||
4545 | } | ||
4546 | |||
4539 | /** | 4547 | /** |
4540 | * ata_qc_complete - Complete an active ATA command | 4548 | * ata_qc_complete - Complete an active ATA command |
4541 | * @qc: Command to complete | 4549 | * @qc: Command to complete |
@@ -4573,7 +4581,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4573 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { | 4581 | if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { |
4574 | if (!ata_tag_internal(qc->tag)) { | 4582 | if (!ata_tag_internal(qc->tag)) { |
4575 | /* always fill result TF for failed qc */ | 4583 | /* always fill result TF for failed qc */ |
4576 | ap->ops->tf_read(ap, &qc->result_tf); | 4584 | fill_result_tf(qc); |
4577 | ata_qc_schedule_eh(qc); | 4585 | ata_qc_schedule_eh(qc); |
4578 | return; | 4586 | return; |
4579 | } | 4587 | } |
@@ -4581,7 +4589,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4581 | 4589 | ||
4582 | /* read result TF if requested */ | 4590 | /* read result TF if requested */ |
4583 | if (qc->flags & ATA_QCFLAG_RESULT_TF) | 4591 | if (qc->flags & ATA_QCFLAG_RESULT_TF) |
4584 | ap->ops->tf_read(ap, &qc->result_tf); | 4592 | fill_result_tf(qc); |
4585 | 4593 | ||
4586 | __ata_qc_complete(qc); | 4594 | __ata_qc_complete(qc); |
4587 | } else { | 4595 | } else { |
@@ -4590,7 +4598,7 @@ void ata_qc_complete(struct ata_queued_cmd *qc) | |||
4590 | 4598 | ||
4591 | /* read result TF if failed or requested */ | 4599 | /* read result TF if failed or requested */ |
4592 | if (qc->err_mask || qc->flags & ATA_QCFLAG_RESULT_TF) | 4600 | if (qc->err_mask || qc->flags & ATA_QCFLAG_RESULT_TF) |
4593 | ap->ops->tf_read(ap, &qc->result_tf); | 4601 | fill_result_tf(qc); |
4594 | 4602 | ||
4595 | __ata_qc_complete(qc); | 4603 | __ata_qc_complete(qc); |
4596 | } | 4604 | } |