Skip to contentSkip to conversation

ARM: mxs-dma: reset after disable channel

PATCH New Dong Aisheng 5 participants 8 messages Jul 19, 2011 – Jul 25, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

We met some channels in abnormal state after disable. Reset it to get a clean state.

---
 drivers/dma/mxs-dma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/dma/mxs-dma.c +1 -0
index 88aad4f..5a24010 100644
@@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		mxs_dma_disable_chan(mxs_chan);
+		mxs_dma_reset_chan(mxs_chan);
 		break;
 	case DMA_PAUSE:
 		mxs_dma_pause_chan(mxs_chan);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

Quoted 7 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Hi Vinod,

Please consider to merge it for v3.1. The mxs audio driver needs the fix.

Regards,
Shawn

Quoted 25 lines
 drivers/dma/mxs-dma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/dma/mxs-dma.c +1 -0
index 88aad4f..5a24010 100644
@@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		mxs_dma_disable_chan(mxs_chan);
+		mxs_dma_reset_chan(mxs_chan);
 		break;
 	case DMA_PAUSE:
 		mxs_dma_pause_chan(mxs_chan);
Signature · 8 lines
1.7.0.4



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

Quoted 10 lines · Shawn Guo
Quoted 7 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Just to make sure: Did you investigate where the "abnormal" state came from and if that could be fixed?

Regards,

Wolfram

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110719/f22834db/attachment.sig>
#3 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

Quoted 10 lines · Wolfram Sang
Quoted 9 lines · Shawn Guo
Quoted 7 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Quoted 5 lines
Quoted 1 line

Just to make sure: Did you investigate where the "abnormal" state came from and if that could be fixed?

I suppose this is a question for Aisheng, as he is the one who actually saw the "abnormal" state. But since mxs_dma_disable_chan() is being called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should be pretty safe reset the channel here.

Signature · 2 lines
Regards,
Shawn
#4 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

Quoted 11 lines · Shawn Guo
Quoted 10 lines · Wolfram Sang
Quoted 9 lines · Shawn Guo
Quoted 7 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Just to make sure: Did you investigate where the "abnormal" state came from and if that could be fixed?

I suppose this is a question for Aisheng, as he is the one who actually saw the "abnormal" state.

OK.

Quoted 3 lines

But since mxs_dma_disable_chan() is being
called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should be pretty safe reset the channel here.

It might be safe but can still hide the real bug ;)

Signature · 9 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110719/601fe800/attachment.sig>
#5 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

In reply to Shawn Guo
Quoted 23 lines

-----Original Message-----
From: Guo Shawn-R65073
Sent: Tuesday, July 19, 2011 4:46 PM
To: Wolfram Sang
Cc: Dong Aisheng-B29396; vinod.koul at intel.com; shawn.guo at linaro.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 1/1] ARM: mxs-dma: reset after disable channel

Quoted 12 lines · Wolfram Sang
Quoted 10 lines · Shawn Guo
Quoted 7 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Quoted 7 lines
Quoted 3 lines

Just to make sure: Did you investigate where the "abnormal" state came from and if that could be fixed?

I suppose this is a question for Aisheng, as he is the one who actually saw the "abnormal" state. But since mxs_dma_disable_chan() is being called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should be pretty safe reset the channel here.

It looked like the dma was not stopped properly, it maybe still running. So the next time we allocated DMA chan, a dma interrupt would be generated Before channel was starting.

I may check if we can find the root cause.

Regards
Dong Aisheng

#6 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

In reply to Shawn Guo
Quoted 8 lines · Shawn Guo
Quoted 7 lines

We met some channels in abnormal state after disable. Reset it to get a clean state.

---

Quoted 6 lines

Hi Vinod,

Please consider to merge it for v3.1. The mxs audio driver needs the fix.

This looks good to me, in my queue now.
I am travelling back home tomorrow, so you should see this get pushed in my tree latest by weekend

~Vinod

Quoted 30 lines

Regards,
Shawn

drivers/dma/mxs-dma.c static int mxs_dma_control(struct dma_chan *chan, enum

Quoted 8 lines
 drivers/dma/mxs-dma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/dma/mxs-dma.c +0 -0
index 88aad4f..5a24010 100644
@@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum

dma_ctrl_cmd cmd,

Quoted 17 lines
drivers/dma/mxs-dma.c +1 -1
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		mxs_dma_disable_chan(mxs_chan);
+		mxs_dma_reset_chan(mxs_chan);
 		break;
 	case DMA_PAUSE:
 		mxs_dma_pause_chan(mxs_chan);
--

1.7.0.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Applied
#7 lore raw

PATCH 1/1 ARM: mxs-dma: reset after disable channel

In reply to Dong Aisheng
Quoted 15 lines · Dong Aisheng

We met some channels in abnormal state after disable. Reset it to get a clean state.

---
 drivers/dma/mxs-dma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/dma/mxs-dma.c +0 -0
index 88aad4f..5a24010 100644

drivers/dma/mxs-dma.c static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, · line 541

Quoted 7 lines
drivers/dma/mxs-dma.c +1 -0
@@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		mxs_dma_disable_chan(mxs_chan);
+		mxs_dma_reset_chan(mxs_chan);
 		break;
 	case DMA_PAUSE:
 		mxs_dma_pause_chan(mxs_chan);

Applied, Thanks

Signature · 2 lines
~Vinod Koul
Intel Corp.