diff options
author | Lakshmanan M <lm@nvidia.com> | 2016-11-07 05:19:00 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-10 06:54:56 -0500 |
commit | eaeb5ff20f7663738cea2a415a7d923febf7ff85 (patch) | |
tree | fa81708fa3cbb8772fbce84a23bf4f71729acc33 /drivers/gpu/nvgpu/gk20a | |
parent | 21c83717b1826c854fe131528379b634a3c892c8 (diff) |
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 <lm@nvidia.com>
Reviewed-on: http://git-master/r/1248964
(cherry picked from commit 1850e5a9b9dfa2f9df634e2f284ab282ad9f7fc8)
Reviewed-on: http://git-master/r/1253452
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 9e0dd64a..b955a84a 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -593,6 +593,7 @@ struct gpu_ops { | |||
593 | int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); | 593 | int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8); |
594 | void (*get_internal_sensor_limits)(s32 *max_24_8, | 594 | void (*get_internal_sensor_limits)(s32 *max_24_8, |
595 | s32 *min_24_8); | 595 | s32 *min_24_8); |
596 | u32 (*configure_therm_alert)(struct gk20a *g, s32 curr_warn_temp); | ||
596 | } therm; | 597 | } therm; |
597 | struct { | 598 | struct { |
598 | bool (*is_pmu_supported)(struct gk20a *g); | 599 | bool (*is_pmu_supported)(struct gk20a *g); |
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, | |||
4029 | } | 4029 | } |
4030 | 4030 | ||
4031 | 4031 | ||
4032 | static int pmu_handle_therm_event(struct pmu_gk20a *pmu, | ||
4033 | struct nv_pmu_therm_msg *msg) | ||
4034 | { | ||
4035 | gk20a_dbg_fn(""); | ||
4036 | |||
4037 | switch (msg->msg_type) { | ||
4038 | case NV_PMU_THERM_MSG_ID_EVENT_HW_SLOWDOWN_NOTIFICATION: | ||
4039 | gk20a_dbg_pmu("received asserted event mask %d", | ||
4040 | msg->hw_slct_msg.mask); | ||
4041 | break; | ||
4042 | default: | ||
4043 | gk20a_dbg_pmu("unkown therm event received %d", msg->msg_type); | ||
4044 | break; | ||
4045 | } | ||
4046 | |||
4047 | return 0; | ||
4048 | } | ||
4049 | |||
4032 | static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) | 4050 | static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) |
4033 | { | 4051 | { |
4034 | int err = 0; | 4052 | int err = 0; |
@@ -4048,6 +4066,9 @@ static int pmu_handle_event(struct pmu_gk20a *pmu, struct pmu_msg *msg) | |||
4048 | WARN_ON(1); | 4066 | WARN_ON(1); |
4049 | } | 4067 | } |
4050 | break; | 4068 | break; |
4069 | case PMU_UNIT_THERM: | ||
4070 | err = pmu_handle_therm_event(pmu, &msg->msg.therm); | ||
4071 | break; | ||
4051 | default: | 4072 | default: |
4052 | break; | 4073 | break; |
4053 | } | 4074 | } |