From bd114e8d0fb975fcda368c117cd2728ea391f0e0 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Tue, 3 Nov 2020 18:06:32 -0800 Subject: [PATCH] gpu: nvgpu: Do not call tegra_pcm_writel/readl In K5.9 those two functions are changed to reject calls directly using global pmc pointer. So it's a bit complicated to revert to the point where GPU can feel free to call them. For an easier future mantainance, a new set of APIs are added to all existing kernels to let GPU driver control clamp without any direct access to PMC registers. Bug 200663781 Change-Id: Ifce4765525eee6d61083896fc9a126892cbb86ba Signed-off-by: Nicolin Chen Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2441010 Reviewed-by: automaticguardword Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman Reviewed-by: Sachin Nikam Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index 2e1be5efe..02385b89e 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -342,9 +342,7 @@ static int gm20b_tegra_railgate(struct device *dev) udelay(10); - /* enable clamp */ - tegra_pmc_writel_relaxed(0x1, PMC_GPU_RG_CNTRL_0); - tegra_pmc_readl(PMC_GPU_RG_CNTRL_0); + tegra_pmc_gpu_clamp_enable(); udelay(10); @@ -458,8 +456,7 @@ static int gm20b_tegra_unrailgate(struct device *dev) udelay(10); - tegra_pmc_writel_relaxed(0, PMC_GPU_RG_CNTRL_0); - tegra_pmc_readl(PMC_GPU_RG_CNTRL_0); + tegra_pmc_gpu_clamp_disable(); udelay(10);