Revert "rk: cma: attempt to allocate same range memory while cma allocation failure"
authorCMY <cmy@rock-chips.com>
Tue, 22 Jul 2014 07:35:12 +0000 (15:35 +0800)
committerCMY <cmy@rock-chips.com>
Thu, 31 Jul 2014 09:54:27 +0000 (17:54 +0800)
This reverts commit 17beed5e65b338169ff45cfc6f9c4f28f86b3899.

arch/arm/configs/rockchip_defconfig
drivers/base/Kconfig
drivers/base/dma-contiguous.c

index 246e25729400342ca5a5d04c2839095ea8c49d9d..fb6d3016ed64a436fc00640462909007e04ac363 100644 (file)
@@ -209,7 +209,6 @@ CONFIG_RFKILL=y
 CONFIG_RFKILL_RK=y
 CONFIG_DEVTMPFS=y
 CONFIG_DMA_CMA=y
-CONFIG_CMA_ALLOC_RETRY=20
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_UID_STAT=y
 CONFIG_SRAM=y
index 5f58056429e6f56a532b695b888f33a23a371561..10cd80af2aecc7f2908eee0033c4d151c24b84c1 100644 (file)
@@ -278,14 +278,6 @@ config CMA_AREAS
 
          If unsure, leave the default value "7".
 
-config CMA_ALLOC_RETRY
-       int "Maximum count to retry of the CMA Allocation"
-       depends on ARCH_ROCKCHIP
-       default 20
-       help
-         CMA allocation range may be busy at this time, we can try again a few
-         time to make allocate successful.
-
 endif
 
 endmenu
index 3bf898d5f866eb2db0d07f704f5805b9940bcf09..99802d6f3c60f603efcff5d342ba0c9f4c937ccd 100644 (file)
@@ -297,18 +297,12 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
        mutex_lock(&cma_mutex);
 
        for (;;) {
-#ifdef CONFIG_CMA_ALLOC_RETRY
-               int retry = 0;
-#endif
                pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
                                                    start, count, mask);
                if (pageno >= cma->count)
                        break;
 
                pfn = cma->base_pfn + pageno;
-#ifdef CONFIG_CMA_ALLOC_RETRY
-               do {
-#endif
                ret = alloc_contig_range(pfn, pfn + count, MIGRATE_CMA);
                if (ret == 0) {
                        bitmap_set(cma->bitmap, pageno, count);
@@ -317,12 +311,6 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
                } else if (ret != -EBUSY) {
                        break;
                }
-#ifdef CONFIG_CMA_ALLOC_RETRY
-               }while (++retry<=CONFIG_CMA_ALLOC_RETRY);
-
-               if (retry<=CONFIG_CMA_ALLOC_RETRY)
-                       break;
-#endif
                pr_debug("%s(): memory range at %p is busy, retrying\n",
                         __func__, pfn_to_page(pfn));
                /* try again with a bit different memory target */