From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] ide: fix for ide_timing quantisation errors
Date: Thu, 13 Oct 2011 15:16:03 +0200 [thread overview]
Message-ID: <201110131516.03408.bzolnier@gmail.com> (raw)
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);
next reply other threads:[~2011-10-13 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-13 13:16 Bartlomiej Zolnierkiewicz [this message]
2011-10-13 17:33 ` [PATCH v2] ide: fix for ide_timing quantisation errors David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201110131516.03408.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox