2016-03-03 06:04:50

by Kuninori Morimoto

[permalink] [raw]
Subject: [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels


From: Kuninori Morimoto <[email protected]>

DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 14ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Signed-off-by: Kuninori Morimoto <[email protected]>
---
drivers/dma/sh/rcar-dmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 57a6dfc9..02b86c6 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
u16 dmaor;

/* Clear all channels and enable the DMAC globally. */
- rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
+ rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
rcar_dmac_write(dmac, RCAR_DMAOR,
RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);

--
1.9.1


2016-03-03 08:22:31

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: rcar-dmac: clear pertinence number of channels

On Thu, Mar 3, 2016 at 7:04 AM, Kuninori Morimoto
<[email protected]> wrote:
> From: Kuninori Morimoto <[email protected]>
>
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 14ch),

15ch.

> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it
>
> Signed-off-by: Kuninori Morimoto <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2016-03-03 08:30:34

by Kuninori Morimoto

[permalink] [raw]
Subject: [PATCH v2] dma: rcar-dmac: clear pertinence number of channels

From: Kuninori Morimoto <[email protected]>

DMACHCLR clears each channels, but its channel number is based on
its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Signed-off-by: Kuninori Morimoto <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
---
v1 -> v2

- 14ch -> 15ch

drivers/dma/sh/rcar-dmac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 57a6dfc9..02b86c6 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
u16 dmaor;

/* Clear all channels and enable the DMAC globally. */
- rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
+ rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
rcar_dmac_write(dmac, RCAR_DMAOR,
RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);

--
1.9.1

2016-03-03 10:52:47

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH v2] dma: rcar-dmac: clear pertinence number of channels

Hi Morimoto-san,

Thank you for the patch.

On Thursday 03 March 2016 17:25:53 Kuninori Morimoto wrote:
> From: Kuninori Morimoto <[email protected]>
>
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it
>
> Signed-off-by: Kuninori Morimoto <[email protected]>
> Acked-by: Geert Uytterhoeven <[email protected]>

Acked-by: Laurent Pinchart <[email protected]>

> ---
> v1 -> v2
>
> - 14ch -> 15ch
>
> drivers/dma/sh/rcar-dmac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 57a6dfc9..02b86c6 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -422,7 +422,7 @@ static int rcar_dmac_init(struct rcar_dmac *dmac)
> u16 dmaor;
>
> /* Clear all channels and enable the DMAC globally. */
> - rcar_dmac_write(dmac, RCAR_DMACHCLR, 0x7fff);
> + rcar_dmac_write(dmac, RCAR_DMACHCLR, GENMASK(dmac->n_channels - 1, 0));
> rcar_dmac_write(dmac, RCAR_DMAOR,
> RCAR_DMAOR_PRI_FIXED | RCAR_DMAOR_DME);

--
Regards,

Laurent Pinchart

2016-03-03 17:20:30

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2] dma: rcar-dmac: clear pertinence number of channels

On Thu, Mar 03, 2016 at 05:25:53PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <[email protected]>
>
> DMACHCLR clears each channels, but its channel number is based on
> its SoC or IP. Current driver is using fixed 0x7fff (= for 15ch),
> it is not good match for Gen3 or Gen2 Audio DMAC. This patch fixes it

Applied, thanks

--
~Vinod