Commit 1581208b authored by Steven J. Hill's avatar Steven J. Hill Committed by David S. Miller

ide: Fix IDE PIO size calculation

IDE PIO calculates the size wrong when passing the parameter
"ide-core.nodma=0.0" to the kernel.
Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Acked-by: default avatarSteven J. Hill <Steven.Hill@imgtec.com>
Signed-off-by: default avatarSteven J. Hill <sjhill@mips.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99bfdd87
......@@ -239,9 +239,6 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs);
int page_is_high;
if (nr_bytes > PAGE_SIZE)
nr_bytes = PAGE_SIZE;
page = sg_page(cursg);
offset = cursg->offset + cmd->cursg_ofs;
......@@ -249,6 +246,8 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
page = nth_page(page, (offset >> PAGE_SHIFT));
offset %= PAGE_SIZE;
nr_bytes = min_t(unsigned, nr_bytes, (PAGE_SIZE - offset));
page_is_high = PageHighMem(page);
if (page_is_high)
local_irq_save(flags);
......
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