linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MTD: atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region
@ 2011-03-31 10:33 Hong Xu
  2011-04-01 14:20 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Hong Xu @ 2011-03-31 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

The previous way of dealing with vmalloc(ed) region by walking though the pages can not work well actually.
We just fall back to CPU I/O when the buffer address is higher than `high_memory'.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Hong Xu <hong.xu@atmel.com>
---
 drivers/mtd/nand/atmel_nand.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 1b43654..ed0863a 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -209,22 +209,8 @@ static int atmel_nand_dma_op(struct mtd_info *mtd, void *buf, int len,
 	int err = -EIO;
 	enum dma_data_direction dir = is_read ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
 
-	if (buf >= high_memory) {
-		struct page *pg;
-
-		if (((size_t)buf & PAGE_MASK) !=
-		    ((size_t)(buf + len - 1) & PAGE_MASK)) {
-			dev_warn(host->dev, "Buffer not fit in one page\n");
-			goto err_buf;
-		}
-
-		pg = vmalloc_to_page(buf);
-		if (pg == 0) {
-			dev_err(host->dev, "Failed to vmalloc_to_page\n");
-			goto err_buf;
-		}
-		p = page_address(pg) + ((size_t)buf & ~PAGE_MASK);
-	}
+	if (buf >= high_memory)
+		goto err_buf;
 
 	dma_dev = host->dma_chan->device;
 
-- 
1.7.3.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] MTD: atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region
  2011-03-31 10:33 [PATCH] MTD: atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region Hong Xu
@ 2011-04-01 14:20 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2011-04-01 14:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2011-03-31 at 18:33 +0800, Hong Xu wrote:
> The previous way of dealing with vmalloc(ed) region by walking though the pages can not work well actually.
> We just fall back to CPU I/O when the buffer address is higher than `high_memory'.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Hong Xu <hong.xu@atmel.com>

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy (????? ????????)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-01 14:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-31 10:33 [PATCH] MTD: atmel_nand: Fall back to CPU I/O when buffer is in vmalloc(ed) region Hong Xu
2011-04-01 14:20 ` Artem Bityutskiy

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).