Skip to contentSkip to conversation

dmaengine: pl08x: fix conversioin for generic unmap data

PATCH In review Olof Johansson 3 participants 7 messages Nov 27, 2013 – Nov 28, 2013 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: pl08x: fix conversioin for generic unmap data

commit d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data') added a generic unmap call but used the wrong argument for it. Fix it.

Fixes d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data')

---

I can't actually tell what the intent of d38a8cc622a1b and how mappings are expected to be managed, but it's obviously passing the wrong thing in here so it seems like the appropriate fix.

 drivers/dma/amba-pl08x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/amba-pl08x.c +1 -1
index 16a2aa28f856..ec4ee5c1fe9d 100644
@@ -1169,7 +1169,7 @@ static void pl08x_desc_free(struct virt_dma_desc *vd)
 	struct pl08x_txd *txd = to_pl08x_txd(&vd->tx);
 	struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan);
 
-	dma_descriptor_unmap(txd);
+	dma_descriptor_unmap(&vd->tx);
 	if (!txd->done)
 		pl08x_release_mux(plchan);
 
Signature · 1 line
1.8.4.1.601.g02b3b1d
#1 lore raw

Thanks, Olof I'll push this shortly. I'll add your acked-by to this one from Russell.

https://patchwork.kernel.org/patch/3241941/

--
Dan

Quoted 30 lines · Olof Johansson

commit d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data') added a generic unmap call but used the wrong argument for it. Fix it.

Fixes d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data')

---

I can't actually tell what the intent of d38a8cc622a1b and how mappings are expected to be managed, but it's obviously passing the wrong thing in here so it seems like the appropriate fix.

 drivers/dma/amba-pl08x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/amba-pl08x.c +1 -2
index 16a2aa28f856..ec4ee5c1fe9d 100644
@@ -1169,7 +1169,7 @@ static void pl08x_desc_free(struct virt_dma_desc *vd)
        struct pl08x_txd *txd = to_pl08x_txd(&vd->tx);
        struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan);
 
-       dma_descriptor_unmap(txd);
+       dma_descriptor_unmap(&vd->tx);
        if (!txd->done)
                pl08x_release_mux(plchan);
 
--

1.8.4.1.601.g02b3b1d

#2 lore raw
Quoted 4 lines · Dan Williams

Thanks, Olof I'll push this shortly. I'll add your acked-by to this one from Russell.

https://patchwork.kernel.org/patch/3241941/

Sure, sounds good. I've posted a couple more as well (the at_hdmac one I posted yesterday) and "[PATCH] dma: mv_xor: remove mv_desc_get_dest_addr()" from Jason Cooper.

-Olof

#3 lore raw
Quoted 10 lines · Olof Johansson
Quoted 4 lines · Dan Williams

Thanks, Olof I'll push this shortly. I'll add your acked-by to this one from Russell.

https://patchwork.kernel.org/patch/3241941/

Sure, sounds good. I've posted a couple more as well (the at_hdmac one I posted yesterday) and "[PATCH] dma: mv_xor: remove mv_desc_get_dest_addr()" from Jason Cooper.

Yup, those are in the patchwork queue, just waiting on my test build to tell me there aren't any others.

#4 lore raw
In reply to Olof Johansson
Quoted 11 lines · Olof Johansson

commit d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data') added a generic unmap call but used the wrong argument for it. Fix it.

Fixes d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data')

---

I can't actually tell what the intent of d38a8cc622a1b and how mappings are expected to be managed, but it's obviously passing the wrong thing in here so it seems like the appropriate fix.

For most dma-slave usage cases the client is explicitly handling the lifetime of the dma mappings. It's primarily the mem-to-mem usage cases that rely on the dma driver to do the unmapping when the transaction is complete. dma_descriptor_unmap() is a common implementation rather than requiring each driver to implement it uniquely. Longer term we can require all clients to handle their mapping lifetimes and remove the responsibility from the individual drivers completely.

#5 lore raw
Quoted 13 lines · Dan Williams
Quoted 11 lines · Olof Johansson

commit d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data') added a generic unmap call but used the wrong argument for it. Fix it.

Fixes d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data')

---

I can't actually tell what the intent of d38a8cc622a1b and how mappings are expected to be managed, but it's obviously passing the wrong thing in here so it seems like the appropriate fix.

Quoted 8 lines

For most dma-slave usage cases the client is explicitly handling the lifetime of the dma mappings. It's primarily the mem-to-mem usage cases that rely on the dma driver to do the unmapping when the transaction is complete. dma_descriptor_unmap() is a common implementation rather than requiring each driver to implement it uniquely. Longer term we can require all clients to handle their mapping lifetimes and remove the responsibility from the individual drivers completely.

I think that would make sense and also remove any abuiguity on who does the mapping in different usages..

~Vinod

Acked-by on v1 1/1
#6 lore raw
In reply to Olof Johansson
Quoted 5 lines · Olof Johansson

commit d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data') added a generic unmap call but used the wrong argument for it. Fix it.

Fixes d38a8c622a1b ('dmaengine: prepare for generic 'unmap' data')
Quoted 25 lines

---

I can't actually tell what the intent of d38a8cc622a1b and how mappings are expected to be managed, but it's obviously passing the wrong thing in here so it seems like the appropriate fix.

 drivers/dma/amba-pl08x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/amba-pl08x.c +1 -1
index 16a2aa28f856..ec4ee5c1fe9d 100644
@@ -1169,7 +1169,7 @@ static void pl08x_desc_free(struct virt_dma_desc *vd)
 	struct pl08x_txd *txd = to_pl08x_txd(&vd->tx);
 	struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan);
 
-	dma_descriptor_unmap(txd);
+	dma_descriptor_unmap(&vd->tx);
 	if (!txd->done)
 		pl08x_release_mux(plchan);
 
Signature · 1 line
1.8.4.1.601.g02b3b1d