aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-10-16 00:00:51 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-10-16 06:22:31 -0400
commitf4b31db92d163df8a639f5a8c8633bdeb6e8432d (patch)
tree9958d060717a6ab2e4038c3050854c6c489cdc93 /drivers/ata
parent4f7c2874995ac48a4622755b8bd159eb2fb6d8f4 (diff)
libata: fix internal command failure handling
When an internal command fails, it should be failed directly without invoking EH. In the original implemetation, this was accomplished by letting internal command bypass failure handling in ata_qc_complete(). However, later changes added post-successful-completion handling to that code path and the success path is no longer adequate as internal command failure path. One of the visible problems is that internal command failure due to timeout or other freeze conditions would spuriously trigger WARN_ON_ONCE() in the success path. This patch updates failure path such that internal command failure handling is contained there. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@kernel.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index b525a0981348..d7f0f1b1ae3e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5028,12 +5028,14 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
5028 qc->flags |= ATA_QCFLAG_FAILED; 5028 qc->flags |= ATA_QCFLAG_FAILED;
5029 5029
5030 if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) { 5030 if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
5031 if (!ata_tag_internal(qc->tag)) { 5031 /* always fill result TF for failed qc */
5032 /* always fill result TF for failed qc */ 5032 fill_result_tf(qc);
5033 fill_result_tf(qc); 5033
5034 if (!ata_tag_internal(qc->tag))
5034 ata_qc_schedule_eh(qc); 5035 ata_qc_schedule_eh(qc);
5035 return; 5036 else
5036 } 5037 __ata_qc_complete(qc);
5038 return;
5037 } 5039 }
5038 5040
5039 WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN); 5041 WARN_ON_ONCE(ap->pflags & ATA_PFLAG_FROZEN);