Skip to contentSkip to conversation

libata: skip old error history when counting probe trials

PATCH Superseded Lin Ming 2 participants 3 messages May 3, 2012 libata

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lin Ming

author
#0 lore raw

PATCH 1/1 libata: skip old error history when counting probe trials

Commit d902747 introduced ATA_EFLAG_OLD_ER to mark entries in the error ring as cleared.

But ata_count_probe_trials_cb() didn't check this flag and it still counts the old error history. So wrong probe trials count is returned and it causes problem, for example, SATA link speed is slowed down from 3.0Gbps to 1.5Gbps.

Fix it by checking ATA_EFLAG_OLD_ER in ata_count_probe_trials_cb().

Cc stable <[email protected]> # 2.6.37+
---
 drivers/ata/libata-eh.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/ata/libata-eh.c +2 -1
index c61316e..d1fbd59 100644
@@ -3501,7 +3501,8 @@ static int ata_count_probe_trials_cb(struct ata_ering_entry *ent, void *void_arg
 	u64 now = get_jiffies_64();
 	int *trials = void_arg;
 
-	if (ent->timestamp < now - min(now, interval))
+	if ((ent->eflags & ATA_EFLAG_OLD_ER) ||
+	    (ent->timestamp < now - min(now, interval)))
 		return -1;
 
 	(*trials)++;
Signature · 1 line
1.7.9
#1 lore raw

Hello.

Quoted 1 line · Lin Ming

Commit d902747

Please also specify the summary of that commit in parens.

Quoted 8 lines

introduced ATA_EFLAG_OLD_ER to mark entries in the error ring as cleared.

But ata_count_probe_trials_cb() didn't check this flag and it still counts the old error history. So wrong probe trials count is returned and it causes problem, for example, SATA link speed is slowed down from 3.0Gbps to 1.5Gbps.

Quoted 4 lines

Fix it by checking ATA_EFLAG_OLD_ER in ata_count_probe_trials_cb().

Cc stable<[email protected]> # 2.6.37+

MBR, Sergei

author
#2 lore raw
Quoted 8 lines · Sergei Shtylyov

Hello.

Quoted 1 line · Lin Ming

Commit d902747

  Please also specify the summary of that commit in parens.

OK, just sent out the updated version.