Skip to content

Commit

Permalink
ide: Fix IDE PIO size calculation
Browse files Browse the repository at this point in the history
IDE PIO calculates the size wrong when passing the parameter
"ide-core.nodma=0.0" to the kernel.

Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>

Signed-off-by: Steven J. Hill <sjhill@mips.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Steven J. Hill authored and David S. Miller committed Jul 10, 2013
1 parent 99bfdd8 commit 1581208
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ide/ide-taskfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,15 @@ 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;

/* get the current page and offset */
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);
Expand Down

0 comments on commit 1581208

Please sign in to comment.