All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/6] drm/radeon: Do an MMIO read on interrupts when not uisng MSIs
@ 2011-07-13  6:28 Benjamin Herrenschmidt
  2011-07-13 14:44 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2011-07-13  6:28 UTC (permalink / raw)
  To: Alex Deucher
  Cc: xorg-driver-ati-go0+a7rfsptAfugRpC6u6w,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Cedric Cano

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.

Signed-off-by: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
---

 (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(-)

diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 7e5c801..25b2dab 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/6] drm/radeon: Do an MMIO read on interrupts when not uisng MSIs
  2011-07-13  6:28 [PATCH 5/6] drm/radeon: Do an MMIO read on interrupts when not uisng MSIs Benjamin Herrenschmidt
@ 2011-07-13 14:44 ` Alex Deucher
       [not found]   ` <CADnq5_NRoaEio=Y=Ja2PN3gQC10-CjkKmKRgA74s1uH8APi=ZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2011-07-13 14:44 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: xorg-driver-ati-go0+a7rfsptAfugRpC6u6w,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Cedric Cano

On Wed, Jul 13, 2011 at 2:28 AM, Benjamin Herrenschmidt
<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> wrote:
> 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.
>
> Signed-off-by: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>

Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

> ---
>
>  (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(-)
>
> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
> index 7e5c801..25b2dab 100644
> --- a/drivers/gpu/drm/radeon/r600.c
> +++ b/drivers/gpu/drm/radeon/r600.c
> @@ -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);
>
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/6] drm/radeon: Do an MMIO read on interrupts when not uisng MSIs
       [not found]   ` <CADnq5_NRoaEio=Y=Ja2PN3gQC10-CjkKmKRgA74s1uH8APi=ZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-13 14:48     ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2011-07-13 14:48 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: xorg-driver-ati-go0+a7rfsptAfugRpC6u6w,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Cedric Cano

On Wed, Jul 13, 2011 at 10:44 AM, Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Wed, Jul 13, 2011 at 2:28 AM, Benjamin Herrenschmidt
> <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org> wrote:
>> 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.
>>
>> Signed-off-by: Benjamin Herrenschmidt <benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
>
> Reviewed-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>

evergreen.c will need a similar fix.

Alex

>
>> ---
>>
>>  (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(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
>> index 7e5c801..25b2dab 100644
>> --- a/drivers/gpu/drm/radeon/r600.c
>> +++ b/drivers/gpu/drm/radeon/r600.c
>> @@ -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);
>>
>>
>>
>>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-13 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13  6:28 [PATCH 5/6] drm/radeon: Do an MMIO read on interrupts when not uisng MSIs Benjamin Herrenschmidt
2011-07-13 14:44 ` Alex Deucher
     [not found]   ` <CADnq5_NRoaEio=Y=Ja2PN3gQC10-CjkKmKRgA74s1uH8APi=ZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-13 14:48     ` 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.