Re: [PATCH] drm/amdgpu: Handle job is NULL use case in amdgpu_device_gpu_recover

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Den tis 27 aug. 2019 kl 20:17 skrev Andrey Grodzovsky
<andrey.grodzovsky@xxxxxxx>:
>
> This should be checked at all places job is accessed.
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@xxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 02b3e7d..190d9a3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3790,14 +3790,14 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>
>         if (hive && !mutex_trylock(&hive->reset_lock)) {
>                 DRM_INFO("Bailing on TDR for s_job:%llx, hive: %llx as another already in progress",
> -                        job->base.id, hive->hive_id);
> +                         job ? job->base.id : -1, hive->hive_id);
>                 return 0;
>         }
>
>         /* Start with adev pre asic reset first for soft reset check.*/
>         if (!amdgpu_device_lock_adev(adev, !hive)) {
>                 DRM_INFO("Bailing on TDR for s_job:%llx, as another already in progress",
> -                                        job->base.id);
> +                         job ? job->base.id : -1);
>                 return 0;
>         }
>
> @@ -3838,7 +3838,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>                         if (!ring || !ring->sched.thread)
>                                 continue;
>
> -                       drm_sched_stop(&ring->sched, &job->base);
> +                       drm_sched_stop(&ring->sched, job ? &job->base : NULL);
>                 }
>         }
>
> @@ -3864,7 +3864,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
>
>         /* Guilty job will be freed after this*/
>         r = amdgpu_device_pre_asic_reset(adev,
> -                                        job,
> +                                        job ? job : NULL,

This check looks redundant.

>                                          &need_full_reset);
>         if (r) {
>                 /*TODO Should we stop ?*/
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Regards
//Ernst
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux