gpu: nvgpu: Remove dependency between volt and pmu

This patch does the following
1. Use function pointers to access volt event handler from pmu.
2. Remove volt.h header include.
3. Assign the pointer during SW setup of volt.

Jira NVGPU-1956

Change-Id: I87e207c0f4e05f4d25158da276d1fad389a6354d
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2097739
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Abdul Salam
2019-04-15 16:17:06 +05:30
committed by mobile promotions
parent 12a06fe060
commit b70d9c0c26
3 changed files with 7 additions and 2 deletions

View File

@@ -26,7 +26,6 @@
#include <nvgpu/pmu/msg.h> #include <nvgpu/pmu/msg.h>
#include <nvgpu/string.h> #include <nvgpu/string.h>
#include <nvgpu/gk20a.h> #include <nvgpu/gk20a.h>
#include <nvgpu/pmu/volt.h>
#include <nvgpu/pmu/lsfm.h> #include <nvgpu/pmu/lsfm.h>
#include <nvgpu/pmu/super_surface.h> #include <nvgpu/pmu/super_surface.h>
#include <nvgpu/pmu/pmu_perfmon.h> #include <nvgpu/pmu/pmu_perfmon.h>
@@ -561,7 +560,9 @@ void nvgpu_pmu_rpc_handler(struct gk20a *g, struct pmu_msg *msg,
nvgpu_pmu_perfmon_rpc_handler(g, pmu, &rpc, rpc_payload); nvgpu_pmu_perfmon_rpc_handler(g, pmu, &rpc, rpc_payload);
break; break;
case PMU_UNIT_VOLT: case PMU_UNIT_VOLT:
nvgpu_pmu_volt_rpc_handler(g, &rpc); if (pmu->volt_rpc_handler != NULL) {
pmu->volt_rpc_handler(g, &rpc);
}
break; break;
case PMU_UNIT_CLK: case PMU_UNIT_CLK:
nvgpu_pmu_dbg(g, "reply PMU_UNIT_CLK"); nvgpu_pmu_dbg(g, "reply PMU_UNIT_CLK");

View File

@@ -592,6 +592,8 @@ int nvgpu_volt_dev_sw_setup(struct gk20a *g)
} }
} }
g->pmu.volt_rpc_handler = nvgpu_pmu_volt_rpc_handler;
done: done:
nvgpu_log_info(g, " done status %x", status); nvgpu_log_info(g, " done status %x", status);
return status; return status;

View File

@@ -243,6 +243,8 @@ struct nvgpu_pmu {
void (*remove_support)(struct nvgpu_pmu *pmu); void (*remove_support)(struct nvgpu_pmu *pmu);
void (*therm_rpc_handler)(struct gk20a *g, void (*therm_rpc_handler)(struct gk20a *g,
struct nv_pmu_rpc_header *rpc); struct nv_pmu_rpc_header *rpc);
void (*volt_rpc_handler)(struct gk20a *g,
struct nv_pmu_rpc_header *rpc);
bool sw_ready; bool sw_ready;
struct nvgpu_mutex isr_mutex; struct nvgpu_mutex isr_mutex;