From 722ee1cbc55610e07aa32b0b23e6525e62098d87 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Wed, 2 Dec 2020 08:35:35 -0800 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2453899 Reviewed-by: automaticguardword Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-cert Reviewed-by: Alex Waterman Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/hal/gr/gr/gr_gm20b.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/hal/gr/gr/gr_gm20b.c b/drivers/gpu/nvgpu/hal/gr/gr/gr_gm20b.c index dfdf952bd..eee6cacc1 100644 --- a/drivers/gpu/nvgpu/hal/gr/gr/gr_gm20b.c +++ b/drivers/gpu/nvgpu/hal/gr/gr/gr_gm20b.c @@ -396,13 +396,12 @@ int gr_gm20b_update_pc_sampling(struct nvgpu_channel *c, /* Pascal+ chips do not support updating PC sampling using register * 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 - * 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. + * to NULL. If this API is called for Pascal+, then return error. */ if (c->g->ops.gr.ctxsw_prog.set_pc_sampling) { c->g->ops.gr.ctxsw_prog.set_pc_sampling(c->g, mem, enable); + } else { + return -EINVAL; } nvgpu_log_fn(c->g, "done");