From 364c7804693f672e155bc416b040bfc18e9b3c4d Mon Sep 17 00:00:00 2001 From: Abdul Salam Date: Wed, 10 Apr 2019 12:24:02 +0530 Subject: [PATCH] gpu: nvgpu: Remove cyclic dependency between arb & vf Remove cyclic dependency between arb and vf point units. Remove the header files and call the functions with funciton pointers. Remove lpwr.h as they are not used. Jira: NVGPU-1966 Change-Id: I64b1eb810fc343d8930857793f0d00a683cfd05d Signed-off-by: Abdul Salam Reviewed-on: https://git-master.nvidia.com/r/2094043 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/clk_arb/clk_arb.c | 4 +--- drivers/gpu/nvgpu/common/pmu/clk/clk_vf_point.c | 2 ++ drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 + drivers/gpu/nvgpu/include/nvgpu/clk_arb.h | 1 - drivers/gpu/nvgpu/include/nvgpu/pmu/clk/clk.h | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c index 098add86c..01c1a2001 100644 --- a/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c +++ b/drivers/gpu/nvgpu/common/clk_arb/clk_arb.c @@ -35,10 +35,8 @@ #include #include #include -#include #include #include -#include int nvgpu_clk_notification_queue_alloc(struct gk20a *g, struct nvgpu_clk_notification_queue *queue, @@ -234,7 +232,7 @@ static void nvgpu_clk_arb_run_vf_table_cb(struct nvgpu_clk_arb *arb) int err; /* get latest vf curve from pmu */ - err = nvgpu_clk_vf_point_cache(g); + err = g->clk_pmu->nvgpu_clk_vf_point_cache(g); if (err != 0) { nvgpu_err(g, "failed to cache VF table"); nvgpu_clk_arb_set_global_alarm(g, diff --git a/drivers/gpu/nvgpu/common/pmu/clk/clk_vf_point.c b/drivers/gpu/nvgpu/common/pmu/clk/clk_vf_point.c index 372566925..83e1c9c44 100644 --- a/drivers/gpu/nvgpu/common/pmu/clk/clk_vf_point.c +++ b/drivers/gpu/nvgpu/common/pmu/clk/clk_vf_point.c @@ -627,6 +627,8 @@ int nvgpu_clk_vf_point_init_pmupstate(struct gk20a *g) return -ENOMEM; } + g->clk_pmu->nvgpu_clk_vf_point_cache = nvgpu_clk_vf_point_cache; + return 0; } diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index d311e84ae..f7daaf11a 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c @@ -181,6 +181,7 @@ #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h index 8cf60fb1c..f0ad1de7d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h +++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h @@ -37,7 +37,6 @@ struct gk20a; #include #include #include -#include #define MAX_F_POINTS 256 #define DEFAULT_EVENT_NUMBER 32U diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu/clk/clk.h b/drivers/gpu/nvgpu/include/nvgpu/pmu/clk/clk.h index 539100977..ab22d276d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu/clk/clk.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu/clk/clk.h @@ -100,6 +100,9 @@ struct nvgpu_clk_pmupstate { u8 (*get_fll_lut_vf_num_entries)(struct nvgpu_clk_pmupstate *pclk); u32 (*get_fll_lut_min_volt)(struct nvgpu_clk_pmupstate *pclk); u32 (*get_fll_lut_step_size)(struct nvgpu_clk_pmupstate *pclk); + + /* clk_vf_point functions */ + int (*nvgpu_clk_vf_point_cache)(struct gk20a *g); }; void nvgpu_clkrpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,