* [PATCH] ata_timing: ensure t->cycle is always correct
@ 2007-04-23 10:55 Alan Cox
2007-04-28 18:51 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2007-04-23 10:55 UTC (permalink / raw)
To: linux-ide, akpm, jgarzik
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@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.21-rc6-mm1/drivers/ata/libata-core.c linux-2.6.21-rc6-mm1/drivers/ata/libata-core.c
--- linux.vanilla-2.6.21-rc6-mm1/drivers/ata/libata-core.c 2007-04-12 14:15:03.000000000 +0100
+++ linux-2.6.21-rc6-mm1/drivers/ata/libata-core.c 2007-04-23 10:47:49.543967256 +0100
@@ -2405,6 +2619,12 @@
t->active += (t->cycle - (t->active + t->recover)) / 2;
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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-28 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-23 10:55 [PATCH] ata_timing: ensure t->cycle is always correct Alan Cox
2007-04-28 18:51 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).