aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2012-05-03 10:15:07 -0400
committerLuis Henriques <luis.henriques@canonical.com>2012-05-25 12:24:40 -0400
commit165aed4458db9fc4f2aa761d9ac7b9f020044416 (patch)
treea07a34d75741f22fe9b1c53da87dc6edeb95f8f6
parentb040353a1a51c59dbbc2b49b51739fdf1f0515e7 (diff)
libata: skip old error history when counting probe trials
BugLink: http://bugs.launchpad.net/bugs/996109 commit 6868225e3e92399068be9a5f1635752d91012ad5 upstream. Commit d902747("[libata] Add ATA transport class") 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(). Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/ata/libata-eh.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7f099d6e4e0..311c92d1db2 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -3487,7 +3487,8 @@ static int ata_count_probe_trials_cb(struct ata_ering_entry *ent, void *void_arg
3487 u64 now = get_jiffies_64(); 3487 u64 now = get_jiffies_64();
3488 int *trials = void_arg; 3488 int *trials = void_arg;
3489 3489
3490 if (ent->timestamp < now - min(now, interval)) 3490 if ((ent->eflags & ATA_EFLAG_OLD_ER) ||
3491 (ent->timestamp < now - min(now, interval)))
3491 return -1; 3492 return -1;
3492 3493
3493 (*trials)++; 3494 (*trials)++;