All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/etnaviv: Clear the __GFP_HIGHMEM bit in GFP_HIGHUSER with 32 address
@ 2024-08-07  1:33 Xiaolei Wang
  2024-08-16  1:55 ` Wang, Xiaolei
  0 siblings, 1 reply; 6+ messages in thread
From: Xiaolei Wang @ 2024-08-07  1:33 UTC (permalink / raw)
  To: l.stach, linux+etnaviv, christian.gmeiner, airlied, daniel
  Cc: etnaviv, dri-devel, linux-kernel

GFP_HIGHUSER is a combination of GFP_USER | __GFP_HIGHMEM.
Only the highmem part is incompatible with DMA32. Reserve
GFP_USER bit here, as the driver allocated buffers might
be mapped to userspace.

Fixes: b72af445cd38 ("drm/etnaviv: request pages from DMA32 zone when needed")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
change log

v1:
  https://patchwork.kernel.org/project/dri-devel/patch/20240806104733.2018783-1-xiaolei.wang@windriver.com/

v2:
  Modify the issue of not retaining GFP_USER in v1 and update the commit log.

 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 7c7f97793ddd..0e6bdf2d028b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -844,8 +844,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
 	 * request pages for our SHM backend buffers from the DMA32 zone to
 	 * hopefully avoid performance killing SWIOTLB bounce buffering.
 	 */
-	if (dma_addressing_limited(gpu->dev))
+	if (dma_addressing_limited(gpu->dev)) {
 		priv->shm_gfp_mask |= GFP_DMA32;
+		priv->shm_gfp_mask &= ~__GFP_HIGHMEM;
+	}
 
 	/* Create buffer: */
 	ret = etnaviv_cmdbuf_init(priv->cmdbuf_suballoc, &gpu->buffer,
-- 
2.25.1


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

end of thread, other threads:[~2024-09-03  1:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  1:33 [PATCH v2] drm/etnaviv: Clear the __GFP_HIGHMEM bit in GFP_HIGHUSER with 32 address Xiaolei Wang
2024-08-16  1:55 ` Wang, Xiaolei
2024-08-30 19:40   ` [v2] " Sui Jingfeng
2024-08-30 19:48     ` Sui Jingfeng
2024-08-30 21:03   ` Sui Jingfeng
2024-09-03  1:00     ` wang xiaolei

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.