Skip to content

Commit 62ac16b

Browse files
Sam Bobroffgregkh
authored andcommitted
drm/radeon: fix bad DMA from INTERRUPT_CNTL2
[ Upstream commit 62d91dd ] The INTERRUPT_CNTL2 register expects a valid DMA address, but is currently set with a GPU MC address. This can cause problems on systems that detect the resulting DMA read from an invalid address (found on a Power8 guest). Instead, use the DMA address of the dummy page because it will always be safe. Fixes: d8f60cf ("drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)") Fixes: 25a857f ("drm/radeon/kms: add support for interrupts on SI") Fixes: a59781b ("drm/radeon: add support for interrupts on CIK (v5)") Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ca4c17f commit 62ac16b

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/gpu/drm/radeon/cik.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6969,8 +6969,8 @@ static int cik_irq_init(struct radeon_device *rdev)
69696969
}
69706970

69716971
/* setup interrupt control */
6972-
/* XXX this should actually be a bus address, not an MC address. same on older asics */
6973-
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
6972+
/* set dummy read address to dummy page address */
6973+
WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
69746974
interrupt_cntl = RREG32(INTERRUPT_CNTL);
69756975
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
69766976
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN

drivers/gpu/drm/radeon/r600.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev)
36963696
}
36973697

36983698
/* setup interrupt control */
3699-
/* set dummy read address to ring address */
3700-
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
3699+
/* set dummy read address to dummy page address */
3700+
WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
37013701
interrupt_cntl = RREG32(INTERRUPT_CNTL);
37023702
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
37033703
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN

drivers/gpu/drm/radeon/si.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev)
59975997
}
59985998

59995999
/* setup interrupt control */
6000-
/* set dummy read address to ring address */
6001-
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
6000+
/* set dummy read address to dummy page address */
6001+
WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
60026002
interrupt_cntl = RREG32(INTERRUPT_CNTL);
60036003
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
60046004
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN

0 commit comments

Comments
 (0)