gpu: nvgpu: remove linux dependent from pmu_gk20a.c

- Removed Linux dependent header
- Moved thermal alarm post from pmu_gk20a.c
to clk_arb.c
- Implemented nvgpu_clk_arb_send_thermal_alaram()
method to post
NVGPU_GPU_EVENT_ALARM_THERMAL_ABOVE_THRESHOLD

JIRA NVGPU-403

Change-Id: Ibf85c2f3a6e704fdcc0502745fab820f7ea428f4
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1608313
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mahantesh Kumbar
2017-11-30 20:20:38 +05:30
committed by mobile promotions
parent d73ad6c07d
commit 5e9f4bbf8d
3 changed files with 9 additions and 4 deletions

View File

@@ -423,6 +423,12 @@ mutex_fail:
return err;
}
void nvgpu_clk_arb_send_thermal_alarm(struct gk20a *g)
{
nvgpu_clk_arb_schedule_alarm(g,
(0x1UL << NVGPU_GPU_EVENT_ALARM_THERMAL_ABOVE_THRESHOLD));
}
void nvgpu_clk_arb_schedule_alarm(struct gk20a *g, u32 alarm)
{
struct nvgpu_clk_arb *arb = g->clk_arb;

View File

@@ -22,8 +22,6 @@
* DEALINGS IN THE SOFTWARE.
*/
#include <uapi/linux/nvgpu.h>
#include <nvgpu/nvgpu_common.h>
#include <nvgpu/timers.h>
#include <nvgpu/kmem.h>
@@ -590,8 +588,7 @@ int nvgpu_pmu_handle_therm_event(struct nvgpu_pmu *pmu,
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_schedule_alarm(gk20a_from_pmu(pmu),
(0x1UL << NVGPU_GPU_EVENT_ALARM_THERMAL_ABOVE_THRESHOLD));
nvgpu_clk_arb_send_thermal_alarm(pmu->g);
else
gk20a_dbg_pmu("Unwanted/Unregistered thermal event received %d",
msg->hw_slct_msg.mask);

View File

@@ -77,6 +77,8 @@ int nvgpu_clk_arb_get_current_pstate(struct gk20a *g);
void nvgpu_clk_arb_pstate_change_lock(struct gk20a *g, bool lock);
void nvgpu_clk_arb_send_thermal_alarm(struct gk20a *g);
void nvgpu_clk_arb_schedule_alarm(struct gk20a *g, u32 alarm);
#endif /* __NVGPU_CLK_ARB_H__ */