diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2008-12-29 14:27:28 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-12-29 14:27:28 -0500 |
commit | a0fce792b55b260589c3d77293a224e84395ec07 (patch) | |
tree | 39acc6ac8080ef1081574b4c8b6c737c69b0055e /drivers/ide/tx4939ide.c | |
parent | 4a6908a3a050aacc9c3a2f36b276b46c0629ad91 (diff) |
tx4939ide: Do not use zero count PRD entry
This fixes data corruption on some heavy load.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/tx4939ide.c')
-rw-r--r-- | 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 bafb7d1a22e2..30d0d256230f 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) | |||
259 | bcount = 0x10000 - (cur_addr & 0xffff); | 259 | bcount = 0x10000 - (cur_addr & 0xffff); |
260 | if (bcount > cur_len) | 260 | if (bcount > cur_len) |
261 | bcount = cur_len; | 261 | bcount = cur_len; |
262 | /* | ||
263 | * This workaround for zero count seems required. | ||
264 | * (standard ide_build_dmatable do it too) | ||
265 | */ | ||
266 | if ((bcount & 0xffff) == 0x0000) | ||
267 | bcount = 0x8000; | ||
262 | *table++ = bcount & 0xffff; | 268 | *table++ = bcount & 0xffff; |
263 | *table++ = cur_addr; | 269 | *table++ = cur_addr; |
264 | cur_addr += bcount; | 270 | cur_addr += bcount; |