diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_gk20a.c b/drivers/gpu/nvgpu/common/pmu/pmu_gk20a.c index 307607e66..06e3b8aaa 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_gk20a.c @@ -359,31 +359,6 @@ bool gk20a_is_pmu_supported(struct gk20a *g) return true; } -int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu, - struct nv_pmu_therm_msg *msg) -{ - struct gk20a *g = gk20a_from_pmu(pmu); - - nvgpu_log_fn(g, " "); - - switch (msg->msg_type) { - case NV_PMU_THERM_MSG_ID_EVENT_HW_SLOWDOWN_NOTIFICATION: - if (msg->hw_slct_msg.mask == BIT(NV_PMU_THERM_EVENT_THERMAL_1)) { - nvgpu_clk_arb_send_thermal_alarm(pmu->g); - } else { - nvgpu_pmu_dbg(g, "Unwanted/Unregistered thermal event received %d", - msg->hw_slct_msg.mask); - } - break; - default: - nvgpu_pmu_dbg(g, "unknown therm event received %d", - msg->msg_type); - break; - } - - return 0; -} - bool gk20a_pmu_is_interrupted(struct nvgpu_pmu *pmu) { struct gk20a *g = gk20a_from_pmu(pmu); diff --git a/drivers/gpu/nvgpu/common/pmu/therm/thrm.c b/drivers/gpu/nvgpu/common/pmu/therm/thrm.c index 2ad8b6a96..7517aaa03 100644 --- a/drivers/gpu/nvgpu/common/pmu/therm/thrm.c +++ b/drivers/gpu/nvgpu/common/pmu/therm/thrm.c @@ -22,10 +22,38 @@ #include #include +#include #include "thrm.h" #include "thrmpmu.h" +int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu, + struct nv_pmu_therm_msg *msg) +{ + struct gk20a *g = gk20a_from_pmu(pmu); + + nvgpu_log_fn(g, " "); + + switch (msg->msg_type) { + case NV_PMU_THERM_MSG_ID_EVENT_HW_SLOWDOWN_NOTIFICATION: + if (msg->hw_slct_msg.mask == + BIT(NV_PMU_THERM_EVENT_THERMAL_1)) { + nvgpu_clk_arb_send_thermal_alarm(pmu->g); + } else { + nvgpu_pmu_dbg(g, + "Unwanted/Unregistered thermal event received %d", + msg->hw_slct_msg.mask); + } + break; + default: + nvgpu_pmu_dbg(g, "unkown therm event received %d", + msg->msg_type); + break; + } + + return 0; +} + int nvgpu_therm_domain_sw_setup(struct gk20a *g) { int status; diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu.h b/drivers/gpu/nvgpu/include/nvgpu/pmu.h index 345df598d..faaf428d3 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu.h @@ -278,9 +278,6 @@ int nvgpu_pmu_lock_acquire(struct gk20a *g, struct nvgpu_pmu *pmu, int nvgpu_pmu_lock_release(struct gk20a *g, struct nvgpu_pmu *pmu, u32 id, u32 *token); -int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu, - struct nv_pmu_therm_msg *msg); - /* PMU init */ int nvgpu_init_pmu_support(struct gk20a *g); int nvgpu_pmu_destroy(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu/therm.h b/drivers/gpu/nvgpu/include/nvgpu/pmu/therm.h index 00d1531c0..5c1976c3c 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pmu/therm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu/therm.h @@ -25,7 +25,11 @@ #define NVGPU_PMU_THERM_H struct gk20a; +struct nvgpu_pmu; +struct nv_pmu_therm_msg; +int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu, + struct nv_pmu_therm_msg *msg); int nvgpu_therm_domain_sw_setup(struct gk20a *g); int nvgpu_therm_domain_pmu_setup(struct gk20a *g); int nvgpu_therm_pmu_init_pmupstate(struct gk20a *g);