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

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: d8f60cfc9345 ("drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)")
Fixes: 25a857fbe973 ("drm/radeon/kms: add support for interrupts on SI")
Fixes: a59781bbe528 ("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>

authored by

Sam Bobroff and committed by
Alex Deucher
62d91dd2 e3dd3aa8

+6 -6
+2 -2
drivers/gpu/drm/radeon/cik.c
··· 6965 6965 } 6966 6966 6967 6967 /* setup interrupt control */ 6968 - /* XXX this should actually be a bus address, not an MC address. same on older asics */ 6969 - WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); 6968 + /* set dummy read address to dummy page address */ 6969 + WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); 6970 6970 interrupt_cntl = RREG32(INTERRUPT_CNTL); 6971 6971 /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi 6972 6972 * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
+2 -2
drivers/gpu/drm/radeon/r600.c
··· 3696 3696 } 3697 3697 3698 3698 /* 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); 3701 3701 interrupt_cntl = RREG32(INTERRUPT_CNTL); 3702 3702 /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi 3703 3703 * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
+2 -2
drivers/gpu/drm/radeon/si.c
··· 5997 5997 } 5998 5998 5999 5999 /* 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); 6002 6002 interrupt_cntl = RREG32(INTERRUPT_CNTL); 6003 6003 /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi 6004 6004 * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN