RE: [PATCH 1/6] dma: rcar-dma: add wait after stopping dma engine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Thanks for the feedback.

> I would add a cpu_relax() to the loop.
This routine is being called from soft IRQ context (rx_timer_fn in case of sh-sci). Does it still make sense to add cpu_relax?

> BTW, please run scripts/checkpatch.pl on your patches before submission.
I did run that and got no warning/error. Am I missing something?

Cheers!
Hamza

-----Original Message-----
From: geert.uytterhoeven@xxxxxxxxx [mailto:geert.uytterhoeven@xxxxxxxxx] On Behalf Of Geert Uytterhoeven
Sent: Dienstag, 15. September 2015 17:11
To: hamzahfrq.sub@xxxxxxxxx
Cc: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>; dmaengine@xxxxxxxxxxxxxxx; Jürg Billeter <j@xxxxxxxxx>; Joe Perches <joe@xxxxxxxxxxx>; Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>; Mark Brown <broonie@xxxxxxxxxx>; Geert Uytterhoeven <geert+renesas@xxxxxxxxx>; Vinod Koul <vinod.koul@xxxxxxxxx>; Farooq, Muhammad (M.HAMZA.) <mfarooq@xxxxxxxxxxx>
Subject: Re: [PATCH 1/6] dma: rcar-dma: add wait after stopping dma engine

Hi Hamza,

On Mon, Sep 14, 2015 at 2:02 PM,  <hamzahfrq.sub@xxxxxxxxx> wrote:
> DMA engine does not stop instantaneously when transaction is going on 
> (see datasheet). Wait has been added
>
> Signed-off-by: Muhammad Hamza Farooq <mfarooq@xxxxxxxxxxx>

Thanks for your patch!

> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c 
> index 7820d07..920f977 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -716,14 +716,37 @@ static int rcar_dmac_fill_hwdesc(struct 
> rcar_dmac_chan *chan,
>  /* -----------------------------------------------------------------------------
>   * Stop and reset
>   */
> +#define        NR_READS_TO_WAIT        (5)     /* number of reads to perform to check DE = 0 */
> +static inline int rcar_dmac_wait_stop(struct rcar_dmac_chan *chan) {
> +       unsigned int i = 0;
> +       do {
> +               u32 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR);
> +
> +               if(!(chcr & RCAR_DMACHCR_DE))
> +                       return 0;
> +               dev_dbg(chan->chan.device->dev, "DMA transfer couldn't 
> + be stopped");

I would add a cpu_relax() to the loop.

> +       }
> +       while(++i < NR_READS_TO_WAIT);

BTW, please run scripts/checkpatch.pl on your patches before submission.

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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
��.n��������+%������w��{.n��������)�)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux