From 0fc8b8b2459126ec7c1d26855ad1d439ae9c4e8f Mon Sep 17 00:00:00 2001 From: Chris Goldsworthy Date: Tue, 18 Feb 2020 23:58:27 -0800 Subject: [PATCH] ion: Fix pool refill error When performing secure pool allocations, it's possible to spuriously trigger pool refill attempts for the cached and uncached pools. Fix this by adding a check to see if we're performing a secure allocation or not, before refilling a pool. Change-Id: I9a415a302ca92790e6a793784020b09dea6a86e1 [cgoldswo@codeaurora.org: Fix merge conflicts] Signed-off-by: Chris Goldsworthy --- drivers/staging/android/ion/heaps/ion_system_heap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/heaps/ion_system_heap.c b/drivers/staging/android/ion/heaps/ion_system_heap.c index 2c5ab98caacd..71c193f48222 100644 --- a/drivers/staging/android/ion/heaps/ion_system_heap.c +++ b/drivers/staging/android/ion/heaps/ion_system_heap.c @@ -3,7 +3,7 @@ * ION Memory Allocator system heap exporter * * Copyright (C) 2011 Google, Inc. - * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved. * */ @@ -82,7 +82,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *sys_heap, page = ion_page_pool_alloc(pool, from_pool); if (pool_auto_refill_en && - pool_count_below_lowmark(pool)) { + pool_count_below_lowmark(pool) && vmid <= 0) { wake_up_process(sys_heap->kworker[cached]); }