[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250403163535.2494-1-vulab@iscas.ac.cn>
Date: Fri, 4 Apr 2025 00:35:35 +0800
From: Wentao Liang <vulab@...as.ac.cn>
To: abbotti@....co.uk,
hsweeten@...ionengravers.com
Cc: linux-kernel@...r.kernel.org,
Wentao Liang <vulab@...as.ac.cn>
Subject: [PATCH] Staging: comedi: Add DMA preparation before mite_dma_arm().
The ni_tio_input_inttrig() calls mite_dma_arm() without calling
mite_prep_dma() first. A proper implementation can be found in
ni_cdo_inttrig() in ni_mio_common.c.
Add mite_prep_dma() before mite_dma_arm().
Fixes: cb7859a90af1 ("Staging: comedi: add National Instruments infrastructure")
Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
---
drivers/comedi/drivers/ni_tiocmd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/comedi/drivers/ni_tiocmd.c b/drivers/comedi/drivers/ni_tiocmd.c
index ab6d9e8269f3..b943836ccf1a 100644
--- a/drivers/comedi/drivers/ni_tiocmd.c
+++ b/drivers/comedi/drivers/ni_tiocmd.c
@@ -84,9 +84,10 @@ static int ni_tio_input_inttrig(struct comedi_device *dev,
return -EINVAL;
spin_lock_irqsave(&counter->lock, flags);
- if (counter->mite_chan)
+ if (counter->mite_chan) {
+ mite_prep_dma(counter->mite_chan, 32, 32);
mite_dma_arm(counter->mite_chan);
- else
+ } else
ret = -EIO;
spin_unlock_irqrestore(&counter->lock, flags);
if (ret < 0)
--
2.42.0.windows.2
Powered by blists - more mailing lists