diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2011-11-29 02:26:50 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2011-12-04 22:06:01 -0500 |
commit | 8f0d30f9ee333f4fb3458a9a33f7ead5269ea8f3 (patch) | |
tree | 5c9b1212de19598d7e2653491cc5decc4df596d6 /drivers/dma/amba-pl08x.c | |
parent | c94e910535be72f0c6ac0c69e6acd8d44414e80d (diff) |
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: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/amba-pl08x.c')
-rw-r--r-- | 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 41c62fd0680d..9ebceca17530 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, | |||
854 | int ret; | 854 | int ret; |
855 | 855 | ||
856 | /* Check if we already have a channel */ | 856 | /* Check if we already have a channel */ |
857 | if (plchan->phychan) | 857 | if (plchan->phychan) { |
858 | return 0; | 858 | ch = plchan->phychan; |
859 | goto got_channel; | ||
860 | } | ||
859 | 861 | ||
860 | ch = pl08x_get_phy_channel(pl08x, plchan); | 862 | ch = pl08x_get_phy_channel(pl08x, plchan); |
861 | if (!ch) { | 863 | if (!ch) { |
@@ -880,21 +882,22 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan, | |||
880 | return -EBUSY; | 882 | return -EBUSY; |
881 | } | 883 | } |
882 | ch->signal = ret; | 884 | ch->signal = ret; |
883 | |||
884 | /* Assign the flow control signal to this channel */ | ||
885 | if (txd->direction == DMA_MEM_TO_DEV) | ||
886 | txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT; | ||
887 | else if (txd->direction == DMA_DEV_TO_MEM) | ||
888 | txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT; | ||
889 | } | 885 | } |
890 | 886 | ||
887 | plchan->phychan = ch; | ||
891 | dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n", | 888 | dev_dbg(&pl08x->adev->dev, "allocated physical channel %d and signal %d for xfer on %s\n", |
892 | ch->id, | 889 | ch->id, |
893 | ch->signal, | 890 | ch->signal, |
894 | plchan->name); | 891 | plchan->name); |
895 | 892 | ||
893 | got_channel: | ||
894 | /* Assign the flow control signal to this channel */ | ||
895 | if (txd->direction == DMA_MEM_TO_DEV) | ||
896 | txd->ccfg |= ch->signal << PL080_CONFIG_DST_SEL_SHIFT; | ||
897 | else if (txd->direction == DMA_DEV_TO_MEM) | ||
898 | txd->ccfg |= ch->signal << PL080_CONFIG_SRC_SEL_SHIFT; | ||
899 | |||
896 | plchan->phychan_hold++; | 900 | plchan->phychan_hold++; |
897 | plchan->phychan = ch; | ||
898 | 901 | ||
899 | return 0; | 902 | return 0; |
900 | } | 903 | } |