Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f701d1e9a796a3d6657e1129bee0566d7cda916 Commit: 4f701d1e9a796a3d6657e1129bee0566d7cda916 Parent: c1c4e8d55757f8aec5f95eb80860e340d717c217 Author: Alan Cox <[EMAIL PROTECTED]> AuthorDate: Mon Apr 23 11:55:36 2007 +0100 Committer: Jeff Garzik <[EMAIL PROTECTED]> CommitDate: Sat Apr 28 14:51:33 2007 -0400
ata_timing: ensure t->cycle is always correct 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 <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 227399e..4e1df53 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2639,6 +2639,12 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed, 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; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html