From eaeb5ff20f7663738cea2a415a7d923febf7ff85 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Mon, 7 Nov 2016 15:49:00 +0530 Subject: gpu: nvgpu: Add thermal alert event handling * Added the thermal alert event handling * Added the thermal alert event PMU RPC JIRA DNVGPU-130 Bug 200231080 Change-Id: If5ff2704e5aa6ad2f25123f72c3049a311dae5dc Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1248964 (cherry picked from commit 1850e5a9b9dfa2f9df634e2f284ab282ad9f7fc8) Reviewed-on: http://git-master/r/1253452 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 56ebda1a..58dd6f43 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -4029,6 +4029,24 @@ static int pmu_handle_perfmon_event(struct pmu_gk20a *pmu, } +static int pmu_handle_therm_event(struct pmu_gk20a *pmu, + struct nv_pmu_therm_msg *msg) +{ + gk20a_dbg_fn(""); + + switch (msg->msg_type) { + case NV_PMU_THERM_MSG_ID_EVENT_HW_SLOWDOWN_NOTIFICATION: + gk20a_dbg_pmu("received asserted event mask %d", + msg->hw_slct_msg.mask); + break; + default: + gk20a_dbg_pmu("unkown therm event received %d", msg->msg_type); + break; + } + + return 0; +} + static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) { int err = 0; @@ -4048,6 +4066,9 @@ static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) WARN_ON(1); } break; + case PMU_UNIT_THERM: + err = pmu_handle_therm_event(pmu, &msg->msg.therm); + break; default: break; } -- cgit v1.2.2