<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Ping ...</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
thanks</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
xiaolei</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Wang, Xiaolei<br>
<b>Sent:</b> Wednesday, August 7, 2024 9:33 AM<br>
<b>To:</b> l.stach@pengutronix.de <l.stach@pengutronix.de>; linux+etnaviv@armlinux.org.uk <linux+etnaviv@armlinux.org.uk>; christian.gmeiner@gmail.com <christian.gmeiner@gmail.com>; airlied@gmail.com <airlied@gmail.com>; daniel@ffwll.ch <daniel@ffwll.ch><br>
<b>Cc:</b> etnaviv@lists.freedesktop.org <etnaviv@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org>; linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org><br>
<b>Subject:</b> [PATCH v2] drm/etnaviv: Clear the __GFP_HIGHMEM bit in GFP_HIGHUSER with 32 address</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">GFP_HIGHUSER is a combination of GFP_USER | __GFP_HIGHMEM.<br>
Only the highmem part is incompatible with DMA32. Reserve<br>
GFP_USER bit here, as the driver allocated buffers might<br>
be mapped to userspace.<br>
<br>
Fixes: b72af445cd38 ("drm/etnaviv: request pages from DMA32 zone when needed")<br>
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com><br>
---<br>
change log<br>
<br>
v1:<br>
<a href="https://patchwork.kernel.org/project/dri-devel/patch/20240806104733.2018783-1-xiaolei.wang@windriver.com/">
https://patchwork.kernel.org/project/dri-devel/patch/20240806104733.2018783-1-xiaolei.wang@windriver.com/</a><br>
<br>
v2:<br>
Modify the issue of not retaining GFP_USER in v1 and update the commit log.<br>
<br>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 +++-<br>
1 file changed, 3 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
index 7c7f97793ddd..0e6bdf2d028b 100644<br>
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c<br>
@@ -844,8 +844,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)<br>
* request pages for our SHM backend buffers from the DMA32 zone to<br>
* hopefully avoid performance killing SWIOTLB bounce buffering.<br>
*/<br>
- if (dma_addressing_limited(gpu->dev))<br>
+ if (dma_addressing_limited(gpu->dev)) {<br>
priv->shm_gfp_mask |= GFP_DMA32;<br>
+ priv->shm_gfp_mask &= ~__GFP_HIGHMEM;<br>
+ }<br>
<br>
/* Create buffer: */<br>
ret = etnaviv_cmdbuf_init(priv->cmdbuf_suballoc, &gpu->buffer,<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</body>
</html>