* [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent
@ 2026-09-03 11:18 Baoquan He
2026-09-03 11:18 ` [PATCH 01/13] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
` (12 more replies)
0 siblings, 13 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He
This series picks up the first part of an earlier cleanup series [1] that
was prepared back in the year of 2022, but for various reasons never made
it merged and has been sitting in a local tree since then. This subset
only touches the call sites where GFP_DMA is passed to dma_alloc_coherent()
(and its dma_alloc_wc()/dmam_alloc_coherent() variants), which is the most
self-contained and least risky slice of that work.
That GFP_DMA is simply redundant here: the DMA API derives the allocation
zone from the device's coherent_dma_mask (together with bus_dma_limit) and
ignores the GFP_DMA flag passed by the caller.
Removing the redundant GFP_DMA won't harm anything, while keeps it from
being blindly copied into new code.
[1]
[PATCH 00/22] Don't use kmalloc() with GFP_DMA
https://lore.kernel.org/all/20220219005221.634-1-bhe@redhat.com/T/#u
Baoquan He (13):
gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent()
drm/sti: Don't use GFP_DMA when calling dma_alloc_wc()
ALSA: n64: Don't use GFP_DMA when calling dma_alloc_coherent()
spi: spi-ti-qspi: Don't use GFP_DMA when calling dma_alloc_coherent()
fbdev: fsl-diu-fb: Don't use GFP_DMA when calling
dmam_alloc_coherent()
usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling
dma_alloc_coherent()
usb: cdns3: Don't use GFP_DMA when calling dma_alloc_coherent()
media: staging: imx: Don't use GFP_DMA when calling
dma_alloc_coherent()
spi: atmel: Don't use GFP_DMA when calling dma_alloc_coherent()
media: imx7-media-csi: Don't use GFP_DMA when calling
dma_alloc_coherent()
media: nxp: imx8-isi: Don't use GFP_DMA when calling
dma_alloc_coherent()
mtd: rawnand: gpmi: Don't use GFP_DMA when calling
dma_alloc_coherent()
usb: cdns2: Don't use GFP_DMA when calling dma_alloc_coherent()
drivers/gpu/drm/sti/sti_cursor.c | 4 ++--
drivers/gpu/drm/sti/sti_hqvdp.c | 2 +-
drivers/gpu/ipu-v3/ipu-image-convert.c | 2 +-
drivers/media/platform/nxp/imx7-media-csi.c | 2 +-
drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c | 2 +-
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +-
drivers/spi/spi-atmel.c | 4 ++--
drivers/spi/spi-ti-qspi.c | 2 +-
drivers/staging/media/imx/imx-media-utils.c | 2 +-
drivers/usb/cdns3/cdns3-gadget.c | 2 +-
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 2 +-
drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +-
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
sound/mips/snd-n64.c | 2 +-
14 files changed, 16 insertions(+), 16 deletions(-)
--
2.54.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 01/13] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 02/13] drm/sti: Don't use GFP_DMA when calling dma_alloc_wc() Baoquan He
` (11 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, dri-devel
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/gpu/ipu-v3/ipu-image-convert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c
index 29b6d36c9bb6..493be4d4b091 100644
--- a/drivers/gpu/ipu-v3/ipu-image-convert.c
+++ b/drivers/gpu/ipu-v3/ipu-image-convert.c
@@ -371,7 +371,7 @@ static int alloc_dma_buf(struct ipu_image_convert_priv *priv,
{
buf->len = PAGE_ALIGN(size);
buf->virt = dma_alloc_coherent(priv->ipu->dev, buf->len, &buf->phys,
- GFP_DMA | GFP_KERNEL);
+ GFP_KERNEL);
if (!buf->virt) {
dev_err(priv->ipu->dev, "failed to alloc dma buffer\n");
return -ENOMEM;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 02/13] drm/sti: Don't use GFP_DMA when calling dma_alloc_wc()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
2026-09-03 11:18 ` [PATCH 01/13] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 03/13] ALSA: n64: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
` (10 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, dri-devel
dma_alloc_wc() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/gpu/drm/sti/sti_cursor.c | 4 ++--
drivers/gpu/drm/sti/sti_hqvdp.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index d0b89b28e50c..a0ec671477fd 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -240,7 +240,7 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
cursor->pixmap.base = dma_alloc_wc(cursor->dev,
cursor->pixmap.size,
&cursor->pixmap.paddr,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!cursor->pixmap.base) {
DRM_ERROR("Failed to allocate memory for pixmap\n");
return -EINVAL;
@@ -380,7 +380,7 @@ struct drm_plane *sti_cursor_create(struct drm_device *drm_dev,
/* Allocate clut buffer */
size = 0x100 * sizeof(unsigned short);
cursor->clut = dma_alloc_wc(dev, size, &cursor->clut_paddr,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!cursor->clut) {
DRM_ERROR("Failed to allocate memory for cursor clut\n");
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index cf1ed8a33b8e..b0d66834bcbe 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -860,7 +860,7 @@ static void sti_hqvdp_init(struct sti_hqvdp *hqvdp)
size = NB_VDP_CMD * sizeof(struct sti_hqvdp_cmd);
hqvdp->hqvdp_cmd = dma_alloc_wc(hqvdp->dev, size,
&dma_addr,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!hqvdp->hqvdp_cmd) {
DRM_ERROR("Failed to allocate memory for VDP cmd\n");
return;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 03/13] ALSA: n64: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
2026-09-03 11:18 ` [PATCH 01/13] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
2026-09-03 11:18 ` [PATCH 02/13] drm/sti: Don't use GFP_DMA when calling dma_alloc_wc() Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 04/13] spi: spi-ti-qspi: " Baoquan He
` (9 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-sound
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: linux-sound@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
sound/mips/snd-n64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/mips/snd-n64.c b/sound/mips/snd-n64.c
index f17e63f2ff5a..e2cf9df15d48 100644
--- a/sound/mips/snd-n64.c
+++ b/sound/mips/snd-n64.c
@@ -298,7 +298,7 @@ static int __init n64audio_probe(struct platform_device *pdev)
priv->card = card;
priv->ring_base = dma_alloc_coherent(card->dev, 32 * 1024, &priv->ring_base_dma,
- GFP_DMA|GFP_KERNEL);
+ GFP_KERNEL);
if (!priv->ring_base) {
err = -ENOMEM;
goto fail_card;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 04/13] spi: spi-ti-qspi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (2 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 03/13] ALSA: n64: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 05/13] fbdev: fsl-diu-fb: Don't use GFP_DMA when calling dmam_alloc_coherent() Baoquan He
` (8 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-spi
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: linux-spi@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/spi/spi-ti-qspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 34b154922ff2..fb0d940883fb 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -855,7 +855,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
qspi->rx_bb_addr = dma_alloc_coherent(qspi->dev,
QSPI_DMA_BUFFER_SIZE,
&qspi->rx_bb_dma_addr,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!qspi->rx_bb_addr) {
dev_err(qspi->dev,
"dma_alloc_coherent failed, using PIO mode\n");
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 05/13] fbdev: fsl-diu-fb: Don't use GFP_DMA when calling dmam_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (3 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 04/13] spi: spi-ti-qspi: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 06/13] usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
` (7 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, dri-devel
dmam_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/fsl-diu-fb.c b/drivers/video/fbdev/fsl-diu-fb.c
index b71d15794ce8..d7ed007915c1 100644
--- a/drivers/video/fbdev/fsl-diu-fb.c
+++ b/drivers/video/fbdev/fsl-diu-fb.c
@@ -1690,7 +1690,7 @@ static int fsl_diu_probe(struct platform_device *pdev)
int ret;
data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
- &dma_addr, GFP_DMA | __GFP_ZERO);
+ &dma_addr, __GFP_ZERO);
if (!data)
return -ENOMEM;
data->dma_addr = dma_addr;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 06/13] usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (4 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 05/13] fbdev: fsl-diu-fb: Don't use GFP_DMA when calling dmam_alloc_coherent() Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 07/13] usb: cdns3: " Baoquan He
` (6 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-usb
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: linux-usb@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/usb/gadget/udc/lpc32xx_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c
index 044c31869cfb..90d1eef52877 100644
--- a/drivers/usb/gadget/udc/lpc32xx_udc.c
+++ b/drivers/usb/gadget/udc/lpc32xx_udc.c
@@ -3080,7 +3080,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
/* Allocate memory for the UDCA */
udc->udca_v_base = dma_alloc_coherent(&pdev->dev, UDCA_BUFF_SIZE,
&dma_handle,
- (GFP_KERNEL | GFP_DMA));
+ GFP_KERNEL);
if (!udc->udca_v_base) {
dev_err(udc->dev, "error getting UDCA region\n");
retval = -ENOMEM;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 07/13] usb: cdns3: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (5 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 06/13] usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 08/13] media: staging: imx: " Baoquan He
` (5 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-usb
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Use GFP_KERNEL instead so the allocation may reclaim as usual for
probe-time allocations.
Cc: linux-usb@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/usb/cdns3/cdns3-gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index 42311c1bfada..484d3128cf08 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -3376,7 +3376,7 @@ static int cdns3_gadget_start(struct cdns *cdns)
/* allocate memory for setup packet buffer */
priv_dev->setup_buf = dma_alloc_coherent(priv_dev->sysdev, 8,
- &priv_dev->setup_dma, GFP_DMA);
+ &priv_dev->setup_dma, GFP_KERNEL);
if (!priv_dev->setup_buf) {
ret = -ENOMEM;
goto err2;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 08/13] media: staging: imx: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (6 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 07/13] usb: cdns3: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 09/13] spi: atmel: " Baoquan He
` (4 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-staging
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: linux-staging@lists.linux.dev
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/staging/media/imx/imx-media-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index f119477cac6b..7bdcb88a686b 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -588,7 +588,7 @@ int imx_media_alloc_dma_buf(struct device *dev,
buf->len = PAGE_ALIGN(size);
buf->virt = dma_alloc_coherent(dev, buf->len, &buf->phys,
- GFP_DMA | GFP_KERNEL);
+ GFP_KERNEL);
if (!buf->virt)
return -ENOMEM;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 09/13] spi: atmel: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (7 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 08/13] media: staging: imx: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 10/13] media: imx7-media-csi: " Baoquan He
` (3 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-spi
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: linux-spi@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/spi/spi-atmel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index c8012c82c3a7..e91e84fdbe8f 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -624,7 +624,7 @@ static int atmel_spi_configure_dma(struct spi_controller *host,
if (IS_ENABLED(CONFIG_SOC_SAM_V4_V5)) {
as->addr_tx_bbuf = dma_alloc_coherent(dev, SPI_MAX_DMA_XFER,
&as->dma_addr_tx_bbuf,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!as->addr_tx_bbuf) {
err = -ENOMEM;
goto err_release_dma;
@@ -632,7 +632,7 @@ static int atmel_spi_configure_dma(struct spi_controller *host,
as->addr_rx_bbuf = dma_alloc_coherent(dev, SPI_MAX_DMA_XFER,
&as->dma_addr_rx_bbuf,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL);
if (!as->addr_rx_bbuf) {
err = -ENOMEM;
goto err_release_dma;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 10/13] media: imx7-media-csi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (8 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 09/13] spi: atmel: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-04 15:14 ` Frank Li
2026-09-03 11:18 ` [PATCH 11/13] media: nxp: imx8-isi: " Baoquan He
` (2 subsequent siblings)
12 siblings, 1 reply; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, imx
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: imx@lists.linux.dev
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/media/platform/nxp/imx7-media-csi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index 7ddc7ba06e3d..22c0cbdc92bf 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -466,7 +466,7 @@ static int imx7_csi_alloc_dma_buf(struct imx7_csi *csi,
buf->len = PAGE_ALIGN(size);
buf->virt = dma_alloc_coherent(csi->dev, buf->len, &buf->dma_addr,
- GFP_DMA | GFP_KERNEL);
+ GFP_KERNEL);
if (!buf->virt)
return -ENOMEM;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 11/13] media: nxp: imx8-isi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (9 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 10/13] media: imx7-media-csi: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-04 15:14 ` Frank Li
2026-09-03 11:18 ` [PATCH 12/13] mtd: rawnand: gpmi: " Baoquan He
2026-09-03 11:18 ` [PATCH 13/13] usb: cdns2: " Baoquan He
12 siblings, 1 reply; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, imx
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Remove the redundant GFP_DMA flag.
Cc: imx@lists.linux.dev
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
index f45c2aae59ce..fc907d357149 100644
--- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
+++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
@@ -773,7 +773,7 @@ static int mxc_isi_video_alloc_discard_buffers(struct mxc_isi_video *video)
buf->size = PAGE_ALIGN(video->pix.plane_fmt[i].sizeimage);
buf->addr = dma_alloc_coherent(video->pipe->isi->dev, buf->size,
- &buf->dma, GFP_DMA | GFP_KERNEL);
+ &buf->dma, GFP_KERNEL);
if (!buf->addr) {
mxc_isi_video_free_discard_buffers(video);
return -ENOMEM;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 12/13] mtd: rawnand: gpmi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (10 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 11/13] media: nxp: imx8-isi: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
2026-09-03 11:18 ` [PATCH 13/13] usb: cdns2: " Baoquan He
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-mtd
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Use GFP_KERNEL instead so the allocation may reclaim as usual for
probe-time allocations.
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index 527165ccc839..0d91950ae9fd 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -1387,7 +1387,7 @@ static int gpmi_alloc_dma_buffer(struct gpmi_nand_data *this)
goto error_alloc;
this->auxiliary_virt = dma_alloc_coherent(dev, geo->auxiliary_size,
- &this->auxiliary_phys, GFP_DMA);
+ &this->auxiliary_phys, GFP_KERNEL);
if (!this->auxiliary_virt)
goto error_alloc;
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 13/13] usb: cdns2: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
` (11 preceding siblings ...)
2026-09-03 11:18 ` [PATCH 12/13] mtd: rawnand: gpmi: " Baoquan He
@ 2026-09-03 11:18 ` Baoquan He
12 siblings, 0 replies; 16+ messages in thread
From: Baoquan He @ 2026-09-03 11:18 UTC (permalink / raw)
To: linux-mm; +Cc: akpm, hch, harry, Baoquan He, linux-usb
dma_alloc_coherent() allocates the DMA buffer with the device's
addressing limitation in mind; the DMA core picks the zone from the
device's coherent DMA mask and ignores GFP_DMA passed by the caller.
Use GFP_KERNEL instead so the allocation may reclaim as usual for
probe-time allocations.
Cc: linux-usb@vger.kernel.org
Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
---
drivers/usb/gadget/udc/cdns2/cdns2-gadget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
index 308d3c468ab1..8719f1f86e61 100644
--- a/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
+++ b/drivers/usb/gadget/udc/cdns2/cdns2-gadget.c
@@ -2341,7 +2341,7 @@ static int cdns2_gadget_start(struct cdns2_device *pdev)
/* Allocate memory for setup packet buffer. */
buf = dma_alloc_coherent(pdev->dev, 8, &pdev->ep0_preq.request.dma,
- GFP_DMA);
+ GFP_KERNEL);
pdev->ep0_preq.request.buf = buf;
if (!pdev->ep0_preq.request.buf) {
--
2.54.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 11/13] media: nxp: imx8-isi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 ` [PATCH 11/13] media: nxp: imx8-isi: " Baoquan He
@ 2026-09-04 15:14 ` Frank Li
0 siblings, 0 replies; 16+ messages in thread
From: Frank Li @ 2026-09-04 15:14 UTC (permalink / raw)
To: Baoquan He; +Cc: linux-mm, akpm, hch, harry, imx
On Thu, Sep 03, 2026 at 07:18:34PM +0800, Baoquan He wrote:
> [You don't often get email from hebaoquan@kylinos.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> dma_alloc_coherent() allocates the DMA buffer with the device's
> addressing limitation in mind; the DMA core picks the zone from the
> device's coherent DMA mask and ignores GFP_DMA passed by the caller.
> Remove the redundant GFP_DMA flag.
>
> Cc: imx@lists.linux.dev
> Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> index f45c2aae59ce..fc907d357149 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> @@ -773,7 +773,7 @@ static int mxc_isi_video_alloc_discard_buffers(struct mxc_isi_video *video)
>
> buf->size = PAGE_ALIGN(video->pix.plane_fmt[i].sizeimage);
> buf->addr = dma_alloc_coherent(video->pipe->isi->dev, buf->size,
> - &buf->dma, GFP_DMA | GFP_KERNEL);
> + &buf->dma, GFP_KERNEL);
> if (!buf->addr) {
> mxc_isi_video_free_discard_buffers(video);
> return -ENOMEM;
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 10/13] media: imx7-media-csi: Don't use GFP_DMA when calling dma_alloc_coherent()
2026-09-03 11:18 ` [PATCH 10/13] media: imx7-media-csi: " Baoquan He
@ 2026-09-04 15:14 ` Frank Li
0 siblings, 0 replies; 16+ messages in thread
From: Frank Li @ 2026-09-04 15:14 UTC (permalink / raw)
To: Baoquan He; +Cc: linux-mm, akpm, hch, harry, imx
On Thu, Sep 03, 2026 at 07:18:33PM +0800, Baoquan He wrote:
> [You don't often get email from hebaoquan@kylinos.cn. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> dma_alloc_coherent() allocates the DMA buffer with the device's
> addressing limitation in mind; the DMA core picks the zone from the
> device's coherent DMA mask and ignores GFP_DMA passed by the caller.
> Remove the redundant GFP_DMA flag.
>
> Cc: imx@lists.linux.dev
> Signed-off-by: Baoquan He <hebaoquan@kylinos.cn>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/media/platform/nxp/imx7-media-csi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
> index 7ddc7ba06e3d..22c0cbdc92bf 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -466,7 +466,7 @@ static int imx7_csi_alloc_dma_buf(struct imx7_csi *csi,
>
> buf->len = PAGE_ALIGN(size);
> buf->virt = dma_alloc_coherent(csi->dev, buf->len, &buf->dma_addr,
> - GFP_DMA | GFP_KERNEL);
> + GFP_KERNEL);
> if (!buf->virt)
> return -ENOMEM;
>
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-09-04 15:15 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 11:18 [PATCH 00/13] Don't use GFP_DMA when calling dma_alloc_coherent Baoquan He
2026-09-03 11:18 ` [PATCH 01/13] gpu: ipu-v3: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
2026-09-03 11:18 ` [PATCH 02/13] drm/sti: Don't use GFP_DMA when calling dma_alloc_wc() Baoquan He
2026-09-03 11:18 ` [PATCH 03/13] ALSA: n64: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
2026-09-03 11:18 ` [PATCH 04/13] spi: spi-ti-qspi: " Baoquan He
2026-09-03 11:18 ` [PATCH 05/13] fbdev: fsl-diu-fb: Don't use GFP_DMA when calling dmam_alloc_coherent() Baoquan He
2026-09-03 11:18 ` [PATCH 06/13] usb: gadget: lpc32xx_udc: Don't use GFP_DMA when calling dma_alloc_coherent() Baoquan He
2026-09-03 11:18 ` [PATCH 07/13] usb: cdns3: " Baoquan He
2026-09-03 11:18 ` [PATCH 08/13] media: staging: imx: " Baoquan He
2026-09-03 11:18 ` [PATCH 09/13] spi: atmel: " Baoquan He
2026-09-03 11:18 ` [PATCH 10/13] media: imx7-media-csi: " Baoquan He
2026-09-04 15:14 ` Frank Li
2026-09-03 11:18 ` [PATCH 11/13] media: nxp: imx8-isi: " Baoquan He
2026-09-04 15:14 ` Frank Li
2026-09-03 11:18 ` [PATCH 12/13] mtd: rawnand: gpmi: " Baoquan He
2026-09-03 11:18 ` [PATCH 13/13] usb: cdns2: " Baoquan He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox