From 68407e8f621548a25914112355799a6f864a1c2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicu=C8=99or=20C=C3=AE=C8=9Bu?= Date: Thu, 15 Apr 2021 09:59:26 +0300 Subject: [PATCH] MGS-6197 [#imx-2532] GPU crash when changing gpu_govern mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Put GPU into suspend instead of idle. Suspend will also disable internal clocks. Signed-off-by: Nicușor Cîțu --- .../mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 2 +- .../kernel/platform/freescale/gc_hal_kernel_platform_imx.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c index 7e941f54eb8a..338ebb5b0a58 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c @@ -1416,7 +1416,7 @@ static int gpu_suspend(struct platform_device *dev, pm_message_t state) sem_acquired = gcvTRUE; - /* Suspend the GPU to off state. */ + /* Power off the GPU. */ gcmkONERROR(gckGALDEVICE_Suspend(device, gcvPOWER_OFF)); return 0; diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c index 924691ef047c..cc2b368e6e13 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c @@ -581,8 +581,8 @@ static ssize_t gpu_govern_store(struct device_driver *dev, const char *buf, size sem_acquired = gcvTRUE; - /* Suspend the GPU to idle state. */ - gcmkONERROR(gckGALDEVICE_Suspend(device, gcvPOWER_IDLE)); + /* Suspend the GPU. */ + gcmkONERROR(gckGALDEVICE_Suspend(device, gcvPOWER_SUSPEND)); core_freq = priv->imx_gpu_govern.core_clk_freq[i]; shader_freq = priv->imx_gpu_govern.shader_clk_freq[i]; -- 2.17.1