nvgpu: gpu: Changes in therm_channel table parsing

-As auto profile support only GPU class therm devices,
we need to have a check in therm channel tables to parse
only GPU class device table.

NVGPU-4008

Change-Id: I2bade2899e43659f754879ed635cf1ead17b3386
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2191526
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mahantesh Kumbar <mkumbar@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:
rmylavarapu
2019-09-06 12:16:19 +05:30
committed by Alex Waterman
parent 5756924a8b
commit f14d9a36b7
3 changed files with 14 additions and 1 deletions

View File

@@ -29,6 +29,7 @@
#include <nvgpu/string.h>
#include "thrmchannel.h"
#include "thrmdev.h"
#include "thrm.h"
static int _therm_channel_pmudatainit_device(struct gk20a *g,
@@ -182,6 +183,11 @@ static int devinit_get_therm_channel_table(struct gk20a *g,
}
therm_channel_data.device.therm_dev_idx = therm_channel_table_entry->param0;
/* Check for valid therm device index */
if (!nvgpu_therm_dev_idx_is_valid(g->pmu->therm_pmu,
therm_channel_data.device.therm_dev_idx)) {
continue;
}
therm_channel_data.device.therm_dev_prov_idx = therm_channel_table_entry->param1;
therm_channel_size = sizeof(struct therm_channel_device);

View File

@@ -32,6 +32,12 @@
#include "thrmdev.h"
#include "thrm.h"
bool nvgpu_therm_dev_idx_is_valid(struct therm_pmupstate *therm_pmu, u8 idx)
{
return boardobjgrp_idxisvalid(
&(therm_pmu->therm_deviceobjs.super.super), idx);
}
static int _therm_device_pmudata_instget(struct gk20a *g,
struct nv_pmu_boardobjgrp *pmuboardobjgrp,
struct nv_pmu_boardobj **ppboardobjpmudata,

View File

@@ -1,7 +1,7 @@
/*
* general thermal device structures & definitions
*
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -58,5 +58,6 @@ struct therm_device_hbm2_combined {
};
int therm_device_sw_setup(struct gk20a *g);
bool nvgpu_therm_dev_idx_is_valid(struct therm_pmupstate *therm_pmu, u8 idx);
#endif /* NVGPU_THERM_THRMDEV_H */