]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
drm/amdkfd: unmap VMID<-->PASID when relesing VMID (non-HWS)
authorBen Goz <ben.goz@amd.com>
Mon, 5 Jan 2015 13:48:28 +0000 (15:48 +0200)
committerOded Gabbay <oded.gabbay@amd.com>
Mon, 5 Jan 2015 13:48:28 +0000 (15:48 +0200)
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>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c

index 3b08ed649ce55df2fd37f19f2f627bab0758cfb7..9c8961d22360722a5382de9dde19b35d9b3d27ad 100644 (file)
@@ -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;