diff options
-rw-r--r-- | 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 227399e48470..4e1df5382b9a 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, | |||
2639 | t->active += (t->cycle - (t->active + t->recover)) / 2; | 2639 | t->active += (t->cycle - (t->active + t->recover)) / 2; |
2640 | t->recover = t->cycle - t->active; | 2640 | t->recover = t->cycle - t->active; |
2641 | } | 2641 | } |
2642 | |||
2643 | /* In a few cases quantisation may produce enough errors to | ||
2644 | leave t->cycle too low for the sum of active and recovery | ||
2645 | if so we must correct this */ | ||
2646 | if (t->active + t->recover > t->cycle) | ||
2647 | t->cycle = t->active + t->recover; | ||
2642 | 2648 | ||
2643 | return 0; | 2649 | return 0; |
2644 | } | 2650 | } |