mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API
@ 2026-09-17 19:08 Frank.Li
  2026-09-17 20:12 ` Dave Jiang
  0 siblings, 1 reply; 2+ messages in thread
From: Frank.Li @ 2026-09-17 19:08 UTC (permalink / raw)
  To: Jon Mason, Dave Jiang, Allen Hubbe, open list:NTB DRIVER CORE, open list
  Cc: imx, vkoul, Frank Li

From: Frank Li <Frank.Li@nxp.com>

DMA engine consumers must not call the channel's device_prep_*() function
pointers directly. Use the standard dmaengine wrapper APIs instead.

Assisted-by: LLM
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/ntb/ntb_transport.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index f9caa1a653c5b..45144abfb7aad 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -1551,9 +1551,9 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
 
 	unmap->from_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, unmap->addr[1],
-					     unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, unmap->addr[1],
+					unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;
 
@@ -1884,8 +1884,8 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
 
 	unmap->to_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;
 
-- 
2.43.0


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

* Re: [PATCH 1/1] NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API
  2026-09-17 19:08 [PATCH 1/1] NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API Frank.Li
@ 2026-09-17 20:12 ` Dave Jiang
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Jiang @ 2026-09-17 20:12 UTC (permalink / raw)
  To: Frank.Li, Jon Mason, Allen Hubbe, open list:NTB DRIVER CORE, open list
  Cc: imx, vkoul, Frank Li



On 9/17/26 12:08 PM, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
> 
> DMA engine consumers must not call the channel's device_prep_*() function
> pointers directly. Use the standard dmaengine wrapper APIs instead.
> 
> Assisted-by: LLM
> Signed-off-by: Frank Li <Frank.Li@nxp.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> ---
>  drivers/ntb/ntb_transport.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index f9caa1a653c5b..45144abfb7aad 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -1551,9 +1551,9 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
>  
>  	unmap->from_cnt = 1;
>  
> -	txd = device->device_prep_dma_memcpy(chan, unmap->addr[1],
> -					     unmap->addr[0], len,
> -					     DMA_PREP_INTERRUPT);
> +	txd = dmaengine_prep_dma_memcpy(chan, unmap->addr[1],
> +					unmap->addr[0], len,
> +					DMA_PREP_INTERRUPT);
>  	if (!txd)
>  		goto err_get_unmap;
>  
> @@ -1884,8 +1884,8 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
>  
>  	unmap->to_cnt = 1;
>  
> -	txd = device->device_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
> -					     DMA_PREP_INTERRUPT);
> +	txd = dmaengine_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
> +					DMA_PREP_INTERRUPT);
>  	if (!txd)
>  		goto err_get_unmap;
>  


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

end of thread, other threads:[~2026-09-17 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 19:08 [PATCH 1/1] NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API Frank.Li
2026-09-17 20:12 ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®