[PATCH] drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update

Jure Repinc jlp at holodeck1.com
Thu Dec 19 00:25:15 UTC 2024


> From: Michel Dänzer <mdaenzer at redhat.com>
> 
> Third time's the charm, I hope?
> 
> Fixes: d3116756a710 ("drm/ttm: rename bo->mem and make it a pointer")
> Issue: https://gitlab.freedesktop.org/drm/amd/-/issues/3837
> Signed-off-by: Michel Dänzer <mdaenzer at redhat.com>
> ---
> 
> Or should amdgpu_vm_bo_evicted be called in the !bo->tbo.resource case
> as well?
> 
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ddd7f05e4db9..c9c48b782ec1
> 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -1266,10 +1266,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
> struct amdgpu_bo_va *bo_va, * next command submission.
>  	 */
>  	if (amdgpu_vm_is_bo_always_valid(vm, bo)) {
> -		uint32_t mem_type = bo->tbo.resource->mem_type;
> -
> -		if (!(bo->preferred_domains &
> -		      amdgpu_mem_type_to_domain(mem_type)))
> +		if (bo->tbo.resource &&
> +		    !(bo->preferred_domains &
> +		      amdgpu_mem_type_to_domain(bo->tbo.resource-
>mem_type)))
>  			amdgpu_vm_bo_evicted(&bo_va->base);
>  		else
>  			amdgpu_vm_bo_idle(&bo_va->base);

Hi

I reported the issue and just replying to confirm the fix works for me. I 
applied the patch to the openSUSE kernel sources of the same kernel version 
that I got the original bug with and tested again with this patch and now all 
applications works fine.

Thanks!

-- 
         Jabber/XMPP: JLP at jabber.org
              Matrix: @jlp:matrix.org
Mastodon/ActivityPub: @JRepin at mstdn.io
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4066 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20241219/3148f639/attachment-0001.bin>


More information about the amd-gfx mailing list