Commit a0fce792 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Bartlomiej Zolnierkiewicz

tx4939ide: Do not use zero count PRD entry

This fixes data corruption on some heavy load.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: stable <stable@kernel.org>
Cc: sshtylyov@ru.mvista.com
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 4a6908a3
...@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive, struct request *rq) ...@@ -259,6 +259,12 @@ static int tx4939ide_build_dmatable(ide_drive_t *drive, struct request *rq)
bcount = 0x10000 - (cur_addr & 0xffff); bcount = 0x10000 - (cur_addr & 0xffff);
if (bcount > cur_len) if (bcount > cur_len)
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++ = bcount & 0xffff;
*table++ = cur_addr; *table++ = cur_addr;
cur_addr += bcount; cur_addr += bcount;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment