mtd: omap2: performance hack
authorGrazvydas Ignotas <notasas@gmail.com>
Wed, 11 Apr 2012 01:24:38 +0000 (04:24 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 21:27:57 +0000 (00:27 +0300)
hides wakeup latency problem, but uses more power

drivers/mtd/nand/omap2.c

index 7f0d34b..852f9d7 100644 (file)
@@ -24,6 +24,7 @@
 #include <plat/dma.h>
 #include <plat/gpmc.h>
 #include <plat/nand.h>
+#include <asm/system.h>
 
 #define        DRIVER_NAME     "omap2-nand"
 #define        OMAP_NAND_TIMEOUT_MS    5000
@@ -404,12 +405,16 @@ static inline int omap_nand_dma_transfer(struct mtd_info *mtd, void *addr,
                /* PFPW engine is busy, use cpu copy method */
                goto out_copy_unmap;
 
+       /* this will be short, avoid CPU wakeup latency */
+       disable_hlt();
        init_completion(&info->comp);
 
        omap_start_dma(info->dma_ch);
 
        /* setup and start DMA using dma_addr */
        wait_for_completion(&info->comp);
+       enable_hlt();
+
        tim = 0;
        limit = (loops_per_jiffy * msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
        while (gpmc_read_status(GPMC_PREFETCH_COUNT) && (tim++ < limit))