drm/radeon: Assign VMID to PASID for IH in non-HWS mode
authorBen Goz <ben.goz@amd.com>
Wed, 17 Dec 2014 12:09:10 +0000 (14:09 +0200)
committerOded Gabbay <oded.gabbay@amd.com>
Wed, 17 Dec 2014 12:09:10 +0000 (14:09 +0200)
This patch fixes a bug in kgd_set_pasid_vmid_mapping(), where the function
only updated the ATC registers (IOMMU) with the new VMID <--> PASID mapping,
but didn't update the IH (Interrupt) registers.

The bug only occurs when using non-HWS mode. In HWS mode, the CP automatically
does the VMID <--> PASID mapping.

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/radeon/cikd.h
drivers/gpu/drm/radeon/radeon_kfd.c

index ba85986febea5054762615ee7fc5edbaa275f2cd..03003f8a6de63ba00c741824c053070a009cd319 100644 (file)
 #define ATC_VM_APERTURE1_HIGH_ADDR                             0x330Cu
 #define ATC_VM_APERTURE1_LOW_ADDR                              0x3304u
 
+#define IH_VMID_0_LUT                                          0x3D40u
+
 #endif
index a55afbadc65fb1f12f5dc75a99fb910d0590ae4d..8bf87f1203ccaddd85a215dc0c5e19fb48305dbf 100644 (file)
@@ -390,6 +390,10 @@ static int kgd_set_pasid_vmid_mapping(struct kgd_dev *kgd, unsigned int pasid,
                cpu_relax();
        write_register(kgd, ATC_VMID_PASID_MAPPING_UPDATE_STATUS, 1U << vmid);
 
+       /* Mapping vmid to pasid also for IH block */
+       write_register(kgd, IH_VMID_0_LUT + vmid * sizeof(uint32_t),
+                       pasid_mapping);
+
        return 0;
 }