linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tx4939ide: Do not use zero count PRD entry
@ 2008-12-25 14:32 Atsushi Nemoto
  2008-12-29 18:38 ` Bartlomiej Zolnierkiewicz
  2009-01-16 12:51 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Atsushi Nemoto @ 2008-12-25 14:32 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, sshtylyov, linux-mips, stable

This fixes data corruption on some heavy load.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
---
 drivers/ide/tx4939ide.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
index bafb7d1..30d0d25 100644
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive, struct request *rq)
 			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;
-- 
1.5.6.3


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

end of thread, other threads:[~2009-01-16 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-25 14:32 [PATCH] tx4939ide: Do not use zero count PRD entry Atsushi Nemoto
2008-12-29 18:38 ` Bartlomiej Zolnierkiewicz
2009-01-16 12:51 ` Sergei Shtylyov
2009-01-16 14:25   ` Atsushi Nemoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).