linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: ethernet: sun4i-emac: free dma desc
@ 2025-08-30  7:49 Conley Lee
  2025-09-02 22:57 ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Conley Lee @ 2025-08-30  7:49 UTC (permalink / raw)
  To: kuba, davem, wens, mripard
  Cc: netdev, linux-arm-kernel, linux-kernel, Conley Lee

In the current implementation of the sun4i-emac driver,when using DMA to receive data packets,
the descriptor for the current DMA request is not released in the rx_done_callback.
This patch fixes this bug.

Signed-off-by: Conley Lee <conleylee@foxmail.com>
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 2f516b950..2f990d0a5 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -237,6 +237,7 @@ emac_alloc_dma_req(struct emac_board_info *db,
 
 static void emac_free_dma_req(struct emac_dma_req *req)
 {
+	dmaengine_desc_free(req->desc);
 	kfree(req);
 }
 
-- 
2.25.1


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

* Re: [PATCH 1/2] net: ethernet: sun4i-emac: free dma desc
  2025-08-30  7:49 [PATCH 1/2] net: ethernet: sun4i-emac: free dma desc Conley Lee
@ 2025-09-02 22:57 ` Jakub Kicinski
  2025-09-03  7:49   ` [PATCH] net: ethernet: sun4i-emac: free dma descriptor Conley Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2025-09-02 22:57 UTC (permalink / raw)
  To: Conley Lee; +Cc: davem, wens, mripard, netdev, linux-arm-kernel, linux-kernel

On Sat, 30 Aug 2025 15:49:46 +0800 Conley Lee wrote:
> In the current implementation of the sun4i-emac driver,when using DMA to receive data packets,
> the descriptor for the current DMA request is not released in the rx_done_callback.

Please wrap the description at 74 columns.

> This patch fixes this bug.

Please use imperative mood, "Fix this." or even better rewrite the
whole commit msg to be imperative.

Since this is a fix please add a Fixes tag.

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

* [PATCH] net: ethernet: sun4i-emac: free dma descriptor
  2025-09-02 22:57 ` Jakub Kicinski
@ 2025-09-03  7:49   ` Conley Lee
  2025-09-04 14:24     ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Conley Lee @ 2025-09-03  7:49 UTC (permalink / raw)
  To: kuba, davem, wens, mripard
  Cc: netdev, linux-arm-kernel, linux-kernel, Conley Lee

In the current implementation of the sun4i-emac driver, when using DMA to
receive data packets, the descriptor for the current DMA request is not
released in the rx_done_callback.

Fix this by properly releasing the descriptor.

Fixes: 47869e82c8b8 ("sun4i-emac.c: add dma support")
Signed-off-by: Conley Lee <conleylee@foxmail.com>
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 2f516b950..2f990d0a5 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -237,6 +237,7 @@ emac_alloc_dma_req(struct emac_board_info *db,
 
 static void emac_free_dma_req(struct emac_dma_req *req)
 {
+	dmaengine_desc_free(req->desc);
 	kfree(req);
 }
 
-- 
2.25.1


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

* Re: [PATCH] net: ethernet: sun4i-emac: free dma descriptor
  2025-09-03  7:49   ` [PATCH] net: ethernet: sun4i-emac: free dma descriptor Conley Lee
@ 2025-09-04 14:24     ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2025-09-04 14:24 UTC (permalink / raw)
  To: Conley Lee; +Cc: davem, wens, mripard, netdev, linux-arm-kernel, linux-kernel

On Wed,  3 Sep 2025 15:49:39 +0800 Conley Lee wrote:
> In the current implementation of the sun4i-emac driver, when using DMA to
> receive data packets, the descriptor for the current DMA request is not
> released in the rx_done_callback.
> 
> Fix this by properly releasing the descriptor.

Reading the docs, it appears that the need to free the desc is tied to
setting descriptor reuse flag. Which this driver does not do. So I'm
unclear why this is needed, maybe the dma engine driver is doing
something strange?

Could you repost this, CC the dmaengine ML, Vinod and the appropriate
SoC maintainers?

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

end of thread, other threads:[~2025-09-04 14:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-30  7:49 [PATCH 1/2] net: ethernet: sun4i-emac: free dma desc Conley Lee
2025-09-02 22:57 ` Jakub Kicinski
2025-09-03  7:49   ` [PATCH] net: ethernet: sun4i-emac: free dma descriptor Conley Lee
2025-09-04 14:24     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).