Skip to contentSkip to conversation

dma: rcar-dma: Fixed active descriptor initializing

PATCH Laurent Pinchart 1 participant 1 message Oct 16, 2015 SuperH

lore
Share & tools
lore
#0 lore raw

Hello Hamza,

Thank you for the patch.

Quoted 15 lines · On Tuesday 29 September 2015 22:44:48 [email protected] wrote:

From: Muhammad Hamza Farooq <[email protected]>

Running descriptor pointer is set to NULL upon freeing resources. Other- wise, rcar_dmac_issue_pending might not start new transfers

---
 drivers/dma/sh/rcar-dmac.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/sh/rcar-dmac.c +0 -0
index 6eec878..db97f7b 100644

drivers/dma/sh/rcar-dmac.c static void rcar_dmac_free_chan_resources(struct · line 1045

Quoted 4 lines
drivers/dma/sh/rcar-dmac.c +1 -0
@@ -1042,6 +1042,7 @@ static void rcar_dmac_free_chan_resources(struct
 dma_chan *chan) list_splice_init(&rchan->desc.active, &list);
 	list_splice_init(&rchan->desc.done, &list);
 	list_splice_init(&rchan->desc.wait, &list);
+	rchan->desc.running = NULL;

This looks good to me, but I wonder if it would make sense to replace the list_splice_init() calls with a call to rcar_dmac_chan_reinit() which sets desc.running to NULL, and then just process the free list below. Any opinion ?

In the meantime I'll apply your patch to my tree as it's clearly a bug fix and will send a pull request.

Quoted 2 lines
drivers/dma/sh/rcar-dmac.c +0 -0
 	list_for_each_entry(desc, &list, node)
 		rcar_dmac_realloc_hwdesc(rchan, desc, 0);
Signature · 3 lines
Regards,

Laurent Pinchart