Skip to content

Commit de8341e

Browse files
mukjoshialexdeucher
authored andcommitted
drm/amdgpu: Fix interrupt handling on ih_soft ring
There are no backing hardware registers for ih_soft ring. As a result, don't try to access hardware registers for read and write pointers when processing interrupts on the IH soft ring. Signed-off-by: Mukul Joshi <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e42dfa6 commit de8341e

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

drivers/gpu/drm/amd/amdgpu/navi10_ih.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,11 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev,
409409
u32 wptr, tmp;
410410
struct amdgpu_ih_regs *ih_regs;
411411

412-
if (ih == &adev->irq.ih) {
412+
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
413413
/* Only ring0 supports writeback. On other rings fall back
414414
* to register-based code with overflow checking below.
415+
* ih_soft ring doesn't have any backing hardware registers,
416+
* update wptr and return.
415417
*/
416418
wptr = le32_to_cpu(*ih->wptr_cpu);
417419

@@ -483,6 +485,9 @@ static void navi10_ih_set_rptr(struct amdgpu_device *adev,
483485
{
484486
struct amdgpu_ih_regs *ih_regs;
485487

488+
if (ih == &adev->irq.ih_soft)
489+
return;
490+
486491
if (ih->use_doorbell) {
487492
/* XXX check if swapping is necessary on BE */
488493
*ih->rptr_cpu = ih->rptr;

drivers/gpu/drm/amd/amdgpu/vega10_ih.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,11 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev,
334334
u32 wptr, tmp;
335335
struct amdgpu_ih_regs *ih_regs;
336336

337-
if (ih == &adev->irq.ih) {
337+
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
338338
/* Only ring0 supports writeback. On other rings fall back
339339
* to register-based code with overflow checking below.
340+
* ih_soft ring doesn't have any backing hardware registers,
341+
* update wptr and return.
340342
*/
341343
wptr = le32_to_cpu(*ih->wptr_cpu);
342344

@@ -409,6 +411,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev,
409411
{
410412
struct amdgpu_ih_regs *ih_regs;
411413

414+
if (ih == &adev->irq.ih_soft)
415+
return;
416+
412417
if (ih->use_doorbell) {
413418
/* XXX check if swapping is necessary on BE */
414419
*ih->rptr_cpu = ih->rptr;

drivers/gpu/drm/amd/amdgpu/vega20_ih.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,11 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev,
385385
u32 wptr, tmp;
386386
struct amdgpu_ih_regs *ih_regs;
387387

388-
if (ih == &adev->irq.ih) {
388+
if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) {
389389
/* Only ring0 supports writeback. On other rings fall back
390390
* to register-based code with overflow checking below.
391+
* ih_soft ring doesn't have any backing hardware registers,
392+
* update wptr and return.
391393
*/
392394
wptr = le32_to_cpu(*ih->wptr_cpu);
393395

@@ -461,6 +463,9 @@ static void vega20_ih_set_rptr(struct amdgpu_device *adev,
461463
{
462464
struct amdgpu_ih_regs *ih_regs;
463465

466+
if (ih == &adev->irq.ih_soft)
467+
return;
468+
464469
if (ih->use_doorbell) {
465470
/* XXX check if swapping is necessary on BE */
466471
*ih->rptr_cpu = ih->rptr;

0 commit comments

Comments
 (0)