From: Lin Ming Date: Thu, 3 May 2012 14:15:07 +0000 (+0800) Subject: libata: skip old error history when counting probe trials X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6868225e3e92399068be9a5f1635752d91012ad5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git libata: skip old error history when counting probe trials 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(). Cc: stable # 2.6.37+ Signed-off-by: Lin Ming Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c61316e9d2f7..d1fbd59ead16 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -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)++;