aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMonk Liu <Monk.Liu@amd.com>2017-03-22 06:01:59 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:55:41 -0400
commit79a0c4655e47ca31c24e1d8cfd4c9a461571a100 (patch)
treed05da5f593e149866b2302b964e0e907f215ab65 /drivers
parent6e9dc861219b8f8966f5a91984dbfaa6de57fb8b (diff)
drm/amdgpu:fix gmc_v9 vm fault process for SRIOV
for SRIOV we cannot use access register when in IRQ routine with regular KIQ method Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index c29a477ea449..f1f4eac11400 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -137,20 +137,28 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
137 addr = (u64)entry->src_data[0] << 12; 137 addr = (u64)entry->src_data[0] << 12;
138 addr |= ((u64)entry->src_data[1] & 0xf) << 44; 138 addr |= ((u64)entry->src_data[1] & 0xf) << 44;
139 139
140 if (entry->vm_id_src) { 140 if (!amdgpu_sriov_vf(adev)) {
141 status = RREG32(mmhub->vm_l2_pro_fault_status); 141 if (entry->vm_id_src) {
142 WREG32_P(mmhub->vm_l2_pro_fault_cntl, 1, ~1); 142 status = RREG32(mmhub->vm_l2_pro_fault_status);
143 } else { 143 WREG32_P(mmhub->vm_l2_pro_fault_cntl, 1, ~1);
144 status = RREG32(gfxhub->vm_l2_pro_fault_status); 144 } else {
145 WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1); 145 status = RREG32(gfxhub->vm_l2_pro_fault_status);
146 } 146 WREG32_P(gfxhub->vm_l2_pro_fault_cntl, 1, ~1);
147 }
147 148
148 DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) " 149 DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
149 "at page 0x%016llx from %d\n" 150 "at page 0x%016llx from %d\n"
150 "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n", 151 "VM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
151 entry->vm_id_src ? "mmhub" : "gfxhub", 152 entry->vm_id_src ? "mmhub" : "gfxhub",
152 entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id, 153 entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
153 addr, entry->client_id, status); 154 addr, entry->client_id, status);
155 } else {
156 DRM_ERROR("[%s]VMC page fault (src_id:%u ring:%u vm_id:%u pas_id:%u) "
157 "at page 0x%016llx from %d\n",
158 entry->vm_id_src ? "mmhub" : "gfxhub",
159 entry->src_id, entry->ring_id, entry->vm_id, entry->pas_id,
160 addr, entry->client_id);
161 }
154 162
155 return 0; 163 return 0;
156} 164}