aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven J. Hill <sjhill@mips.com>2013-06-20 11:30:37 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-10 15:09:10 -0400
commit1581208b2f0643eebfa7a3fbe5bad831c0bb7f0e (patch)
treea8c4e201e65c58587fca8776c5c0258edae08215
parent99bfdd878693f440e723a7b33ccedd0b9dc1ca16 (diff)
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: 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>
-rw-r--r--drivers/ide/ide-taskfile.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 729428edeba2..dabb88b1cbec 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -239,9 +239,6 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
239 unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs); 239 unsigned nr_bytes = min(len, cursg->length - cmd->cursg_ofs);
240 int page_is_high; 240 int page_is_high;
241 241
242 if (nr_bytes > PAGE_SIZE)
243 nr_bytes = PAGE_SIZE;
244
245 page = sg_page(cursg); 242 page = sg_page(cursg);
246 offset = cursg->offset + cmd->cursg_ofs; 243 offset = cursg->offset + cmd->cursg_ofs;
247 244
@@ -249,6 +246,8 @@ void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd,
249 page = nth_page(page, (offset >> PAGE_SHIFT)); 246 page = nth_page(page, (offset >> PAGE_SHIFT));
250 offset %= PAGE_SIZE; 247 offset %= PAGE_SIZE;
251 248
249 nr_bytes = min_t(unsigned, nr_bytes, (PAGE_SIZE - offset));
250
252 page_is_high = PageHighMem(page); 251 page_is_high = PageHighMem(page);
253 if (page_is_high) 252 if (page_is_high)
254 local_irq_save(flags); 253 local_irq_save(flags);