* [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error
@ 2014-07-01 8:41 Jingchang Lu
2014-07-02 14:13 ` Stefan Agner
2014-07-25 8:42 ` Vinod Koul
0 siblings, 2 replies; 3+ messages in thread
From: Jingchang Lu @ 2014-07-01 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
---
drivers/dma/fsl-edma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
index b396a7f..24ab3d3 100644
--- a/drivers/dma/fsl-edma.c
+++ b/drivers/dma/fsl-edma.c
@@ -248,11 +248,12 @@ static void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
unsigned int slot, bool enable)
{
u32 ch = fsl_chan->vchan.chan.chan_id;
- void __iomem *muxaddr = fsl_chan->edma->muxbase[ch / DMAMUX_NR];
+ void __iomem *muxaddr;
unsigned chans_per_mux, ch_off;
chans_per_mux = fsl_chan->edma->n_chans / DMAMUX_NR;
ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux;
+ muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
if (enable)
edma_writeb(fsl_chan->edma,
@@ -724,6 +725,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
{
struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data;
struct dma_chan *chan, *_chan;
+ unsigned long chans_per_mux = fsl_edma->n_chans / DMAMUX_NR;
if (dma_spec->args_count != 2)
return NULL;
@@ -732,7 +734,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, device_node) {
if (chan->client_count)
continue;
- if ((chan->chan_id / DMAMUX_NR) == dma_spec->args[0]) {
+ if ((chan->chan_id / chans_per_mux) == dma_spec->args[0]) {
chan = dma_get_slave_channel(chan);
if (chan) {
chan->device->privatecnt++;
--
1.8.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error
2014-07-01 8:41 [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error Jingchang Lu
@ 2014-07-02 14:13 ` Stefan Agner
2014-07-25 8:42 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Agner @ 2014-07-02 14:13 UTC (permalink / raw)
To: linux-arm-kernel
Am 2014-07-01 10:41, schrieb Jingchang Lu:
> u32 ch = fsl_chan->vchan.chan.chan_id;
> - void __iomem *muxaddr = fsl_chan->edma->muxbase[ch / DMAMUX_NR];
> + void __iomem *muxaddr;
> unsigned chans_per_mux, ch_off;
>
> chans_per_mux = fsl_chan->edma->n_chans / DMAMUX_NR;
> ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux;
> + muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
After realizing that only one DMA channel was working on Vybrid I first
came up with an almost identically patch before I found this one. I now
applied and tested this one. Without this patch, the DMA user (e.g.
lpuart) fails gracefully and work nonetheless, however without DMA.
Since eDMA support is broken in current state in 3.16-rc3, it would be
good to get this patch into 3.16.
Tested-by: Stefan Agner <stefan@agner.ch>
--
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error
2014-07-01 8:41 [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error Jingchang Lu
2014-07-02 14:13 ` Stefan Agner
@ 2014-07-25 8:42 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2014-07-25 8:42 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jul 01, 2014 at 04:41:03PM +0800, Jingchang Lu wrote:
> Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
Applied, thanks
--
~Vinod
> ---
> drivers/dma/fsl-edma.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c
> index b396a7f..24ab3d3 100644
> --- a/drivers/dma/fsl-edma.c
> +++ b/drivers/dma/fsl-edma.c
> @@ -248,11 +248,12 @@ static void fsl_edma_chan_mux(struct fsl_edma_chan *fsl_chan,
> unsigned int slot, bool enable)
> {
> u32 ch = fsl_chan->vchan.chan.chan_id;
> - void __iomem *muxaddr = fsl_chan->edma->muxbase[ch / DMAMUX_NR];
> + void __iomem *muxaddr;
> unsigned chans_per_mux, ch_off;
>
> chans_per_mux = fsl_chan->edma->n_chans / DMAMUX_NR;
> ch_off = fsl_chan->vchan.chan.chan_id % chans_per_mux;
> + muxaddr = fsl_chan->edma->muxbase[ch / chans_per_mux];
>
> if (enable)
> edma_writeb(fsl_chan->edma,
> @@ -724,6 +725,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
> {
> struct fsl_edma_engine *fsl_edma = ofdma->of_dma_data;
> struct dma_chan *chan, *_chan;
> + unsigned long chans_per_mux = fsl_edma->n_chans / DMAMUX_NR;
>
> if (dma_spec->args_count != 2)
> return NULL;
> @@ -732,7 +734,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
> list_for_each_entry_safe(chan, _chan, &fsl_edma->dma_dev.channels, device_node) {
> if (chan->client_count)
> continue;
> - if ((chan->chan_id / DMAMUX_NR) == dma_spec->args[0]) {
> + if ((chan->chan_id / chans_per_mux) == dma_spec->args[0]) {
> chan = dma_get_slave_channel(chan);
> if (chan) {
> chan->device->privatecnt++;
> --
> 1.8.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-25 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 8:41 [PATCH] dmaengine: fsl-edma: fix dmamux index calculating error Jingchang Lu
2014-07-02 14:13 ` Stefan Agner
2014-07-25 8:42 ` Vinod Koul
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).