Skip to contentSkip to conversation

drm/radeon: Do an MMIO read on interrupts when not uisng MSIs

PATCH In review Benjamin Herrenschmidt 2 participants 3 messages Jul 13, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/6 drm/radeon: Do an MMIO read on interrupts when not uisng MSIs

When not using MSIs, there is no guarantee that DMA from the device has been fully flushed to point where it's visible to the CPU when taking an interrupt. To get this guarantee, we need to perform an MMIO read from the device, which will flush all outstanding DMAs from bridges between the device and the system.

---

(resent adding dri-devel to the CC list to hit patchwork)

drivers/gpu/drm/radeon/r600.c | 4 ++++

 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +4 -0
index 7e5c801..25b2dab 100644
@@ -3300,6 +3300,10 @@ int r600_irq_process(struct radeon_device *rdev)
 	if (!rdev->ih.enabled || rdev->shutdown)
 		return IRQ_NONE;
 
+	/* No MSIs, need a dummy read to flush PCI DMAs */
+	if (!rdev->msi_enabled)
+		RREG32(IH_RB_WPTR);
+
 	wptr = r600_get_ih_wptr(rdev);
 	rptr = rdev->ih.rptr;
 	DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr);
Reviewed-by on v1 5/6
#1 lore raw
Quoted 7 lines · Benjamin Herrenschmidt

When not using MSIs, there is no guarantee that DMA from the device has been fully flushed to point where it's visible to the CPU when taking an interrupt. To get this guarantee, we need to perform an MMIO read from the device, which will flush all outstanding DMAs from bridges between the device and the system.

Quoted 26 lines

---

 (resent adding dri-devel to the CC list to hit patchwork)

drivers/gpu/drm/radeon/r600.c |    4 ++++

 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +4 -0
index 7e5c801..25b2dab 100644
@@ -3300,6 +3300,10 @@ int r600_irq_process(struct radeon_device *rdev)
        if (!rdev->ih.enabled || rdev->shutdown)
                return IRQ_NONE;
 
+       /* No MSIs, need a dummy read to flush PCI DMAs */
+       if (!rdev->msi_enabled)
+               RREG32(IH_RB_WPTR);
+
        wptr = r600_get_ih_wptr(rdev);
        rptr = rdev->ih.rptr;
        DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr);
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Alex Deucher
Quoted 7 lines · Benjamin Herrenschmidt

When not using MSIs, there is no guarantee that DMA from the device has been fully flushed to point where it's visible to the CPU when taking an interrupt. To get this guarantee, we need to perform an MMIO read from the device, which will flush all outstanding DMAs from bridges between the device and the system.

evergreen.c will need a similar fix.

Alex

Quoted 28 lines
Quoted 27 lines

---

 (resent adding dri-devel to the CC list to hit patchwork)

drivers/gpu/drm/radeon/r600.c |    4 ++++

 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600.c +4 -0
index 7e5c801..25b2dab 100644
@@ -3300,6 +3300,10 @@ int r600_irq_process(struct radeon_device *rdev)
        if (!rdev->ih.enabled || rdev->shutdown)
                return IRQ_NONE;
 
+       /* No MSIs, need a dummy read to flush PCI DMAs */
+       if (!rdev->msi_enabled)
+               RREG32(IH_RB_WPTR);
+
        wptr = r600_get_ih_wptr(rdev);
        rptr = rdev->ih.rptr;
        DRM_DEBUG("r600_irq_process start: rptr %d, wptr %d\n", rptr, wptr);