gpu: nvgpu: vgpu: fix NVGPU_GPU_IOCTL_CLEAR_SM_ERRORS crash

vgpu currently does not support suspend gpu context and stall
the whole gpu, because of safety concerns. So vgpu does not set
HALs that are related to on-gpu context.

This change unset gops.gr.clear_sm_errors. And the ioctl
NVGPU_GPU_IOCTL_CLEAR_SM_ERRORS will return -ENOSYS.

Bug 200469468

Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Change-Id: Ie578495e175ad898994fe1c4184a0243d5541cd3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2395598
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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
This commit is contained in:
Richard Zhao
2020-08-06 22:09:33 -07:00
committed by Alex Waterman
parent 4f85b2b1d4
commit 3f81f1952d
3 changed files with 6 additions and 2 deletions

View File

@@ -201,7 +201,7 @@ static const struct gpu_ops vgpu_gp10b_ops = {
.trigger_suspend = NULL,
.wait_for_pause = gr_gk20a_wait_for_pause,
.resume_from_pause = NULL,
.clear_sm_errors = gr_gk20a_clear_sm_errors,
.clear_sm_errors = NULL,
.sm_debugger_attached = NULL,
.suspend_single_sm = NULL,
.suspend_all_sms = NULL,

View File

@@ -260,7 +260,7 @@ static const struct gpu_ops vgpu_gv11b_ops = {
.trigger_suspend = NULL,
.wait_for_pause = gr_gk20a_wait_for_pause,
.resume_from_pause = NULL,
.clear_sm_errors = gr_gk20a_clear_sm_errors,
.clear_sm_errors = NULL,
.sm_debugger_attached = NULL,
.suspend_single_sm = NULL,
.suspend_all_sms = NULL,

View File

@@ -875,6 +875,10 @@ static int nvgpu_gpu_ioctl_clear_sm_errors(struct gk20a *g)
{
int err;
if (g->ops.gr.clear_sm_errors == NULL) {
return -ENOSYS;
}
err = gk20a_busy(g);
if (err)
return err;