summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBen Goz <ben.goz@amd.com>2015-01-05 15:48:28 +0200
committerOded Gabbay <oded.gabbay@amd.com>2015-01-05 15:48:28 +0200
commit2030664b709caa769f2b6a1d2e71d8cb343c6884 (patch)
treefacf0a02465dfe022b3dd875589b5ff93beb0012 /drivers
parentfec77bb50fd0b94cb502cd3745e8b5c4a6e9c404 (diff)
drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 3b08ed649ce5..9c8961d22360 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -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;