[patch 12/94] tx4939ide: Do not use zero count PRD entry

From: Greg KH
Date: Thu Jan 15 2009 - 15:07:32 EST


2.6.28-stable review patch. If anyone has any objections, please let us know.

------------------

From: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>

commit a0fce792b55b260589c3d77293a224e84395ec07 upstream.

This fixes data corruption on some heavy load.

Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
Cc: sshtylyov@xxxxxxxxxxxxx
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/ide/tx4939ide.c | 6 ++++++
1 file changed, 6 insertions(+)

--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_
bcount = 0x10000 - (cur_addr & 0xffff);
if (bcount > cur_len)
bcount = cur_len;
+ /*
+ * This workaround for zero count seems required.
+ * (standard ide_build_dmatable do it too)
+ */
+ if ((bcount & 0xffff) == 0x0000)
+ bcount = 0x8000;
*table++ = bcount & 0xffff;
*table++ = cur_addr;
cur_addr += bcount;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/