From 2f32babb81cf8cc9adb2c8a3005f4ed5321d67f1 Mon Sep 17 00:00:00 2001 From: Hu Gang Date: Thu, 8 Dec 2011 16:50:06 +0800 Subject: [PATCH] [PORT FROM R2] Revert "atomisp: fix alloc pages block issue in driver." BZ: 17272 Issues: Phone reset in low memory condition when doing burst capture. Solution: Suspect the patch in memory allocation in atomisp driver. So revert this patch first. Change-Id: Id7a985e86481a1de01a4b7e3360a61dfc342f64c Orig-Change-Id: I8d49403963a8c2c7e9c097b60f439f3458bf2756 Signed-off-by: Hu Gang Reviewed-on: http://android.intel.com:8080/26678 Reviewed-by: Koski, Anttu Tested-by: Koski, Anttu Reviewed-by: buildbot Tested-by: buildbot Reviewed-on: http://android.intel.com:8080/28051 Reviewed-by: Tuominen, TeemuX --- drivers/media/video/atomisp/hmm/hmm_bo.c | 34 +++----------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/media/video/atomisp/hmm/hmm_bo.c b/drivers/media/video/atomisp/hmm/hmm_bo.c index 0b40673..bf539cb 100644 --- a/drivers/media/video/atomisp/hmm/hmm_bo.c +++ b/drivers/media/video/atomisp/hmm/hmm_bo.c @@ -339,13 +339,10 @@ static int alloc_private_pages(struct hmm_buffer_object *bo, int from_highmem, unsigned int pgnr, order, blk_pgnr; struct page *pages; struct page_block *pgblk; - gfp_t gfp = GFP_NOWAIT; + gfp_t gfp; int i, j; - int failure_number = 0; - bool reduce_order = false; - bool lack_mem = false; - + gfp = GFP_KERNEL; if (from_highmem) gfp |= __GFP_HIGHMEM; @@ -360,13 +357,7 @@ static int alloc_private_pages(struct hmm_buffer_object *bo, int from_highmem, i = 0; while (pgnr) { order = nr_to_order_bottom(pgnr); - /* - * if be short of memory, we will set order to 0 - * everytime - */ - if (lack_mem) - order = HMM_MIN_ORDER; - else if (order > HMM_MAX_ORDER) + if (order > HMM_MAX_ORDER) order = HMM_MAX_ORDER; retry: pages = alloc_pages(gfp, order); @@ -387,16 +378,6 @@ retry: "reduing page order to %d.\n", order, HMM_MIN_ORDER); order = HMM_MIN_ORDER; - failure_number++; - reduce_order = true; - /* - * if fail two times continuously, we think be - * short of memory now - */ - if (failure_number == 2) { - lack_mem = true; - failure_number = 0; - } goto retry; } else { blk_pgnr = order_to_nr(order); @@ -431,15 +412,6 @@ retry: goto cleanup; } } - - /* - * if order is not reduced this time, clear - * failure number - */ - if (reduce_order) - reduce_order = false; - else - failure_number = 0; } } -- 2.7.4