public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ide: fix for ide_timing quantisation errors
@ 2011-10-13 13:16 Bartlomiej Zolnierkiewicz
  2011-10-13 17:33 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2011-10-13 13:16 UTC (permalink / raw)
  To: David Miller; +Cc: linux-ide, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH v2] ide: fix for ide_timing quantisation errors

Based on commit 4f701d1 ("ata_timing: ensure t->cycle is always
correct") for libata.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
v2: fixed comment style

earlier references:
https://lkml.org/lkml/2010/1/18/274

 drivers/ide/ide-timings.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: b/drivers/ide/ide-timings.c
===================================================================
--- a/drivers/ide/ide-timings.c
+++ b/drivers/ide/ide-timings.c
@@ -206,6 +206,14 @@ int ide_timing_compute(ide_drive_t *driv
 		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;
 }
 EXPORT_SYMBOL_GPL(ide_timing_compute);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-13 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 13:16 [PATCH v2] ide: fix for ide_timing quantisation errors Bartlomiej Zolnierkiewicz
2011-10-13 17:33 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox