* [PATCH] dmaengine/dmatest: Terminate transfers on all channels in case of error or exit
@ 2011-07-29 10:51 Viresh Kumar
2011-08-08 14:07 ` Koul, Vinod
0 siblings, 1 reply; 2+ messages in thread
From: Viresh Kumar @ 2011-07-29 10:51 UTC (permalink / raw)
To: vinod.koul, dan.j.williams
Cc: linux-kernel, armando.visconti, shiraz.hashim, vipin.kumar,
rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux
In case, some error occurs while doing memcpy transfers, we must terminate all
transfers physically too. This is achieved by calling device_control() routine
with TERMINATE_ALL as parameter.
This is also required to be done in case module is removed while we are in
middle of some transfers.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
drivers/dma/dmatest.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index b4f5c32..cd8ae03 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -476,6 +476,8 @@ err_srcs:
pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
thread_name, total_tests, failed_tests, ret);
+ /* terminate all transfers on specified channels */
+ chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
if (iterations > 0)
while (!kthread_should_stop()) {
DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
@@ -498,6 +500,10 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
list_del(&thread->node);
kfree(thread);
}
+
+ /* terminate all transfers on specified channels */
+ dtc->chan->device->device_control(dtc->chan, DMA_TERMINATE_ALL, 0);
+
kfree(dtc);
}
--
1.7.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine/dmatest: Terminate transfers on all channels in case of error or exit
2011-07-29 10:51 [PATCH] dmaengine/dmatest: Terminate transfers on all channels in case of error or exit Viresh Kumar
@ 2011-08-08 14:07 ` Koul, Vinod
0 siblings, 0 replies; 2+ messages in thread
From: Koul, Vinod @ 2011-08-08 14:07 UTC (permalink / raw)
To: Viresh Kumar
Cc: dan.j.williams, linux-kernel, armando.visconti, shiraz.hashim,
vipin.kumar, rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar,
amit.virdi, pratyush.anand, bhupesh.sharma, viresh.linux
On Fri, 2011-07-29 at 16:21 +0530, Viresh Kumar wrote:
> In case, some error occurs while doing memcpy transfers, we must terminate all
> transfers physically too. This is achieved by calling device_control() routine
> with TERMINATE_ALL as parameter.
>
> This is also required to be done in case module is removed while we are in
> middle of some transfers.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Applied, thanks
> ---
> drivers/dma/dmatest.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
> index b4f5c32..cd8ae03 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -476,6 +476,8 @@ err_srcs:
> pr_notice("%s: terminating after %u tests, %u failures (status %d)\n",
> thread_name, total_tests, failed_tests, ret);
>
> + /* terminate all transfers on specified channels */
> + chan->device->device_control(chan, DMA_TERMINATE_ALL, 0);
> if (iterations > 0)
> while (!kthread_should_stop()) {
> DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait_dmatest_exit);
> @@ -498,6 +500,10 @@ static void dmatest_cleanup_channel(struct dmatest_chan *dtc)
> list_del(&thread->node);
> kfree(thread);
> }
> +
> + /* terminate all transfers on specified channels */
> + dtc->chan->device->device_control(dtc->chan, DMA_TERMINATE_ALL, 0);
> +
> kfree(dtc);
> }
>
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-08 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-29 10:51 [PATCH] dmaengine/dmatest: Terminate transfers on all channels in case of error or exit Viresh Kumar
2011-08-08 14:07 ` Koul, Vinod
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).