linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: enable uncached DMA optimization for ARM and arm64
@ 2019-01-24 12:06 Ard Biesheuvel
  2019-01-24 12:31 ` Koenig, Christian
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-01-24 12:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, Ard Biesheuvel, Christian Koenig, Alex Deucher,
	David Zhou, Huang Rui, Junwei Zhang, Michel Daenzer,
	David Airlie, Daniel Vetter, Maarten Lankhorst, Maxime Ripard,
	Sean Paul, Michael Ellerman, Benjamin Herrenschmidt, Will Deacon,
	Christoph Hellwig, Robin Murphy, amd-gfx list, dri-devel,
	Carsten Haitzler

The DRM driver stack is designed to work with cache coherent devices
only, but permits an optimization to be enabled in some cases, where
for some buffers, both the CPU and the GPU use uncached mappings,
removing the need for DMA snooping and allocation in the CPU caches.

The use of uncached GPU mappings relies on the correct implementation
of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
will use cached mappings nonetheless. On x86 platforms, this does not
seem to matter, as uncached CPU mappings will snoop the caches in any
case. However, on ARM and arm64, enabling this optimization on a
platform where NoSnoop is ignored results in loss of coherency, which
breaks correct operation of the device. Since we have no way of
detecting whether NoSnoop works or not, just disable this
optimization entirely for ARM and arm64.

Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: David Zhou <David1.Zhou@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Junwei Zhang <Jerry.Zhang@amd.com>
Cc: Michel Daenzer <michel.daenzer@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 include/drm/drm_cache.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h
index bfe1639df02d..97fc498dc767 100644
--- a/include/drm/drm_cache.h
+++ b/include/drm/drm_cache.h
@@ -47,6 +47,24 @@ static inline bool drm_arch_can_wc_memory(void)
 	return false;
 #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON3)
 	return false;
+#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
+	/*
+	 * The DRM driver stack is designed to work with cache coherent devices
+	 * only, but permits an optimization to be enabled in some cases, where
+	 * for some buffers, both the CPU and the GPU use uncached mappings,
+	 * removing the need for DMA snooping and allocation in the CPU caches.
+	 *
+	 * The use of uncached GPU mappings relies on the correct implementation
+	 * of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
+	 * will use cached mappings nonetheless. On x86 platforms, this does not
+	 * seem to matter, as uncached CPU mappings will snoop the caches in any
+	 * case. However, on ARM and arm64, enabling this optimization on a
+	 * platform where NoSnoop is ignored results in loss of coherency, which
+	 * breaks correct operation of the device. Since we have no way of
+	 * detecting whether NoSnoop works or not, just disable this
+	 * optimization entirely for ARM and arm64.
+	 */
+	return false;
 #else
 	return true;
 #endif
-- 
2.20.1


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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-24 12:06 [PATCH] drm: enable uncached DMA optimization for ARM and arm64 Ard Biesheuvel
@ 2019-01-24 12:31 ` Koenig, Christian
  2019-01-24 12:32   ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Koenig, Christian @ 2019-01-24 12:31 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-kernel
  Cc: linux-arm-kernel, Deucher, Alexander, Zhou, David(ChunMing),
	Huang, Ray, Zhang, Jerry, Daenzer, Michel, David Airlie,
	Daniel Vetter, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Michael Ellerman, Benjamin Herrenschmidt, Will Deacon,
	Christoph Hellwig, Robin Murphy, amd-gfx list, dri-devel,
	Carsten Haitzler

Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> The DRM driver stack is designed to work with cache coherent devices
> only, but permits an optimization to be enabled in some cases, where
> for some buffers, both the CPU and the GPU use uncached mappings,
> removing the need for DMA snooping and allocation in the CPU caches.
>
> The use of uncached GPU mappings relies on the correct implementation
> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> will use cached mappings nonetheless. On x86 platforms, this does not
> seem to matter, as uncached CPU mappings will snoop the caches in any
> case. However, on ARM and arm64, enabling this optimization on a
> platform where NoSnoop is ignored results in loss of coherency, which
> breaks correct operation of the device. Since we have no way of
> detecting whether NoSnoop works or not, just disable this
> optimization entirely for ARM and arm64.
>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: David Zhou <David1.Zhou@amd.com>
> Cc: Huang Rui <ray.huang@amd.com>
> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> Cc: Michel Daenzer <michel.daenzer@amd.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

The subject line should probably read "disable uncached...".

With that fixed the patch is Reviewed-by: Christian König 
<christian.koenig@amd.com>.

Regards,
Christian.

> ---
>   include/drm/drm_cache.h | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
>
> diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h
> index bfe1639df02d..97fc498dc767 100644
> --- a/include/drm/drm_cache.h
> +++ b/include/drm/drm_cache.h
> @@ -47,6 +47,24 @@ static inline bool drm_arch_can_wc_memory(void)
>   	return false;
>   #elif defined(CONFIG_MIPS) && defined(CONFIG_CPU_LOONGSON3)
>   	return false;
> +#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
> +	/*
> +	 * The DRM driver stack is designed to work with cache coherent devices
> +	 * only, but permits an optimization to be enabled in some cases, where
> +	 * for some buffers, both the CPU and the GPU use uncached mappings,
> +	 * removing the need for DMA snooping and allocation in the CPU caches.
> +	 *
> +	 * The use of uncached GPU mappings relies on the correct implementation
> +	 * of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> +	 * will use cached mappings nonetheless. On x86 platforms, this does not
> +	 * seem to matter, as uncached CPU mappings will snoop the caches in any
> +	 * case. However, on ARM and arm64, enabling this optimization on a
> +	 * platform where NoSnoop is ignored results in loss of coherency, which
> +	 * breaks correct operation of the device. Since we have no way of
> +	 * detecting whether NoSnoop works or not, just disable this
> +	 * optimization entirely for ARM and arm64.
> +	 */
> +	return false;
>   #else
>   	return true;
>   #endif


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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-24 12:31 ` Koenig, Christian
@ 2019-01-24 12:32   ` Ard Biesheuvel
  2019-01-24 14:01     ` Alex Deucher
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-01-24 12:32 UTC (permalink / raw)
  To: Koenig, Christian
  Cc: linux-kernel, linux-arm-kernel, Deucher, Alexander, Zhou,
	David(ChunMing),
	Huang, Ray, Zhang, Jerry, Daenzer, Michel, David Airlie,
	Daniel Vetter, Maarten Lankhorst, Maxime Ripard, Sean Paul,
	Michael Ellerman, Benjamin Herrenschmidt, Will Deacon,
	Christoph Hellwig, Robin Murphy, amd-gfx list, dri-devel,
	Carsten Haitzler

On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
<Christian.Koenig@amd.com> wrote:
>
> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > The DRM driver stack is designed to work with cache coherent devices
> > only, but permits an optimization to be enabled in some cases, where
> > for some buffers, both the CPU and the GPU use uncached mappings,
> > removing the need for DMA snooping and allocation in the CPU caches.
> >
> > The use of uncached GPU mappings relies on the correct implementation
> > of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > will use cached mappings nonetheless. On x86 platforms, this does not
> > seem to matter, as uncached CPU mappings will snoop the caches in any
> > case. However, on ARM and arm64, enabling this optimization on a
> > platform where NoSnoop is ignored results in loss of coherency, which
> > breaks correct operation of the device. Since we have no way of
> > detecting whether NoSnoop works or not, just disable this
> > optimization entirely for ARM and arm64.
> >
> > Cc: Christian Koenig <christian.koenig@amd.com>
> > Cc: Alex Deucher <alexander.deucher@amd.com>
> > Cc: David Zhou <David1.Zhou@amd.com>
> > Cc: Huang Rui <ray.huang@amd.com>
> > Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > Cc: Michel Daenzer <michel.daenzer@amd.com>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Christoph Hellwig <hch@infradead.org>
> > Cc: Robin Murphy <robin.murphy@arm.com>
> > Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> The subject line should probably read "disable uncached...".
>

Ugh, of course ...

> With that fixed the patch is Reviewed-by: Christian König
> <christian.koenig@amd.com>.
>

Thanks.

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-24 12:32   ` Ard Biesheuvel
@ 2019-01-24 14:01     ` Alex Deucher
  2019-01-25  8:43       ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Deucher @ 2019-01-24 14:01 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Koenig, Christian, Zhou, David(ChunMing),
	Maxime Ripard, Benjamin Herrenschmidt, Carsten Haitzler,
	David Airlie, Maarten Lankhorst, dri-devel, Daenzer, Michel,
	linux-kernel, Will Deacon, Christoph Hellwig, Zhang, Jerry,
	Huang, Ray, amd-gfx list, Daniel Vetter, Michael Ellerman,
	Deucher, Alexander, Sean Paul, linux-arm-kernel, Robin Murphy

On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> <Christian.Koenig@amd.com> wrote:
> >
> > Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > > The DRM driver stack is designed to work with cache coherent devices
> > > only, but permits an optimization to be enabled in some cases, where
> > > for some buffers, both the CPU and the GPU use uncached mappings,
> > > removing the need for DMA snooping and allocation in the CPU caches.
> > >
> > > The use of uncached GPU mappings relies on the correct implementation
> > > of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > > will use cached mappings nonetheless. On x86 platforms, this does not
> > > seem to matter, as uncached CPU mappings will snoop the caches in any
> > > case. However, on ARM and arm64, enabling this optimization on a
> > > platform where NoSnoop is ignored results in loss of coherency, which
> > > breaks correct operation of the device. Since we have no way of
> > > detecting whether NoSnoop works or not, just disable this
> > > optimization entirely for ARM and arm64.
> > >
> > > Cc: Christian Koenig <christian.koenig@amd.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: David Zhou <David1.Zhou@amd.com>
> > > Cc: Huang Rui <ray.huang@amd.com>
> > > Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > > Cc: Michel Daenzer <michel.daenzer@amd.com>
> > > Cc: David Airlie <airlied@linux.ie>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > > Cc: Sean Paul <sean@poorly.run>
> > > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > Cc: Will Deacon <will.deacon@arm.com>
> > > Cc: Christoph Hellwig <hch@infradead.org>
> > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > > Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > > Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >
> > The subject line should probably read "disable uncached...".
> >
>
> Ugh, of course ...
>
> > With that fixed the patch is Reviewed-by: Christian König
> > <christian.koenig@amd.com>.
> >

Same:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

>
> Thanks.
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-24 14:01     ` Alex Deucher
@ 2019-01-25  8:43       ` Ard Biesheuvel
  2019-01-25 11:30         ` Christian König
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-01-25  8:43 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Koenig, Christian, Zhou, David(ChunMing),
	Maxime Ripard, Benjamin Herrenschmidt, Carsten Haitzler,
	David Airlie, Maarten Lankhorst, dri-devel, Daenzer, Michel,
	linux-kernel, Will Deacon, Christoph Hellwig, Zhang, Jerry,
	Huang, Ray, amd-gfx list, Daniel Vetter, Michael Ellerman,
	Deucher, Alexander, Sean Paul, linux-arm-kernel, Robin Murphy

On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> <ard.biesheuvel@linaro.org> wrote:
> >
> > On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> > <Christian.Koenig@amd.com> wrote:
> > >
> > > Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > > > The DRM driver stack is designed to work with cache coherent devices
> > > > only, but permits an optimization to be enabled in some cases, where
> > > > for some buffers, both the CPU and the GPU use uncached mappings,
> > > > removing the need for DMA snooping and allocation in the CPU caches.
> > > >
> > > > The use of uncached GPU mappings relies on the correct implementation
> > > > of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > > > will use cached mappings nonetheless. On x86 platforms, this does not
> > > > seem to matter, as uncached CPU mappings will snoop the caches in any
> > > > case. However, on ARM and arm64, enabling this optimization on a
> > > > platform where NoSnoop is ignored results in loss of coherency, which
> > > > breaks correct operation of the device. Since we have no way of
> > > > detecting whether NoSnoop works or not, just disable this
> > > > optimization entirely for ARM and arm64.
> > > >
> > > > Cc: Christian Koenig <christian.koenig@amd.com>
> > > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > > Cc: David Zhou <David1.Zhou@amd.com>
> > > > Cc: Huang Rui <ray.huang@amd.com>
> > > > Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > > > Cc: Michel Daenzer <michel.daenzer@amd.com>
> > > > Cc: David Airlie <airlied@linux.ie>
> > > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > > > Cc: Sean Paul <sean@poorly.run>
> > > > Cc: Michael Ellerman <mpe@ellerman.id.au>
> > > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > > Cc: Will Deacon <will.deacon@arm.com>
> > > > Cc: Christoph Hellwig <hch@infradead.org>
> > > > Cc: Robin Murphy <robin.murphy@arm.com>
> > > > Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > > > Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > > > Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > >
> > > The subject line should probably read "disable uncached...".
> > >
> >
> > Ugh, of course ...
> >
> > > With that fixed the patch is Reviewed-by: Christian König
> > > <christian.koenig@amd.com>.
> > >
>
> Same:
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>

Thanks all

Should I resend the patch with the subject corrected?

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-25  8:43       ` Ard Biesheuvel
@ 2019-01-25 11:30         ` Christian König
  2019-01-25 11:35           ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2019-01-25 11:30 UTC (permalink / raw)
  To: Ard Biesheuvel, Alex Deucher
  Cc: Daenzer, Michel, Carsten Haitzler, Maxime Ripard, linux-kernel,
	dri-devel, Zhang, Jerry, Christoph Hellwig, David Airlie, Huang,
	Ray, amd-gfx list, Michael Ellerman, Will Deacon, Deucher,
	Alexander, Sean Paul, Koenig, Christian, linux-arm-kernel,
	Robin Murphy

Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
>> <ard.biesheuvel@linaro.org> wrote:
>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
>>> <Christian.Koenig@amd.com> wrote:
>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
>>>>> The DRM driver stack is designed to work with cache coherent devices
>>>>> only, but permits an optimization to be enabled in some cases, where
>>>>> for some buffers, both the CPU and the GPU use uncached mappings,
>>>>> removing the need for DMA snooping and allocation in the CPU caches.
>>>>>
>>>>> The use of uncached GPU mappings relies on the correct implementation
>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
>>>>> will use cached mappings nonetheless. On x86 platforms, this does not
>>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
>>>>> case. However, on ARM and arm64, enabling this optimization on a
>>>>> platform where NoSnoop is ignored results in loss of coherency, which
>>>>> breaks correct operation of the device. Since we have no way of
>>>>> detecting whether NoSnoop works or not, just disable this
>>>>> optimization entirely for ARM and arm64.
>>>>>
>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>>>> Cc: David Zhou <David1.Zhou@amd.com>
>>>>> Cc: Huang Rui <ray.huang@amd.com>
>>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
>>>>> Cc: David Airlie <airlied@linux.ie>
>>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
>>>>> Cc: Sean Paul <sean@poorly.run>
>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>>> Cc: Will Deacon <will.deacon@arm.com>
>>>>> Cc: Christoph Hellwig <hch@infradead.org>
>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
>>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
>>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
>>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>> The subject line should probably read "disable uncached...".
>>>>
>>> Ugh, of course ...
>>>
>>>> With that fixed the patch is Reviewed-by: Christian König
>>>> <christian.koenig@amd.com>.
>>>>
>> Same:
>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>>
> Thanks all
>
> Should I resend the patch with the subject corrected?

I will update the subject line and push it upstream through 
drm-misc-next if nobody objects.

Christian.

> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-25 11:30         ` Christian König
@ 2019-01-25 11:35           ` Ard Biesheuvel
  2019-02-06 17:23             ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-01-25 11:35 UTC (permalink / raw)
  To: Koenig, Christian
  Cc: Alex Deucher, Daenzer, Michel, Carsten Haitzler, Maxime Ripard,
	linux-kernel, dri-devel, Zhang, Jerry, Christoph Hellwig,
	David Airlie, Huang, Ray, amd-gfx list, Michael Ellerman,
	Will Deacon, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

On Fri, 25 Jan 2019 at 12:30, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> > On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
> >> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> >> <ard.biesheuvel@linaro.org> wrote:
> >>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> >>> <Christian.Koenig@amd.com> wrote:
> >>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> >>>>> The DRM driver stack is designed to work with cache coherent devices
> >>>>> only, but permits an optimization to be enabled in some cases, where
> >>>>> for some buffers, both the CPU and the GPU use uncached mappings,
> >>>>> removing the need for DMA snooping and allocation in the CPU caches.
> >>>>>
> >>>>> The use of uncached GPU mappings relies on the correct implementation
> >>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> >>>>> will use cached mappings nonetheless. On x86 platforms, this does not
> >>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
> >>>>> case. However, on ARM and arm64, enabling this optimization on a
> >>>>> platform where NoSnoop is ignored results in loss of coherency, which
> >>>>> breaks correct operation of the device. Since we have no way of
> >>>>> detecting whether NoSnoop works or not, just disable this
> >>>>> optimization entirely for ARM and arm64.
> >>>>>
> >>>>> Cc: Christian Koenig <christian.koenig@amd.com>
> >>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
> >>>>> Cc: David Zhou <David1.Zhou@amd.com>
> >>>>> Cc: Huang Rui <ray.huang@amd.com>
> >>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> >>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
> >>>>> Cc: David Airlie <airlied@linux.ie>
> >>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
> >>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> >>>>> Cc: Sean Paul <sean@poorly.run>
> >>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> >>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >>>>> Cc: Will Deacon <will.deacon@arm.com>
> >>>>> Cc: Christoph Hellwig <hch@infradead.org>
> >>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> >>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> >>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> >>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> >>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>>> The subject line should probably read "disable uncached...".
> >>>>
> >>> Ugh, of course ...
> >>>
> >>>> With that fixed the patch is Reviewed-by: Christian König
> >>>> <christian.koenig@amd.com>.
> >>>>
> >> Same:
> >> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> >>
> > Thanks all
> >
> > Should I resend the patch with the subject corrected?
>
> I will update the subject line and push it upstream through
> drm-misc-next if nobody objects.
>

Wonderful, thanks.

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-01-25 11:35           ` Ard Biesheuvel
@ 2019-02-06 17:23             ` Ard Biesheuvel
  2019-02-06 18:38               ` Christian König
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-02-06 17:23 UTC (permalink / raw)
  To: Koenig, Christian
  Cc: Alex Deucher, Daenzer, Michel, Carsten Haitzler, Maxime Ripard,
	linux-kernel, dri-devel, Zhang, Jerry, Christoph Hellwig,
	David Airlie, Huang, Ray, amd-gfx list, Michael Ellerman,
	Will Deacon, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
> On Fri, 25 Jan 2019 at 12:30, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> > > On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
> > >> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> > >> <ard.biesheuvel@linaro.org> wrote:
> > >>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> > >>> <Christian.Koenig@amd.com> wrote:
> > >>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > >>>>> The DRM driver stack is designed to work with cache coherent devices
> > >>>>> only, but permits an optimization to be enabled in some cases, where
> > >>>>> for some buffers, both the CPU and the GPU use uncached mappings,
> > >>>>> removing the need for DMA snooping and allocation in the CPU caches.
> > >>>>>
> > >>>>> The use of uncached GPU mappings relies on the correct implementation
> > >>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > >>>>> will use cached mappings nonetheless. On x86 platforms, this does not
> > >>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
> > >>>>> case. However, on ARM and arm64, enabling this optimization on a
> > >>>>> platform where NoSnoop is ignored results in loss of coherency, which
> > >>>>> breaks correct operation of the device. Since we have no way of
> > >>>>> detecting whether NoSnoop works or not, just disable this
> > >>>>> optimization entirely for ARM and arm64.
> > >>>>>
> > >>>>> Cc: Christian Koenig <christian.koenig@amd.com>
> > >>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
> > >>>>> Cc: David Zhou <David1.Zhou@amd.com>
> > >>>>> Cc: Huang Rui <ray.huang@amd.com>
> > >>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > >>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
> > >>>>> Cc: David Airlie <airlied@linux.ie>
> > >>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
> > >>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > >>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > >>>>> Cc: Sean Paul <sean@poorly.run>
> > >>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> > >>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > >>>>> Cc: Will Deacon <will.deacon@arm.com>
> > >>>>> Cc: Christoph Hellwig <hch@infradead.org>
> > >>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> > >>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > >>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > >>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > >>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > >>>> The subject line should probably read "disable uncached...".
> > >>>>
> > >>> Ugh, of course ...
> > >>>
> > >>>> With that fixed the patch is Reviewed-by: Christian König
> > >>>> <christian.koenig@amd.com>.
> > >>>>
> > >> Same:
> > >> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > >>
> > > Thanks all
> > >
> > > Should I resend the patch with the subject corrected?
> >
> > I will update the subject line and push it upstream through
> > drm-misc-next if nobody objects.
> >
>
> Wonderful, thanks.

Hi Christian,

Are you still planning to merge this for v5.1?

Thanks,
Ard.

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-02-06 17:23             ` Ard Biesheuvel
@ 2019-02-06 18:38               ` Christian König
  2019-02-07 15:20                 ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Christian König @ 2019-02-06 18:38 UTC (permalink / raw)
  To: Ard Biesheuvel, Koenig, Christian
  Cc: Will Deacon, Carsten Haitzler, Maxime Ripard, Michael Ellerman,
	David Airlie, Daenzer, Michel, linux-kernel, dri-devel,
	Christoph Hellwig, Zhang, Jerry, Huang, Ray, amd-gfx list,
	Alex Deucher, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

Am 06.02.19 um 18:23 schrieb Ard Biesheuvel:
> On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>> On Fri, 25 Jan 2019 at 12:30, Christian König
>> <ckoenig.leichtzumerken@gmail.com> wrote:
>>> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
>>>> On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
>>>>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
>>>>> <ard.biesheuvel@linaro.org> wrote:
>>>>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
>>>>>> <Christian.Koenig@amd.com> wrote:
>>>>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
>>>>>>>> The DRM driver stack is designed to work with cache coherent devices
>>>>>>>> only, but permits an optimization to be enabled in some cases, where
>>>>>>>> for some buffers, both the CPU and the GPU use uncached mappings,
>>>>>>>> removing the need for DMA snooping and allocation in the CPU caches.
>>>>>>>>
>>>>>>>> The use of uncached GPU mappings relies on the correct implementation
>>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
>>>>>>>> will use cached mappings nonetheless. On x86 platforms, this does not
>>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
>>>>>>>> case. However, on ARM and arm64, enabling this optimization on a
>>>>>>>> platform where NoSnoop is ignored results in loss of coherency, which
>>>>>>>> breaks correct operation of the device. Since we have no way of
>>>>>>>> detecting whether NoSnoop works or not, just disable this
>>>>>>>> optimization entirely for ARM and arm64.
>>>>>>>>
>>>>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
>>>>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
>>>>>>>> Cc: David Zhou <David1.Zhou@amd.com>
>>>>>>>> Cc: Huang Rui <ray.huang@amd.com>
>>>>>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
>>>>>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
>>>>>>>> Cc: David Airlie <airlied@linux.ie>
>>>>>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
>>>>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>>>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
>>>>>>>> Cc: Sean Paul <sean@poorly.run>
>>>>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>>>>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>>>>>> Cc: Will Deacon <will.deacon@arm.com>
>>>>>>>> Cc: Christoph Hellwig <hch@infradead.org>
>>>>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
>>>>>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
>>>>>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
>>>>>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
>>>>>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>>>>> The subject line should probably read "disable uncached...".
>>>>>>>
>>>>>> Ugh, of course ...
>>>>>>
>>>>>>> With that fixed the patch is Reviewed-by: Christian König
>>>>>>> <christian.koenig@amd.com>.
>>>>>>>
>>>>> Same:
>>>>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
>>>>>
>>>> Thanks all
>>>>
>>>> Should I resend the patch with the subject corrected?
>>> I will update the subject line and push it upstream through
>>> drm-misc-next if nobody objects.
>>>
>> Wonderful, thanks.
> Hi Christian,
>
> Are you still planning to merge this for v5.1?

My bad, only pushed this to our internal branch, but forgot out 
drm-misc-next.

Fixed now, thanks for the reminder.

Christian.

>
> Thanks,
> Ard.
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-02-06 18:38               ` Christian König
@ 2019-02-07 15:20                 ` Ard Biesheuvel
  2019-02-07 15:33                   ` Alex Deucher
  0 siblings, 1 reply; 12+ messages in thread
From: Ard Biesheuvel @ 2019-02-07 15:20 UTC (permalink / raw)
  To: Koenig, Christian
  Cc: Will Deacon, Carsten Haitzler, Maxime Ripard, Michael Ellerman,
	David Airlie, Daenzer, Michel, linux-kernel, dri-devel,
	Christoph Hellwig, Zhang, Jerry, Huang, Ray, amd-gfx list,
	Alex Deucher, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

On Wed, 6 Feb 2019 at 19:38, Christian König
<ckoenig.leichtzumerken@gmail.com> wrote:
>
> Am 06.02.19 um 18:23 schrieb Ard Biesheuvel:
> > On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> >> On Fri, 25 Jan 2019 at 12:30, Christian König
> >> <ckoenig.leichtzumerken@gmail.com> wrote:
> >>> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> >>>> On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
> >>>>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> >>>>> <ard.biesheuvel@linaro.org> wrote:
> >>>>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> >>>>>> <Christian.Koenig@amd.com> wrote:
> >>>>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> >>>>>>>> The DRM driver stack is designed to work with cache coherent devices
> >>>>>>>> only, but permits an optimization to be enabled in some cases, where
> >>>>>>>> for some buffers, both the CPU and the GPU use uncached mappings,
> >>>>>>>> removing the need for DMA snooping and allocation in the CPU caches.
> >>>>>>>>
> >>>>>>>> The use of uncached GPU mappings relies on the correct implementation
> >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this does not
> >>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
> >>>>>>>> case. However, on ARM and arm64, enabling this optimization on a
> >>>>>>>> platform where NoSnoop is ignored results in loss of coherency, which
> >>>>>>>> breaks correct operation of the device. Since we have no way of
> >>>>>>>> detecting whether NoSnoop works or not, just disable this
> >>>>>>>> optimization entirely for ARM and arm64.
> >>>>>>>>
> >>>>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
> >>>>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
> >>>>>>>> Cc: David Zhou <David1.Zhou@amd.com>
> >>>>>>>> Cc: Huang Rui <ray.huang@amd.com>
> >>>>>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> >>>>>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
> >>>>>>>> Cc: David Airlie <airlied@linux.ie>
> >>>>>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
> >>>>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >>>>>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> >>>>>>>> Cc: Sean Paul <sean@poorly.run>
> >>>>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> >>>>>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >>>>>>>> Cc: Will Deacon <will.deacon@arm.com>
> >>>>>>>> Cc: Christoph Hellwig <hch@infradead.org>
> >>>>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> >>>>>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> >>>>>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> >>>>>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> >>>>>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>>>>>> The subject line should probably read "disable uncached...".
> >>>>>>>
> >>>>>> Ugh, of course ...
> >>>>>>
> >>>>>>> With that fixed the patch is Reviewed-by: Christian König
> >>>>>>> <christian.koenig@amd.com>.
> >>>>>>>
> >>>>> Same:
> >>>>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> >>>>>
> >>>> Thanks all
> >>>>
> >>>> Should I resend the patch with the subject corrected?
> >>> I will update the subject line and push it upstream through
> >>> drm-misc-next if nobody objects.
> >>>
> >> Wonderful, thanks.
> > Hi Christian,
> >
> > Are you still planning to merge this for v5.1?
>
> My bad, only pushed this to our internal branch, but forgot out
> drm-misc-next.
>
> Fixed now, thanks for the reminder.
>

Thanks,

Does anyone mind if I propose this patch for backporting to v4.19 or
earlier once it gets merged for v5.1?

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-02-07 15:20                 ` Ard Biesheuvel
@ 2019-02-07 15:33                   ` Alex Deucher
  2019-02-07 16:01                     ` Ard Biesheuvel
  0 siblings, 1 reply; 12+ messages in thread
From: Alex Deucher @ 2019-02-07 15:33 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Koenig, Christian, Will Deacon, Carsten Haitzler, Maxime Ripard,
	Michael Ellerman, David Airlie, Daenzer, Michel, linux-kernel,
	dri-devel, Christoph Hellwig, Zhang, Jerry, Huang, Ray,
	amd-gfx list, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

On Thu, Feb 7, 2019 at 10:20 AM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>
> On Wed, 6 Feb 2019 at 19:38, Christian König
> <ckoenig.leichtzumerken@gmail.com> wrote:
> >
> > Am 06.02.19 um 18:23 schrieb Ard Biesheuvel:
> > > On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > >> On Fri, 25 Jan 2019 at 12:30, Christian König
> > >> <ckoenig.leichtzumerken@gmail.com> wrote:
> > >>> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> > >>>> On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
> > >>>>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> > >>>>> <ard.biesheuvel@linaro.org> wrote:
> > >>>>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> > >>>>>> <Christian.Koenig@amd.com> wrote:
> > >>>>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > >>>>>>>> The DRM driver stack is designed to work with cache coherent devices
> > >>>>>>>> only, but permits an optimization to be enabled in some cases, where
> > >>>>>>>> for some buffers, both the CPU and the GPU use uncached mappings,
> > >>>>>>>> removing the need for DMA snooping and allocation in the CPU caches.
> > >>>>>>>>
> > >>>>>>>> The use of uncached GPU mappings relies on the correct implementation
> > >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this does not
> > >>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
> > >>>>>>>> case. However, on ARM and arm64, enabling this optimization on a
> > >>>>>>>> platform where NoSnoop is ignored results in loss of coherency, which
> > >>>>>>>> breaks correct operation of the device. Since we have no way of
> > >>>>>>>> detecting whether NoSnoop works or not, just disable this
> > >>>>>>>> optimization entirely for ARM and arm64.
> > >>>>>>>>
> > >>>>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
> > >>>>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
> > >>>>>>>> Cc: David Zhou <David1.Zhou@amd.com>
> > >>>>>>>> Cc: Huang Rui <ray.huang@amd.com>
> > >>>>>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > >>>>>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
> > >>>>>>>> Cc: David Airlie <airlied@linux.ie>
> > >>>>>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
> > >>>>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > >>>>>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > >>>>>>>> Cc: Sean Paul <sean@poorly.run>
> > >>>>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> > >>>>>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > >>>>>>>> Cc: Will Deacon <will.deacon@arm.com>
> > >>>>>>>> Cc: Christoph Hellwig <hch@infradead.org>
> > >>>>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> > >>>>>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > >>>>>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > >>>>>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > >>>>>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > >>>>>>> The subject line should probably read "disable uncached...".
> > >>>>>>>
> > >>>>>> Ugh, of course ...
> > >>>>>>
> > >>>>>>> With that fixed the patch is Reviewed-by: Christian König
> > >>>>>>> <christian.koenig@amd.com>.
> > >>>>>>>
> > >>>>> Same:
> > >>>>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > >>>>>
> > >>>> Thanks all
> > >>>>
> > >>>> Should I resend the patch with the subject corrected?
> > >>> I will update the subject line and push it upstream through
> > >>> drm-misc-next if nobody objects.
> > >>>
> > >> Wonderful, thanks.
> > > Hi Christian,
> > >
> > > Are you still planning to merge this for v5.1?
> >
> > My bad, only pushed this to our internal branch, but forgot out
> > drm-misc-next.
> >
> > Fixed now, thanks for the reminder.
> >
>
> Thanks,
>
> Does anyone mind if I propose this patch for backporting to v4.19 or
> earlier once it gets merged for v5.1?

Go for it.  I was going to suggest that this should probably go to stable.

Alex

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

* Re: [PATCH] drm: enable uncached DMA optimization for ARM and arm64
  2019-02-07 15:33                   ` Alex Deucher
@ 2019-02-07 16:01                     ` Ard Biesheuvel
  0 siblings, 0 replies; 12+ messages in thread
From: Ard Biesheuvel @ 2019-02-07 16:01 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Koenig, Christian, Will Deacon, Carsten Haitzler, Maxime Ripard,
	Michael Ellerman, David Airlie, Daenzer, Michel, linux-kernel,
	dri-devel, Christoph Hellwig, Zhang, Jerry, Huang, Ray,
	amd-gfx list, Deucher, Alexander, Sean Paul, linux-arm-kernel,
	Robin Murphy

On Thu, 7 Feb 2019 at 16:33, Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Thu, Feb 7, 2019 at 10:20 AM Ard Biesheuvel
> <ard.biesheuvel@linaro.org> wrote:
> >
> > On Wed, 6 Feb 2019 at 19:38, Christian König
> > <ckoenig.leichtzumerken@gmail.com> wrote:
> > >
> > > Am 06.02.19 um 18:23 schrieb Ard Biesheuvel:
> > > > On Fri, 25 Jan 2019 at 11:35, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > > >> On Fri, 25 Jan 2019 at 12:30, Christian König
> > > >> <ckoenig.leichtzumerken@gmail.com> wrote:
> > > >>> Am 25.01.19 um 09:43 schrieb Ard Biesheuvel:
> > > >>>> On Thu, 24 Jan 2019 at 15:01, Alex Deucher <alexdeucher@gmail.com> wrote:
> > > >>>>> On Thu, Jan 24, 2019 at 9:00 AM Ard Biesheuvel
> > > >>>>> <ard.biesheuvel@linaro.org> wrote:
> > > >>>>>> On Thu, 24 Jan 2019 at 13:31, Koenig, Christian
> > > >>>>>> <Christian.Koenig@amd.com> wrote:
> > > >>>>>>> Am 24.01.19 um 13:06 schrieb Ard Biesheuvel:
> > > >>>>>>>> The DRM driver stack is designed to work with cache coherent devices
> > > >>>>>>>> only, but permits an optimization to be enabled in some cases, where
> > > >>>>>>>> for some buffers, both the CPU and the GPU use uncached mappings,
> > > >>>>>>>> removing the need for DMA snooping and allocation in the CPU caches.
> > > >>>>>>>>
> > > >>>>>>>> The use of uncached GPU mappings relies on the correct implementation
> > > >>>>>>>> of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
> > > >>>>>>>> will use cached mappings nonetheless. On x86 platforms, this does not
> > > >>>>>>>> seem to matter, as uncached CPU mappings will snoop the caches in any
> > > >>>>>>>> case. However, on ARM and arm64, enabling this optimization on a
> > > >>>>>>>> platform where NoSnoop is ignored results in loss of coherency, which
> > > >>>>>>>> breaks correct operation of the device. Since we have no way of
> > > >>>>>>>> detecting whether NoSnoop works or not, just disable this
> > > >>>>>>>> optimization entirely for ARM and arm64.
> > > >>>>>>>>
> > > >>>>>>>> Cc: Christian Koenig <christian.koenig@amd.com>
> > > >>>>>>>> Cc: Alex Deucher <alexander.deucher@amd.com>
> > > >>>>>>>> Cc: David Zhou <David1.Zhou@amd.com>
> > > >>>>>>>> Cc: Huang Rui <ray.huang@amd.com>
> > > >>>>>>>> Cc: Junwei Zhang <Jerry.Zhang@amd.com>
> > > >>>>>>>> Cc: Michel Daenzer <michel.daenzer@amd.com>
> > > >>>>>>>> Cc: David Airlie <airlied@linux.ie>
> > > >>>>>>>> Cc: Daniel Vetter <daniel@ffwll.ch>
> > > >>>>>>>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > >>>>>>>> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > > >>>>>>>> Cc: Sean Paul <sean@poorly.run>
> > > >>>>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
> > > >>>>>>>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > >>>>>>>> Cc: Will Deacon <will.deacon@arm.com>
> > > >>>>>>>> Cc: Christoph Hellwig <hch@infradead.org>
> > > >>>>>>>> Cc: Robin Murphy <robin.murphy@arm.com>
> > > >>>>>>>> Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
> > > >>>>>>>> Cc: dri-devel <dri-devel@lists.freedesktop.org>
> > > >>>>>>>> Reported-by: Carsten Haitzler <Carsten.Haitzler@arm.com>
> > > >>>>>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > >>>>>>> The subject line should probably read "disable uncached...".
> > > >>>>>>>
> > > >>>>>> Ugh, of course ...
> > > >>>>>>
> > > >>>>>>> With that fixed the patch is Reviewed-by: Christian König
> > > >>>>>>> <christian.koenig@amd.com>.
> > > >>>>>>>
> > > >>>>> Same:
> > > >>>>> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > > >>>>>
> > > >>>> Thanks all
> > > >>>>
> > > >>>> Should I resend the patch with the subject corrected?
> > > >>> I will update the subject line and push it upstream through
> > > >>> drm-misc-next if nobody objects.
> > > >>>
> > > >> Wonderful, thanks.
> > > > Hi Christian,
> > > >
> > > > Are you still planning to merge this for v5.1?
> > >
> > > My bad, only pushed this to our internal branch, but forgot out
> > > drm-misc-next.
> > >
> > > Fixed now, thanks for the reminder.
> > >
> >
> > Thanks,
> >
> > Does anyone mind if I propose this patch for backporting to v4.19 or
> > earlier once it gets merged for v5.1?
>
> Go for it.  I was going to suggest that this should probably go to stable.
>

Excellent. Note that I actually prefer sending it manually rather than
let Greg or Sasha pick it up automatically, given that they are
usually a bit trigger happy, i.e., patches tend to get backported
before anyone has had a chance to actually check that it doesn't break
anything in mainline.

In other words, please don't add a cc -stable or fixes tag. I will
track it myself instead.

Thanks,
Ard.

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

end of thread, other threads:[~2019-02-07 16:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 12:06 [PATCH] drm: enable uncached DMA optimization for ARM and arm64 Ard Biesheuvel
2019-01-24 12:31 ` Koenig, Christian
2019-01-24 12:32   ` Ard Biesheuvel
2019-01-24 14:01     ` Alex Deucher
2019-01-25  8:43       ` Ard Biesheuvel
2019-01-25 11:30         ` Christian König
2019-01-25 11:35           ` Ard Biesheuvel
2019-02-06 17:23             ` Ard Biesheuvel
2019-02-06 18:38               ` Christian König
2019-02-07 15:20                 ` Ard Biesheuvel
2019-02-07 15:33                   ` Alex Deucher
2019-02-07 16:01                     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).