All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: dmaengine@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v2 0/3] dmaengine: rcar-dmac: fix resource freeing synchronization
Date: Fri, 19 May 2017 14:55:52 +0530	[thread overview]
Message-ID: <20170519092552.GQ15061@localhost> (raw)
In-Reply-To: <20170515230917.31888-1-niklas.soderlund+renesas@ragnatech.se>

On Tue, May 16, 2017 at 01:09:14AM +0200, Niklas S�derlund wrote:
> Hi,
> 
> This series fix resource freeing synchronization by:
> 
> 1. Patch 1/3
>    Store the IRQ number in the global struct so it can be used later
>    together with synchronize_irq().
> 
> 2. Patch 2/3
>    Adding support for the device_synchronize() callback in patch 2/3.
> 
> 3. Patch 3/3
>    Waiting for any ISR that might still be running after the channel is
>    halted prior to freeing its resources. This was patch previously part
>    of a patch sent out by Yoshihiro Shimoda and authored by Hiroyuki
>    Yokoyama, see [1].
> 
>    In that thread it was suggested by Lars-Peter Clausen to instead
>    implement the device_synchronize() callback. Unfortunately this is not
>    enough to solve the issue. In rcar_dmac_free_chan_resources() the
>    channel is halted by a call to rcar_dmac_chan_halt() and then directly
>    moves on to freeing resources, here it is still needed to add a wait
>    for any ISR to finish before freeing the resources, despite that a
>    device_synchronize() have been added.  This is because call chain:
> 
>    dma_release_channel()
>      dma_chan_put()
>        dmaengine_synchronize()
>        rcar_dmac_free_chan_resources()
>          rcar_dmac_chan_halt()
> 
>    Here dmaengine_synchronize() is called prior to rcar_dmac_chan_halt()
>    so an extra synchronisation to wait for any running ISR is still
>    needed.
> 
> By both adding a device_synchronize() which can be used in conjunction
> with device_terminate_all() and fiends and by adding an explicit
> synchronize_irq() when freeing channel resources I feel the
> synchronisation for freeing channel resources are in a much better
> shape. It also solves the issue in the original mail thread.

Applied now, thanks

-- 
~Vinod

      parent reply	other threads:[~2017-05-19  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 23:09 [PATCH v2 0/3] dmaengine: rcar-dmac: fix resource freeing synchronization Niklas Söderlund
2017-05-15 23:09 ` [PATCH v2 1/3] dmaengine: rcar-dmac: store channel IRQ in struct rcar_dmac_chan Niklas Söderlund
2017-05-19  3:51   ` Vinod Koul
2017-05-19  6:59     ` Geert Uytterhoeven
2017-05-19  9:24       ` Vinod Koul
2017-05-15 23:09 ` [PATCH v2 2/3] dmaengine: rcar-dmac: implement device_synchronize() Niklas Söderlund
2017-05-15 23:09 ` [PATCH v2 3/3] dmaengine: rcar-dmac: wait for ISR to finish before freeing resources Niklas Söderlund
2017-05-19  9:25 ` Vinod Koul [this message]

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=20170519092552.GQ15061@localhost \
    --to=vinod.koul@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=hiroyuki.yokoyama.vx@renesas.com \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.