Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/cik_ih: Enable soft IRQ handler ring

We are going to use the soft IRQ handler ring on GMC v7 (CIK)
to process interrupts from VM faults.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Timur Kristóf and committed by
Alex Deucher
45bef899 2a38b0ec

+12
+12
drivers/gpu/drm/amd/amdgpu/cik_ih.c
··· 156 156 /* enable irqs */ 157 157 cik_ih_enable_interrupts(adev); 158 158 159 + if (adev->irq.ih_soft.ring_size) 160 + adev->irq.ih_soft.enabled = true; 161 + 159 162 return 0; 160 163 } 161 164 ··· 195 192 196 193 wptr = le32_to_cpu(*ih->wptr_cpu); 197 194 195 + if (ih == &adev->irq.ih_soft) 196 + goto out; 197 + 198 198 if (wptr & IH_RB_WPTR__RB_OVERFLOW_MASK) { 199 199 wptr &= ~IH_RB_WPTR__RB_OVERFLOW_MASK; 200 200 /* When a ring buffer overflow happen start parsing interrupt ··· 217 211 tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK; 218 212 WREG32(mmIH_RB_CNTL, tmp); 219 213 } 214 + 215 + out: 220 216 return (wptr & ih->ptr_mask); 221 217 } 222 218 ··· 311 303 struct amdgpu_device *adev = ip_block->adev; 312 304 313 305 r = amdgpu_ih_ring_init(adev, &adev->irq.ih, 64 * 1024, false); 306 + if (r) 307 + return r; 308 + 309 + r = amdgpu_ih_ring_init(adev, &adev->irq.ih_soft, IH_SW_RING_SIZE, true); 314 310 if (r) 315 311 return r; 316 312