Skip to contentSkip to conversation

drm/amdgpu: fix cleaning up reserved VMID on release

PATCH In review Christian König 3 participants 3 messages Jan 13, 2023 – Jan 16, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: fix cleaning up reserved VMID on release

We need to reset this or otherwise run into list corruption later on./

Fixes 16be3e9f6f03 ("drm/amdgpu: rework reserved VMID handling")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +1 -0
index 6481b43ffe25..a0545d51b6bd 100644
@@ -499,6 +499,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
 	    !--id_mgr->reserved_use_count) {
 		/* give the reserved ID back to normal round robin */
 		list_add(&id_mgr->reserved->list, &id_mgr->ids_lru);
+		id_mgr->reserved = NULL;
 	}
 	vm->reserved_vmid[vmhub] = false;
 	mutex_unlock(&id_mgr->lock);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Christian König

We need to reset this or otherwise run into list corruption later on./

Drop the / above.

Quoted 22 lines
Fixes 16be3e9f6f03 ("drm/amdgpu: rework reserved VMID handling")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +1 -1
index 6481b43ffe25..a0545d51b6bd 100644
@@ -499,6 +499,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
            !--id_mgr->reserved_use_count) {
                /* give the reserved ID back to normal round robin */
                list_add(&id_mgr->reserved->list, &id_mgr->ids_lru);
+               id_mgr->reserved = NULL;
        }
        vm->reserved_vmid[vmhub] = false;
        mutex_unlock(&id_mgr->lock);
--

2.34.1

Tested-by Reviewed-by Alex Deucher
#2 lore raw

[AMD Official Use Only - General]

Thanks,
Candice

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Saturday, January 14, 2023 12:48 AM
To: Christian König <[email protected]>
Cc: [email protected]; Li, Candice <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: fix cleaning up reserved VMID on release

Quoted 2 lines · Christian König

We need to reset this or otherwise run into list corruption later on./

Drop the / above.

Quoted 22 lines
Fixes 16be3e9f6f03 ("drm/amdgpu: rework reserved VMID handling")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +1 -1
index 6481b43ffe25..a0545d51b6bd 100644
@@ -499,6 +499,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
            !--id_mgr->reserved_use_count) {
                /* give the reserved ID back to normal round robin */
                list_add(&id_mgr->reserved->list, &id_mgr->ids_lru);
+               id_mgr->reserved = NULL;
        }
        vm->reserved_vmid[vmhub] = false;
        mutex_unlock(&id_mgr->lock);
--

2.34.1