Skip to content

Commit d38a8c6

Browse files
committed
dmaengine: prepare for generic 'unmap' data
Add a hook for a common dma unmap implementation to enable removal of the per driver custom unmap code. (A reworked version of Bartlomiej Zolnierkiewicz's patches to remove the custom callbacks and the size increase of dma_async_tx_descriptor for drivers that don't care about raid). Cc: Vinod Koul <vinod.koul@intel.com> Cc: Tomasz Figa <t.figa@samsung.com> Cc: Dave Jiang <dave.jiang@intel.com> [bzolnier: prepare pl330 driver for adding missing unmap while at it] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 56ea27f commit d38a8c6

File tree

15 files changed

+41
-0
lines changed

15 files changed

+41
-0
lines changed

drivers/dma/amba-pl08x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,7 @@ static void pl08x_desc_free(struct virt_dma_desc *vd)
11971197
struct pl08x_txd *txd = to_pl08x_txd(&vd->tx);
11981198
struct pl08x_dma_chan *plchan = to_pl08x_chan(vd->tx.chan);
11991199

1200+
dma_descriptor_unmap(txd);
12001201
if (!plchan->slave)
12011202
pl08x_unmap_buffers(txd);
12021203

drivers/dma/at_hdmac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc)
345345
list_move(&desc->desc_node, &atchan->free_list);
346346

347347
/* unmap dma addresses (not on slave channels) */
348+
dma_descriptor_unmap(txd);
348349
if (!atchan->chan_common.private) {
349350
struct device *parent = chan2parent(&atchan->chan_common);
350351
if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {

drivers/dma/dw/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc,
311311
list_splice_init(&desc->tx_list, &dwc->free_list);
312312
list_move(&desc->desc_node, &dwc->free_list);
313313

314+
dma_descriptor_unmap(txd);
314315
if (!is_slave_direction(dwc->direction)) {
315316
struct device *parent = chan2parent(&dwc->chan);
316317
if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {

drivers/dma/ep93xx_dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ static void ep93xx_dma_tasklet(unsigned long data)
791791
* For the memcpy channels the API requires us to unmap the
792792
* buffers unless requested otherwise.
793793
*/
794+
dma_descriptor_unmap(&desc->txd);
794795
if (!edmac->chan.private)
795796
ep93xx_dma_unmap_buffers(desc);
796797

drivers/dma/fsldma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ static void fsldma_cleanup_descriptor(struct fsldma_chan *chan,
868868
/* Run any dependencies */
869869
dma_run_dependencies(txd);
870870

871+
dma_descriptor_unmap(txd);
871872
/* Unmap the dst buffer, if requested */
872873
if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
873874
if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE)

drivers/dma/ioat/dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ static void __cleanup(struct ioat_dma_chan *ioat, dma_addr_t phys_complete)
602602
dump_desc_dbg(ioat, desc);
603603
if (tx->cookie) {
604604
dma_cookie_complete(tx);
605+
dma_descriptor_unmap(tx);
605606
ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
606607
ioat->active -= desc->hw->tx_cnt;
607608
if (tx->callback) {

drivers/dma/ioat/dma_v2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
148148
tx = &desc->txd;
149149
dump_desc_dbg(ioat, desc);
150150
if (tx->cookie) {
151+
dma_descriptor_unmap(tx);
151152
ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
152153
dma_cookie_complete(tx);
153154
if (tx->callback) {

drivers/dma/ioat/dma_v3.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete)
577577
tx = &desc->txd;
578578
if (tx->cookie) {
579579
dma_cookie_complete(tx);
580+
dma_descriptor_unmap(tx);
580581
ioat3_dma_unmap(ioat, desc, idx + i);
581582
if (tx->callback) {
582583
tx->callback(tx->callback_param);

drivers/dma/iop-adma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ iop_adma_run_tx_complete_actions(struct iop_adma_desc_slot *desc,
152152
if (tx->callback)
153153
tx->callback(tx->callback_param);
154154

155+
dma_descriptor_unmap(tx);
155156
/* unmap dma addresses
156157
* (unmap_single vs unmap_page?)
157158
*/

drivers/dma/mv_xor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ mv_xor_run_tx_complete_actions(struct mv_xor_desc_slot *desc,
278278
desc->async_tx.callback(
279279
desc->async_tx.callback_param);
280280

281+
dma_descriptor_unmap(&desc->async_tx);
281282
/* unmap dma addresses
282283
* (unmap_single vs unmap_page?)
283284
*/

0 commit comments

Comments
 (0)