aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
authorMark Brown <broonie@kernel.org>2026-05-29 18:08:27 +0100
committerMark Brown <broonie@kernel.org>2026-05-29 18:08:27 +0100
commit3cef3d7cc0a113865d1b339f27317ad42e26a0b6 (patch)
tree5398de851a08c8510364bbe626d6567036a4f746 /drivers
parentee41400babf28df3fef8d6fb459cbd18349dd17c (diff)
parentd5cae2261b86913e602452ce4a07e6aefc0f603b (diff)
downloadlinux-next-history-3cef3d7cc0a113865d1b339f27317ad42e26a0b6.tar.gz
Merge branch 'dma-mapping-for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mszyprowski/linux.git
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ntb/ntb_transport.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 7cabc82305d6b..f59f926d4bfaa 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -223,6 +223,7 @@ struct ntb_transport_mw {
void *alloc_addr;
void *virt_addr;
dma_addr_t dma_addr;
+ dma_addr_t original_dma_addr;
};
struct ntb_transport_client_dev {
@@ -765,8 +766,8 @@ static void ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw)
return;
ntb_mw_clear_trans(nt->ndev, PIDX, num_mw);
- dma_free_coherent(dma_dev, mw->alloc_size,
- mw->alloc_addr, mw->dma_addr);
+ dma_free_attrs(dma_dev, mw->alloc_size, mw->alloc_addr,
+ mw->original_dma_addr, DMA_ATTR_FORCE_CONTIGUOUS);
mw->xlat_size = 0;
mw->buff_size = 0;
mw->alloc_size = 0;
@@ -802,6 +803,7 @@ static int ntb_alloc_mw_buffer(struct ntb_transport_mw *mw,
return -ENOMEM;
}
virt_addr = alloc_addr;
+ mw->original_dma_addr = dma_addr;
/*
* we must ensure that the memory address allocated is BAR size
@@ -826,8 +828,8 @@ static int ntb_alloc_mw_buffer(struct ntb_transport_mw *mw,
return 0;
err:
- dma_free_coherent(ntb_dev, mw->alloc_size, alloc_addr, dma_addr);
-
+ dma_free_attrs(ntb_dev, mw->alloc_size, alloc_addr, dma_addr,
+ DMA_ATTR_FORCE_CONTIGUOUS);
return rc;
}