Commit 62d91dd2 authored by Sam Bobroff's avatar Sam Bobroff Committed by Alex Deucher

drm/radeon: fix bad DMA from INTERRUPT_CNTL2

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: d8f60cfc ("drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)")
Fixes: 25a857fb ("drm/radeon/kms: add support for interrupts on SI")
Fixes: a59781bb ("drm/radeon: add support for interrupts on CIK (v5)")
Signed-off-by: default avatarSam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e3dd3aa8
...@@ -6965,8 +6965,8 @@ static int cik_irq_init(struct radeon_device *rdev) ...@@ -6965,8 +6965,8 @@ static int cik_irq_init(struct radeon_device *rdev)
} }
/* setup interrupt control */ /* setup interrupt control */
/* XXX this should actually be a bus address, not an MC address. same on older asics */ /* set dummy read address to dummy page address */
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL); interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
......
...@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev) ...@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev)
} }
/* setup interrupt control */ /* setup interrupt control */
/* set dummy read address to ring address */ /* set dummy read address to dummy page address */
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL); interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
......
...@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev) ...@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev)
} }
/* setup interrupt control */ /* setup interrupt control */
/* set dummy read address to ring address */ /* set dummy read address to dummy page address */
WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL); interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi
* IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment