Skip to content

Commit

Permalink
tx4939ide: Do not use zero count PRD entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Atsushi Nemoto authored and Bartlomiej Zolnierkiewicz committed Dec 29, 2008
1 parent 4a6908a commit a0fce79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/ide/tx4939ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a0fce79

Please sign in to comment.