* [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2
@ 2019-11-17 23:53 Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 1/2] drm/radeon: " Sam Bobroff
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sam Bobroff @ 2019-11-17 23:53 UTC (permalink / raw)
To: dri-devel
A couple of notes:
- Initial discussion:
https://lists.freedesktop.org/archives/dri-devel/2019-November/244090.html
- I have only tested the case that uses r600_irq_init(), but they are all very
similar.
Cheers,
Sam.
Patch set changelog follows:
Patch set v2:
Patch 1/2: drm/radeon: fix bad DMA from INTERRUPT_CNTL2
- Split amdgpu changes into separate patch.
Patch 2/2 (new in this version): drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
Patch set v1:
Patch 1/1: drm/radeon drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
Sam Bobroff (2):
drm/radeon: fix bad DMA from INTERRUPT_CNTL2
drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++-
drivers/gpu/drm/radeon/cik.c | 4 ++--
drivers/gpu/drm/radeon/r600.c | 4 ++--
drivers/gpu/drm/radeon/si.c | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
--
2.22.0.216.g00a2a96fc9
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] drm/radeon: fix bad DMA from INTERRUPT_CNTL2
2019-11-17 23:53 [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2 Sam Bobroff
@ 2019-11-17 23:53 ` Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 2/2] drm/amdgpu: " Sam Bobroff
2019-11-18 17:20 ` [PATCH v2 0/2] " Alex Deucher
2 siblings, 0 replies; 4+ messages in thread
From: Sam Bobroff @ 2019-11-17 23:53 UTC (permalink / raw)
To: dri-devel
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>
---
v2 - Split amdgpu changes into separate patch.
drivers/gpu/drm/radeon/cik.c | 4 ++--
drivers/gpu/drm/radeon/r600.c | 4 ++--
drivers/gpu/drm/radeon/si.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 62eab82a64f9..897442754fd0 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -6969,8 +6969,8 @@ static int cik_irq_init(struct radeon_device *rdev)
}
/* setup interrupt control */
- /* XXX this should actually be a bus address, not an MC address. same on older asics */
- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
+ /* set dummy read address to dummy page address */
+ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* 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
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index e937cc01910d..033bc466a862 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev)
}
/* setup interrupt control */
- /* set dummy read address to ring address */
- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
+ /* set dummy read address to dummy page address */
+ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* 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
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 05894d198a79..1d8efb0eefdb 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev)
}
/* setup interrupt control */
- /* set dummy read address to ring address */
- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8);
+ /* set dummy read address to dummy page address */
+ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL);
/* 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
--
2.22.0.216.g00a2a96fc9
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
2019-11-17 23:53 [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2 Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 1/2] drm/radeon: " Sam Bobroff
@ 2019-11-17 23:53 ` Sam Bobroff
2019-11-18 17:20 ` [PATCH v2 0/2] " Alex Deucher
2 siblings, 0 replies; 4+ messages in thread
From: Sam Bobroff @ 2019-11-17 23:53 UTC (permalink / raw)
To: dri-devel
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: 27ae10641e9c ("drm/amdgpu: add interupt handler implementation for si v3")
Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
---
v2 * New in this version.
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c b/drivers/gpu/drm/amd/amdgpu/si_ih.c
index 57bb5f9e08b2..88ae27a5a03d 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c
@@ -64,7 +64,8 @@ static int si_ih_irq_init(struct amdgpu_device *adev)
u32 interrupt_cntl, ih_cntl, ih_rb_cntl;
si_ih_disable_interrupts(adev);
- WREG32(INTERRUPT_CNTL2, adev->irq.ih.gpu_addr >> 8);
+ /* set dummy read address to dummy page address */
+ WREG32(INTERRUPT_CNTL2, adev->dummy_page_addr >> 8);
interrupt_cntl = RREG32(INTERRUPT_CNTL);
interrupt_cntl &= ~IH_DUMMY_RD_OVERRIDE;
interrupt_cntl &= ~IH_REQ_NONSNOOP_EN;
--
2.22.0.216.g00a2a96fc9
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2
2019-11-17 23:53 [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2 Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 1/2] drm/radeon: " Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 2/2] drm/amdgpu: " Sam Bobroff
@ 2019-11-18 17:20 ` Alex Deucher
2 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2019-11-18 17:20 UTC (permalink / raw)
To: Sam Bobroff; +Cc: Maling list - DRI developers
On Sun, Nov 17, 2019 at 6:54 PM Sam Bobroff <sbobroff@linux.ibm.com> wrote:
>
> A couple of notes:
> - Initial discussion:
> https://lists.freedesktop.org/archives/dri-devel/2019-November/244090.html
> - I have only tested the case that uses r600_irq_init(), but they are all very
> similar.
>
> Cheers,
> Sam.
>
> Patch set changelog follows:
Applied the series. Thanks!
Alex
>
> Patch set v2:
> Patch 1/2: drm/radeon: fix bad DMA from INTERRUPT_CNTL2
> - Split amdgpu changes into separate patch.
> Patch 2/2 (new in this version): drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
>
> Patch set v1:
> Patch 1/1: drm/radeon drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
>
> Sam Bobroff (2):
> drm/radeon: fix bad DMA from INTERRUPT_CNTL2
> drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
>
> drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++-
> drivers/gpu/drm/radeon/cik.c | 4 ++--
> drivers/gpu/drm/radeon/r600.c | 4 ++--
> drivers/gpu/drm/radeon/si.c | 4 ++--
> 4 files changed, 8 insertions(+), 7 deletions(-)
>
> --
> 2.22.0.216.g00a2a96fc9
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-18 17:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-17 23:53 [PATCH v2 0/2] fix bad DMA from INTERRUPT_CNTL2 Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 1/2] drm/radeon: " Sam Bobroff
2019-11-17 23:53 ` [PATCH v2 2/2] drm/amdgpu: " Sam Bobroff
2019-11-18 17:20 ` [PATCH v2 0/2] " Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.