提交 8f0d30f9 编写于 作者: V Viresh Kumar 提交者: Vinod Koul

dmaengine/amba-pl08x: Config ccfg and increment phychan_hold if phychan is true

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: NRajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: NViresh Kumar <viresh.kumar@st.com>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
上级 c94e9105
...@@ -854,8 +854,10 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan, ...@@ -854,8 +854,10 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
int ret; int ret;
/* Check if we already have a channel */ /* Check if we already have a channel */
if (plchan->phychan) if (plchan->phychan) {
return 0; ch = plchan->phychan;
goto got_channel;
}
ch = pl08x_get_phy_channel(pl08x, plchan); ch = pl08x_get_phy_channel(pl08x, plchan);
if (!ch) { if (!ch) {
...@@ -880,21 +882,22 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan, ...@@ -880,21 +882,22 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan,
return -EBUSY; return -EBUSY;
} }
ch->signal = ret; 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", dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n",
ch->id, ch->id,
ch->signal, ch->signal,
plchan->name); 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_hold++;
plchan->phychan = ch;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册