From: Atsushi Nemoto Date: Mon, 29 Dec 2008 19:27:28 +0000 (+0100) Subject: tx4939ide: Do not use zero count PRD entry X-Git-Tag: v2.6.28.1~84 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7ee9f07eca4a37c099dec3c700dfb3322320f5a3;p=karo-tx-linux.git tx4939ide: Do not use zero count PRD entry commit a0fce792b55b260589c3d77293a224e84395ec07 upstream. This fixes data corruption on some heavy load. Signed-off-by: Atsushi Nemoto Cc: sshtylyov@ru.mvista.com Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c index bb5a26bfc871..97cd9e0f66f6 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;