From 7124761ebb33581f7b045712a82663ac3cd4680d Mon Sep 17 00:00:00 2001 From: Minjie Zhuang Date: Thu, 28 May 2020 19:53:55 +0800 Subject: [PATCH] MGS-5709 [#imx-1439] fix gpu suspend/resume stuck L4.19 SCFW introduced LP mode, clk_set requires power-on, fixed GPU govern to conform with the latest SCFW change. remove redundant clk_set_rate in probe to fix LP clock. Signed-off-by: Xianzhong --- .../freescale/gc_hal_kernel_platform_imx.c | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) 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 e97303c9a213..2f109bc92d37 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 @@ -602,14 +602,8 @@ int init_gpu_opp_table(struct device *dev) int nr; int ret = 0; int i, p; - int core = gcvCORE_MAJOR; struct imx_priv *priv = &imxPriv; - struct clk *clk_core; - struct clk *clk_shader; - - unsigned long core_freq, shader_freq; - priv->imx_gpu_govern.num_modes = 0; prop = of_find_property(dev->of_node, "operating-points", NULL); @@ -689,32 +683,8 @@ int init_gpu_opp_table(struct device *dev) ret = driver_create_file(dev->driver, &driver_attr_gpu_govern); if (ret) { dev_err(dev, "create gpu_govern attr failed (%d)\n", ret); - return ret; - } - - /* - * This could be redundant, but it is useful for testing DTS with - * different OPPs that have assigned-clock rates different than the - * ones specified in OPP tuple array. Otherwise we will display - * different clock values when the driver is loaded. Further - * modifications of the governor will display correctly but not when - * the driver has been loaded. - */ - core_freq = priv->imx_gpu_govern.core_clk_freq[priv->imx_gpu_govern.current_mode]; - shader_freq = priv->imx_gpu_govern.shader_clk_freq[priv->imx_gpu_govern.current_mode]; - - if (core_freq && shader_freq) { - for (; core <= gcvCORE_3D_MAX; core++) { - clk_core = priv->imx_gpu_clks[core].clk_core; - clk_shader = priv->imx_gpu_clks[core].clk_shader; - - if (clk_core != NULL && clk_shader != NULL) { - clk_set_rate(clk_core, core_freq); - clk_set_rate(clk_shader, shader_freq); - } - } - } - + return ret; + } } return ret;