* [PATCH] ide: Fix IDE PIO size calculation
@ 2013-06-20 4:14 Steven J. Hill
2013-06-20 11:05 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Steven J. Hill @ 2013-06-20 4:14 UTC (permalink / raw)
To: David S . Miller; +Cc: Leonid Yegoshin, linux-ide
From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
IDE PIO calculates the size wrong when passing the parameter
"ide-core.nodma=0.0" to the kernel.
Change-Id: Id82c2bc5965d85960846db53d84846d9a05d75a3
Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
---
drivers/ide/ide-taskfile.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 729428e..dabb88b 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,
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);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ide: Fix IDE PIO size calculation
2013-06-20 4:14 [PATCH] ide: Fix IDE PIO size calculation Steven J. Hill
@ 2013-06-20 11:05 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2013-06-20 11:05 UTC (permalink / raw)
To: Steven J. Hill; +Cc: David S . Miller, Leonid Yegoshin, linux-ide
Hello.
On 20-06-2013 8:14, Steven J. Hill wrote:
> From: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> IDE PIO calculates the size wrong when passing the parameter
> "ide-core.nodma=0.0" to the kernel.
> Change-Id: Id82c2bc5965d85960846db53d84846d9a05d75a3
This line has no place in the upstream commit, and I've already told
Leonid to get rid of it.
> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
> Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
WBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-20 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 4:14 [PATCH] ide: Fix IDE PIO size calculation Steven J. Hill
2013-06-20 11:05 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).