From: Xiaolei Wang <xiaolei.wang@windriver.com>
To: l.stach@pengutronix.de, linux+etnaviv@armlinux.org.uk,
christian.gmeiner@gmail.com, airlied@gmail.com, daniel@ffwll.ch
Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/etnaviv: Remove GFP_HIGHUSER in systems with 32 address limits
Date: Tue, 6 Aug 2024 18:47:33 +0800 [thread overview]
Message-ID: <20240806104733.2018783-1-xiaolei.wang@windriver.com> (raw)
GFP_HIGHUSER is for userspace allocations that may be mapped
to userspace,An example may be a hardware allocation that maps
data directly into userspace but has no addressing limitations,
this conflicts with GFP_DMA32,The kernel reports a BUG:
kernel BUG at include/linux/gfp.h:139!
Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Modules linked in:
Hardware name: NXP i.MX8MPlus EVK board (DT)
pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __alloc_pages_noprof+0x5d8/0x72c
lr : alloc_pages_mpol_noprof+0x100/0x4e0
sp : ffffffc08c6a71c0
x29: ffffffc08c6a71c0 x28: ffffffc086e46000 x27: ffffffc086e46a68
x26: 1ffffff81122b260 x25: ffffffc089159304 x24: ffffff80da938000
x23: 0000000000000000 x22: 0000000000000000 x21: ffffff80da938000
x20: 1ffffff8118d4e46 x19: 0000000000146cc6 x18: 0000000000000000
x17: ffffffc081b00980 x16: ffffffc081b002a8 x15: 1ffffff8118d4e56
x14: 00000000f1f1f1f1 x13: 00000000f3f3f300 x12: 0000000000000000
x11: ffffff80da9384c8 x10: ffffff80da938000 x9 : 00000000f2f2f200
x8 : 0000000041b58ab3 x7 : 00000000f3000000 x6 : 00000000f3f3f3f3
x5 : 1ffffff01b527005 x4 : 000000000000000c x3 : 0000000000000006
x2 : 0000000000000000 x1 : 00000000000003a3 x0 : 0000000000000000
Call trace:
__alloc_pages_noprof+0x5d8/0x72c
alloc_pages_mpol_noprof+0x100/0x4e0
folio_alloc_mpol_noprof+0x18/0xb8
shmem_alloc_folio+0x154/0x1a8
shmem_alloc_and_add_folio+0x180/0xee8
shmem_get_folio_gfp+0x660/0x103c
shmem_read_folio_gfp+0x98/0x104
drm_gem_get_pages+0x174/0x5ac
etnaviv_gem_shmem_get_pages+0x18/0x5c
etnaviv_gem_get_pages+0x100/0x328
etnaviv_gem_cpu_prep+0x2e8/0x438
etnaviv_ioctl_gem_cpu_prep+0xb0/0x1ac
drm_ioctl_kernel+0x158/0x2c8
drm_ioctl+0x494/0xb48
__arm64_sys_ioctl+0x120/0x18c
invoke_syscall+0x6c/0x25c
el0_svc_common.constprop.0+0x174/0x278
do_el0_svc+0x40/0x58
el0_svc+0x50/0xc0
el0t_64_sync_handler+0xc0/0xc4
el0t_64_sync+0x190/0x194
Code: 52800021 39003c01 d4210000 17ffff57 (d4210000)
Fixes: b72af445cd38 ("drm/etnaviv: request pages from DMA32 zone when needed")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
---
drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 7c7f97793ddd..c3f329226bed 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))
- priv->shm_gfp_mask |= GFP_DMA32;
+ if (dma_addressing_limited(gpu->dev)) {
+ priv->shm_gfp_mask |= GFP_DMA32 & GFP_USER;
+ priv->shm_gfp_mask &= ~GFP_HIGHUSER;
+ }
/* Create buffer: */
ret = etnaviv_cmdbuf_init(priv->cmdbuf_suballoc, &gpu->buffer,
--
2.25.1
next reply other threads:[~2024-08-06 10:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-06 10:47 Xiaolei Wang [this message]
2024-08-06 12:23 ` Lucas Stach
2024-08-06 13:17 ` wang xiaolei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240806104733.2018783-1-xiaolei.wang@windriver.com \
--to=xiaolei.wang@windriver.com \
--cc=airlied@gmail.com \
--cc=christian.gmeiner@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®