From 42b8bf7d13add00738b5bc204cae0409d9728d37 Mon Sep 17 00:00:00 2001 From: Neeraj Soni Date: Thu, 20 Apr 2017 14:18:02 +0530 Subject: [PATCH] soc: qcom: Request GFP_NOIO for effective memory reclaim Request for memory with GFP_NOIO so that new IO request is not raised while reclaiming the memory when system is having low memory. With GFP_KERNEL a deadlock is possible with scm function requsting for memory during PFK operation intiated by block layer through storage driver. With low memory system will try to reclaim some memory. If GFP_KERNEL is used this will lead to IO operation through storage driver which is already serving PFK encryption call hence can not take up this IO request causing deadlock. Change-Id: I1a4abbea31f430ca5f8ba030babf958a9ab51fdf Signed-off-by: Neeraj Soni --- drivers/soc/qcom/scm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/scm.c b/drivers/soc/qcom/scm.c index 045a5001fc9f..36804b988d62 100644 --- a/drivers/soc/qcom/scm.c +++ b/drivers/soc/qcom/scm.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -654,7 +654,7 @@ int scm_call2(u32 fn_id, struct scm_desc *desc) if (unlikely(!is_scm_armv8())) return -ENODEV; - ret = allocate_extra_arg_buffer(desc, GFP_KERNEL); + ret = allocate_extra_arg_buffer(desc, GFP_NOIO); if (ret) return ret;