From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Vinod <vkoul@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Dan Williams <dan.j.williams@intel.com>,
Magnus Damm <magnus.damm@gmail.com>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Kieran Bingham <kieran@ksquared.org.uk>,
Geert Uytterhoeven <geert+renesas@glider.be>,
dmaengine@vger.kernel.org
Subject: dmaengine: rcar-dmac: clear channel register when error
Date: Mon, 02 Jul 2018 09:37:28 +0300 [thread overview]
Message-ID: <2150046.r5M1qlqddB@avalon> (raw)
Hi Morimoto-san,
Thank you for the patch.
On Monday, 2 July 2018 04:07:17 EEST Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> We need to clear channel register in error case as recovery.
> The channel is already stopped in such case, thus we don't need to call
> rcar_dmac_chan_halt() before clearing.
>
> rcar_dmac_chan_halt() will clear register and confirm DE bit.
> But it will be failed because channel is already stopped in error case.
> In other words, we shouldn't call it then.
>
> // This patch started to use C++ style comment out
> // because it is recent Linus request
I fear this will generate lots of frustration :-/ While I strongly prefer the
traditional C style, I'm fine leaving the choice to driver authors. However, I
think that mixing different styles in the same file only hinders readability.
Would you like to convert the whole file ? ;-)
> Reported-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Reviewed-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
> ---
> drivers/dma/sh/rcar-dmac.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
> index 279c930..35d7a16 100644
> --- a/drivers/dma/sh/rcar-dmac.c
> +++ b/drivers/dma/sh/rcar-dmac.c
> @@ -1525,7 +1525,13 @@ static irqreturn_t rcar_dmac_isr_channel(int irq,
> void *dev)
>
> chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR);
> if (chcr & RCAR_DMACHCR_CAE) {
> - rcar_dmac_chan_halt(chan);
> + struct rcar_dmac *dmac = dev_get_drvdata(chan->chan.device->dev);
This could be simplified with
struct rcar_dmac *dmac = to_rcar_dmac(chan->chan.device);
> +
> + // We don't need to call rcar_dmac_chan_halt()
> + // because channel is already stopped in error case.
> + // We need to clear register and check DE bit as recovery.
Is it also a request from Linus to wrap text much before the 80 characters
limit ? :-)
> + rcar_dmac_write(dmac, RCAR_DMACHCLR, 1 << chan->index);
> + rcar_dmac_chcr_de_barrier(chan);
> reinit = true;
> goto spin_lock_end;
> }
next reply other threads:[~2018-07-02 6:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-02 6:37 Laurent Pinchart [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-07-02 6:53 dmaengine: rcar-dmac: clear channel register when error Kuninori Morimoto
2018-07-02 2:20 Kuninori Morimoto
2018-07-02 1:24 Fabio Estevam
2018-07-02 1:07 Kuninori Morimoto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2150046.r5M1qlqddB@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=kieran@ksquared.org.uk \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).