From 27ff49fab026a61ce829dff506d62080bb6783b4 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 28 Jan 2019 17:15:04 -0800 Subject: [PATCH] gpu: nvgpu: vgpu: set get_arbiter_clk_domains null if not can_set_clkrate If guest does not support set clock rate, get_arbiter_clk_domains needs to be null to disable clk arbiter at ioctl level. Also explicitly set clk.support_clk_freq_controller to false. Jira GVSCI-277 Bug 200488368 Change-Id: I7b00e88510ea31a9bdc1bb2138b45f7e369d81dd Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/2006753 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury Reviewed-by: Nirav Patel Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c | 3 +++ drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c index 87f2606a9..ad9022700 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c @@ -700,6 +700,9 @@ int vgpu_gp10b_init_hal(struct gk20a *g) if (priv->constants.can_set_clkrate) { gops->clk.support_clk_freq_controller = true; + } else { + gops->clk.support_clk_freq_controller = false; + gops->clk_arb.get_arbiter_clk_domains = NULL; } g->name = "gp10b"; diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c index c18ee4cf2..e85bbc969 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c @@ -771,6 +771,9 @@ int vgpu_gv11b_init_hal(struct gk20a *g) if (priv->constants.can_set_clkrate) { gops->clk.support_clk_freq_controller = true; + } else { + gops->clk.support_clk_freq_controller = false; + gops->clk_arb.get_arbiter_clk_domains = NULL; } g->name = "gv11b";