Skip to content

Commit

Permalink
drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
Browse files Browse the repository at this point in the history
This patch fixes a bug where deallocate_vmid() didn't actually unmap the
VMID<-->PASID mapping (in the registers).
That can cause undefined behavior.

This bug only occurs in non-HWS mode.

Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Ben Goz authored and Oded Gabbay committed Jan 5, 2015
1 parent fec77bb commit 2030664
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
Original file line number Diff line number Diff line change
@@ -161,6 +161,9 @@ static void deallocate_vmid(struct device_queue_manager *dqm,
{
int bit = qpd->vmid - KFD_VMID_START_OFFSET;

/* Release the vmid mapping */
set_pasid_vmid_mapping(dqm, 0, qpd->vmid);

set_bit(bit, (unsigned long *)&dqm->vmid_bitmap);
qpd->vmid = 0;
q->properties.vmid = 0;

0 comments on commit 2030664

Please sign in to comment.