[patch 10/10] ata_timing: ensure t->cycle is always correct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>

Russell King hit a case where quantisation errors accumulated such that the
cycle time was shorter than rather than equal to the active/recovery time. 
The code already knows how to stretch times to fit the cycle time but does
not know about the reverse.

Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
Cc: Tejun Heo <htejun@xxxxxxxxx>
Cc: Jeff Garzik <jeff@xxxxxxxxxx>
Cc: Russell King <rmk@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/ata/libata-core.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN drivers/ata/libata-core.c~ata_timing-ensure-t-cycle-is-always-correct drivers/ata/libata-core.c
--- a/drivers/ata/libata-core.c~ata_timing-ensure-t-cycle-is-always-correct
+++ a/drivers/ata/libata-core.c
@@ -2618,6 +2618,12 @@ int ata_timing_compute(struct ata_device
 		t->recover = t->cycle - t->active;
 	}
 
+	/* In a few cases quantisation may produce enough errors to
+	   leave t->cycle too low for the sum of active and recovery
+	   if so we must correct this */
+	if (t->active + t->recover > t->cycle)
+		t->cycle = t->active + t->recover;
+
 	return 0;
 }
 
_
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux