gpu: nvgpu: t18x+: return error for set_pc_sampling API

Return error for set_pc_sampling API, if this HAL is
not supported(for pascal+) by gpu version. nvrm driver
updated to handle this error gracefully/skip this
API call to nvgpu driver for pascal+ gpu versions.

Bug 200671026
Bug 2916124

Change-Id: I7e323367ff03868814541c7c2b423e1476331ebb
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2453899
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2020-12-02 08:35:35 -08:00
committed by Alex Waterman
parent 2435b93cb8
commit 722ee1cbc5

View File

@@ -396,13 +396,12 @@ int gr_gm20b_update_pc_sampling(struct nvgpu_channel *c,
/* Pascal+ chips do not support updating PC sampling using register /* Pascal+ chips do not support updating PC sampling using register
* NV_CTXSW_MAIN_IMAGE_PM. We are setting the set_pc_sampling HAL * NV_CTXSW_MAIN_IMAGE_PM. We are setting the set_pc_sampling HAL
* to NULL. We need to make sure devtools also does not call into * to NULL. If this API is called for Pascal+, then return error.
* these APIs. Until the devtools team updates their code, we would
* return success(0) from update_pc_sampling API even if the HAL is
* set to NULL. Filed http://nvbugs/200671026 for devtools team.
*/ */
if (c->g->ops.gr.ctxsw_prog.set_pc_sampling) { if (c->g->ops.gr.ctxsw_prog.set_pc_sampling) {
c->g->ops.gr.ctxsw_prog.set_pc_sampling(c->g, mem, enable); c->g->ops.gr.ctxsw_prog.set_pc_sampling(c->g, mem, enable);
} else {
return -EINVAL;
} }
nvgpu_log_fn(c->g, "done"); nvgpu_log_fn(c->g, "done");