Patchwork [v2] ide: fix for ide_timing quantisation errors

login
register
mail settings
Submitter Bartlomiej Zolnierkiewicz
Date Oct. 13, 2011, 1:16 p.m.
Message ID <201110131516.03408.bzolnier@gmail.com>
Download mbox | patch
Permalink /patch/119502/
State Rejected
Delegated to: David Miller
Headers show

Comments

Bartlomiej Zolnierkiewicz - Oct. 13, 2011, 1:16 p.m.
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(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Oct. 13, 2011, 5:33 p.m.
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date: Thu, 13 Oct 2011 15:16:03 +0200

> 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>

I'm not applying patches that sync up the ATA layer with the IDE layer
in ways like this unless the change is in response to a user reported
bug.

We're way past the stage where we are making changes to the IDE
layer based purely upon visual inspection.  I want a real user
bug report to back most if not all changes.

These two layers will get out of sync, and you're going to have to
accept that.  Please concentrate your efforts on the ATA layer
if you want to make cleanups, simplifications, and fixes based
upon code audits.
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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);