dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vkoul@kernel.org>,
	Alexandre Bailon <abailon@baylibre.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Bin Liu <b-liu@ti.com>, Daniel Mack <zonque@gmail.com>,
	Felipe Balbi <felipe.balbi@linux.intel.com>,
	Johan Hovold <johan@kernel.org>, Sekhar Nori <nsekhar@ti.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	dmaengine@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org,
	giulio.benetti@benettiengineering.com,
	Sebastian Reichel <sre@kernel.org>,
	Skvortsov <andrej.skvortzov@gmail.com>,
	Yegor Yefremov <yegorslists@googlemail.com>
Subject: Re: [PATCH] dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle
Date: Wed, 23 Oct 2019 14:27:34 -0700	[thread overview]
Message-ID: <20191023212734.GT5610@atomide.com> (raw)
In-Reply-To: <c3f0ae57-bc74-bab9-c8f9-b4ca751d657e@ti.com>

* Grygorii Strashko <grygorii.strashko@ti.com> [191023 20:56]:
> On 23/10/2019 23:18, Tony Lindgren wrote:
> > And no, adding pm_runtime_get_sync() to issue_pending is not
> > a solution. There may be clocks and regulators that need to
> > be powered up, and we don't want to use pm_runtime_irq_safe()
> > because of the permanent use count on the parent.
> 
> 5 cents.
> 
> I think the right thing might be to get rid of pm_runtime_xxx()
> in cppi41_dma_issue_pending(). So overall approach will be:
> 
> - new job -> cppi41_dma_prep_slave_sg() -> pm_runtime_get()
> - issue_pending: fill backlog if suspended or run_queue if active (pm_runtime_active())
> - job done: dmaengine_desc_get_callback_invoke() ->
> 
> 	dmaengine_desc_get_callback_invoke();
> 	pm_runtime_mark_last_busy(cdd->ddev.dev);
> 	pm_runtime_put_autosuspend(cdd->ddev.dev);
>   in all places.
> 
> It even might allow to get rid of cdd->lock.

Well I don't think cppi41_dma_prep_slave_sg() is necessarily
paired with anything currently. This can potentially leading
to pm_runtime_get() called multiple times?

So I think we'd also need cppi41_dma_cleanup_slave_sg()
or similar, and require they get called in a paired manner.

It might be better to add seprate PM runtime specific
functions that dma consumers can optionally call.

Regards,

Tony


  reply	other threads:[~2019-10-23 21:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 15:31 [PATCH] dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle Tony Lindgren
2019-10-23 15:52 ` Vinod Koul
2019-10-23 17:04 ` Peter Ujfalusi
2019-10-23 17:16   ` Tony Lindgren
2019-10-23 19:02     ` Peter Ujfalusi
2019-10-23 19:18       ` Tony Lindgren
2019-10-23 19:55         ` Peter Ujfalusi
2019-10-23 20:18           ` Tony Lindgren
2019-10-23 20:55             ` Grygorii Strashko
2019-10-23 21:27               ` Tony Lindgren [this message]
2019-10-23 21:43                 ` Grygorii Strashko
2019-10-23 21:49                   ` Tony Lindgren
2019-10-24  8:52             ` Peter Ujfalusi
2019-10-24 11:22               ` Andy Shevchenko
2019-10-24 14:00                 ` Tony Lindgren
2019-10-23 18:55 ` Sergei Shtylyov
2019-10-23 18:58   ` Andy Shevchenko
2019-10-23 19:19     ` Sergei Shtylyov
2019-10-23 19:00   ` Tony Lindgren

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=20191023212734.GT5610@atomide.com \
    --to=tony@atomide.com \
    --cc=abailon@baylibre.com \
    --cc=andrej.skvortzov@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=b-liu@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=felipe.balbi@linux.intel.com \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=grygorii.strashko@ti.com \
    --cc=johan@kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=sre@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yegorslists@googlemail.com \
    --cc=zonque@gmail.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 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).