mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true
@ 2011-11-29  7:26 Viresh Kumar
  2011-11-29  8:41 ` Linus Walleij
  2011-12-05  3:07 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Viresh Kumar @ 2011-11-29  7:26 UTC (permalink / raw)
  To: linus.walleij
  Cc: vinod.koul, dan.j.williams, linux-kernel, linux-arm-kernel,
	linux, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	viresh.kumar, pratyush.anand, bhupesh.sharma, viresh.linux,
	bhavna.yadav, vincenzo.frascino, mirko.gardi

Currently, if plchan->phychan is true, we return immediately from
prep_phy_chan(). We must configure txd->ccfg and increment phychan_hold before
returning. Otherwise, request line number wouldn't be configured in this txd.

Reported-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/dma/amba-pl08x.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 41c62fd..9ebceca 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -854,8 +854,10 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
 	int ret;
 
 	/* Check if we already have a channel */
-	if (plchan->phychan)
-		return 0;
+	if (plchan->phychan) {
+		ch = plchan->phychan;
+		goto got_channel;
+	}
 
 	ch = pl08x_get_phy_channel(pl08x, plchan);
 	if (!ch) {
@@ -880,21 +882,22 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
 			return -EBUSY;
 		}
 		ch->signal = ret;
-
-		/* Assign the flow control signal to this channel */
-		if (txd->direction == DMA_MEM_TO_DEV)
-			txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
-		else if (txd->direction == DMA_DEV_TO_MEM)
-			txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
 	}
 
+	plchan->phychan = ch;
 	dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n",
 		 ch->id,
 		 ch->signal,
 		 plchan->name);
 
+got_channel:
+	/* Assign the flow control signal to this channel */
+	if (txd->direction == DMA_MEM_TO_DEV)
+		txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT;
+	else if (txd->direction == DMA_DEV_TO_MEM)
+		txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT;
+
 	plchan->phychan_hold++;
-	plchan->phychan = ch;
 
 	return 0;
 }
-- 
1.7.2.2


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

* Re: [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true
  2011-11-29  7:26 [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true Viresh Kumar
@ 2011-11-29  8:41 ` Linus Walleij
  2011-12-05  3:07 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-11-29  8:41 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: vinod.koul, dan.j.williams, linux-kernel, linux-arm-kernel,
	linux, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	pratyush.anand, bhupesh.sharma, viresh.linux, bhavna.yadav,
	vincenzo.frascino, mirko.gardi

On Tue, Nov 29, 2011 at 8:26 AM, Viresh Kumar <viresh.kumar@st.com> wrote:

> Currently, if plchan->phychan is true, we return immediately from
> prep_phy_chan(). We must configure txd->ccfg and increment phychan_hold before
> returning. Otherwise, request line number wouldn't be configured in this txd.
>
> Reported-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij

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

* Re: [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true
  2011-11-29  7:26 [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true Viresh Kumar
  2011-11-29  8:41 ` Linus Walleij
@ 2011-12-05  3:07 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2011-12-05  3:07 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linus.walleij, dan.j.williams, linux-kernel, linux-arm-kernel,
	linux, armando.visconti, shiraz.hashim, vipin.kumar,
	rajeev-dlh.kumar, deepak.sikri, vipulkumar.samar, amit.virdi,
	pratyush.anand, bhupesh.sharma, viresh.linux, bhavna.yadav,
	vincenzo.frascino, mirko.gardi

On Tue, 2011-11-29 at 12:56 +0530, Viresh Kumar wrote:
> Currently, if plchan->phychan is true, we return immediately from
> prep_phy_chan(). We must configure txd->ccfg and increment phychan_hold before
> returning. Otherwise, request line number wouldn't be configured in this txd.
> 
> Reported-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>

Applied, Thanks

-- 
~Vinod


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

end of thread, other threads:[~2011-12-05  3:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-29  7:26 [PATCH] dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true Viresh Kumar
2011-11-29  8:41 ` Linus Walleij
2011-12-05  3:07 ` Vinod Koul

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®