* [PATCH 1/1] net: allwinner: remove dmaengine_desc_free()
@ 2026-09-29 19:06 Frank.Li
2026-09-29 21:29 ` Joe Damato
0 siblings, 1 reply; 2+ messages in thread
From: Frank.Li @ 2026-09-29 19:06 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Bartosz Golaszewski, Andre Przywara, bui duc phuc, Arnd Bergmann,
Kees Cook, Li Youhong, Frank Li, open list:NETWORKING DRIVERS,
moderated list:ARM/Allwinner sunXi SoC support,
open list:ARM/Allwinner sunXi SoC support, open list
Cc: vkoul, imx
From: Frank Li <Frank.Li@nxp.com>
dmaengine_desc_free() is designed for DMA_CTRL_REUSE. If DMA_CTRL_REUSE
is not set, dmaengine_desc_free() will return -EPERM.
if (!dmaengine_desc_test_reuse(desc))
return -EPERM;
So calling dmaengine_desc_free() does nothing.
dmaengine_terminate_(a)sync() will free all already allocated descriptors.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/net/ethernet/allwinner/sun4i-emac.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 0ba67a55705d6..09b2abdfc9e84 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -300,7 +300,7 @@ static int emac_dma_inblk_32bit(struct emac_board_info *db,
if (!req) {
dev_err(db->dev, "alloc emac dma req error.\n");
ret = -ENOMEM;
- goto alloc_req_err;
+ goto prepare_err;
}
desc->callback_param = req;
@@ -319,9 +319,6 @@ static int emac_dma_inblk_32bit(struct emac_board_info *db,
submit_err:
emac_free_dma_req(req);
-alloc_req_err:
- dmaengine_desc_free(desc);
-
prepare_err:
dma_unmap_single(db->dev, rxbuf, count, DMA_FROM_DEVICE);
return ret;
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] net: allwinner: remove dmaengine_desc_free()
2026-09-29 19:06 [PATCH 1/1] net: allwinner: remove dmaengine_desc_free() Frank.Li
@ 2026-09-29 21:29 ` Joe Damato
0 siblings, 0 replies; 2+ messages in thread
From: Joe Damato @ 2026-09-29 21:29 UTC (permalink / raw)
To: Frank.Li
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Bartosz Golaszewski, Andre Przywara, bui duc phuc, Arnd Bergmann,
Kees Cook, Li Youhong, Frank Li, open list:NETWORKING DRIVERS,
moderated list:ARM/Allwinner sunXi SoC support,
open list:ARM/Allwinner sunXi SoC support, open list, vkoul, imx
On Tue, Sep 29, 2026 at 03:06:36PM -0400, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
>
> dmaengine_desc_free() is designed for DMA_CTRL_REUSE. If DMA_CTRL_REUSE
> is not set, dmaengine_desc_free() will return -EPERM.
>
> if (!dmaengine_desc_test_reuse(desc))
> return -EPERM;
>
> So calling dmaengine_desc_free() does nothing.
> dmaengine_terminate_(a)sync() will free all already allocated descriptors.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/net/ethernet/allwinner/sun4i-emac.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-29 21:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 19:06 [PATCH 1/1] net: allwinner: remove dmaengine_desc_free() Frank.Li
2026-09-29 21:29 ` Joe Damato
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®