From 1919e3d736fd57a33bc87d7c06eaf121415ff91c Mon Sep 17 00:00:00 2001 From: Zhen Chen Date: Thu, 2 Nov 2017 10:41:30 +0800 Subject: [PATCH] MALI Utgard: RK: fix some potential problems about pm_runtime Including: not to call pm_runtime_suspend() in mali_runtime_idle(); make it more strict to power off the GPU. Change-Id: I8c49dd13f57826f28606fd7a4e451707978b2906 Signed-off-by: Zhen Chen --- drivers/gpu/arm/mali400/mali/platform/rk/rk.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c index f354d2cf94f0..4db5212dab3e 100644 --- a/drivers/gpu/arm/mali400/mali/platform/rk/rk.c +++ b/drivers/gpu/arm/mali400/mali/platform/rk/rk.c @@ -62,9 +62,7 @@ struct rk_context *s_rk_context; static int rk_context_create_sysfs_files(struct device *dev) { - int ret = 0; - - return ret; + return 0; } static void rk_context_remove_sysfs_files(struct device *dev) @@ -358,7 +356,8 @@ static int mali_runtime_suspend(struct device *device) ret = device->driver->pm->runtime_suspend(device); } - rk_platform_power_off_gpu(device); + if (!ret) + rk_platform_power_off_gpu(device); return ret; } @@ -396,8 +395,6 @@ static int mali_runtime_idle(struct device *device) return ret; } - pm_runtime_suspend(device); - return 0; } #endif @@ -415,7 +412,8 @@ static int mali_os_suspend(struct device *device) ret = device->driver->pm->suspend(device); } - rk_platform_power_off_gpu(device); + if (!ret) + rk_platform_power_off_gpu(device); return ret; }