Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.infradead.org/mtd-2.6

* git://git.infradead.org/mtd-2.6:
mtd: atmel_nand: use CPU I/O when buffer is in vmalloc(ed) region
mtd: atmel_nand: modify test case for using DMA operations
mtd: atmel_nand: fix support for CPUs that do not support DMA access
mtd: atmel_nand: trivial: change DMA usage information trace
mtd: mtdswap: fix printk format warning

+13 -21
+1 -1
drivers/mtd/mtdswap.c
··· 1452 1452 oinfo = mtd->ecclayout; 1453 1453 if (!mtd->oobsize || !oinfo || oinfo->oobavail < MTDSWAP_OOBSIZE) { 1454 1454 printk(KERN_ERR "%s: Not enough free bytes in OOB, " 1455 - "%d available, %lu needed.\n", 1455 + "%d available, %zu needed.\n", 1456 1456 MTDSWAP_PREFIX, oinfo->oobavail, MTDSWAP_OOBSIZE); 1457 1457 return; 1458 1458 }
+12 -20
drivers/mtd/nand/atmel_nand.c
··· 209 209 int err = -EIO; 210 210 enum dma_data_direction dir = is_read ? DMA_FROM_DEVICE : DMA_TO_DEVICE; 211 211 212 - if (buf >= high_memory) { 213 - struct page *pg; 214 - 215 - if (((size_t)buf & PAGE_MASK) != 216 - ((size_t)(buf + len - 1) & PAGE_MASK)) { 217 - dev_warn(host->dev, "Buffer not fit in one page\n"); 218 - goto err_buf; 219 - } 220 - 221 - pg = vmalloc_to_page(buf); 222 - if (pg == 0) { 223 - dev_err(host->dev, "Failed to vmalloc_to_page\n"); 224 - goto err_buf; 225 - } 226 - p = page_address(pg) + ((size_t)buf & ~PAGE_MASK); 227 - } 212 + if (buf >= high_memory) 213 + goto err_buf; 228 214 229 215 dma_dev = host->dma_chan->device; 230 216 ··· 266 280 struct nand_chip *chip = mtd->priv; 267 281 struct atmel_nand_host *host = chip->priv; 268 282 269 - if (use_dma && len >= mtd->oobsize) 283 + if (use_dma && len > mtd->oobsize) 284 + /* only use DMA for bigger than oob size: better performances */ 270 285 if (atmel_nand_dma_op(mtd, buf, len, 1) == 0) 271 286 return; 272 287 ··· 282 295 struct nand_chip *chip = mtd->priv; 283 296 struct atmel_nand_host *host = chip->priv; 284 297 285 - if (use_dma && len >= mtd->oobsize) 298 + if (use_dma && len > mtd->oobsize) 299 + /* only use DMA for bigger than oob size: better performances */ 286 300 if (atmel_nand_dma_op(mtd, (void *)buf, len, 0) == 0) 287 301 return; 288 302 ··· 587 599 nand_chip->options |= NAND_USE_FLASH_BBT; 588 600 } 589 601 590 - if (cpu_has_dma() && use_dma) { 602 + if (!cpu_has_dma()) 603 + use_dma = 0; 604 + 605 + if (use_dma) { 591 606 dma_cap_mask_t mask; 592 607 593 608 dma_cap_zero(mask); ··· 602 611 } 603 612 } 604 613 if (use_dma) 605 - dev_info(host->dev, "Using DMA for NAND access.\n"); 614 + dev_info(host->dev, "Using %s for DMA transfers.\n", 615 + dma_chan_name(host->dma_chan)); 606 616 else 607 617 dev_info(host->dev, "No DMA support for NAND access.\n"); 608 618