All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@linaro.org>
To: Daniel Mack <zonque@gmail.com>
Cc: linux-omap@vger.kernel.org, joelf@ti.com, gururaja.hebbar@ti.com,
	balajitk@ti.com, s.neumann@raumfeld.com, mporter@ti.com,
	nsekhar@ti.com, Russ.Dill@ti.com, nm@ti.com,
	vaibhav.bedia@gmail.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5] ARM: omap: edma: add suspend suspend/resume hooks
Date: Thu, 07 Nov 2013 16:02:26 -0800	[thread overview]
Message-ID: <87siv7pxpp.fsf@linaro.org> (raw)
In-Reply-To: <1383863549-7438-1-git-send-email-zonque@gmail.com> (Daniel Mack's message of "Thu, 7 Nov 2013 23:32:29 +0100")

Daniel Mack <zonque@gmail.com> writes:

> This patch makes the edma driver resume correctly after suspend. Tested
> on an AM33xx platform with cyclic audio streams and omap_hsmmc.
>
> All information can be reconstructed by already known runtime
> information.
>
> As we now use some functions that were previously only used from __init
> context, annotations had to be dropped.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
> Ok, here is v5.
>
> v4 -> v5:
>
> 	* dropped pm_runtime_* function calls entirely
> 	* moved the function pointers to .suspend/resume _noirq

[...]

> +static const struct dev_pm_ops edma_pm_ops = {
> +	.suspend	= edma_pm_suspend,

I suspect you intended to use the _noirq version like the changelog
says?

> +	.resume_noirq	= edma_pm_resume,
> +};

Also, I believe it was already suggested by Nishanth, but the late/early
callbacks are probably more appropriate here than the noirq callbacks.
Unless there's a *really* good reason to use the noirq callbacks, they
should be avoided.

That being said, I wonder if the whole approach here is the right one.
I know you're basing your stuff on some TI tree, but that doesn't make
it the right way (usually, it's the opposite, but I digress...)  ;)

IMO, EDMA should be done like we currently do I2C and not implement
suspend/resume at all.  Instead, the driver should do runtime PM done on
a per xfer basis.  Then when suspend comes along, all that needs to be
done is ensure all in-flight xfers are done, then runtime PM will kick
in.

Kevin

WARNING: multiple messages have this Message-ID (diff)
From: khilman@linaro.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5] ARM: omap: edma: add suspend suspend/resume hooks
Date: Thu, 07 Nov 2013 16:02:26 -0800	[thread overview]
Message-ID: <87siv7pxpp.fsf@linaro.org> (raw)
In-Reply-To: <1383863549-7438-1-git-send-email-zonque@gmail.com> (Daniel Mack's message of "Thu, 7 Nov 2013 23:32:29 +0100")

Daniel Mack <zonque@gmail.com> writes:

> This patch makes the edma driver resume correctly after suspend. Tested
> on an AM33xx platform with cyclic audio streams and omap_hsmmc.
>
> All information can be reconstructed by already known runtime
> information.
>
> As we now use some functions that were previously only used from __init
> context, annotations had to be dropped.
>
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
> Ok, here is v5.
>
> v4 -> v5:
>
> 	* dropped pm_runtime_* function calls entirely
> 	* moved the function pointers to .suspend/resume _noirq

[...]

> +static const struct dev_pm_ops edma_pm_ops = {
> +	.suspend	= edma_pm_suspend,

I suspect you intended to use the _noirq version like the changelog
says?

> +	.resume_noirq	= edma_pm_resume,
> +};

Also, I believe it was already suggested by Nishanth, but the late/early
callbacks are probably more appropriate here than the noirq callbacks.
Unless there's a *really* good reason to use the noirq callbacks, they
should be avoided.

That being said, I wonder if the whole approach here is the right one.
I know you're basing your stuff on some TI tree, but that doesn't make
it the right way (usually, it's the opposite, but I digress...)  ;)

IMO, EDMA should be done like we currently do I2C and not implement
suspend/resume at all.  Instead, the driver should do runtime PM done on
a per xfer basis.  Then when suspend comes along, all that needs to be
done is ensure all in-flight xfers are done, then runtime PM will kick
in.

Kevin

  reply	other threads:[~2013-11-08  0:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 22:32 [PATCH v5] ARM: omap: edma: add suspend suspend/resume hooks Daniel Mack
2013-11-07 22:32 ` Daniel Mack
2013-11-08  0:02 ` Kevin Hilman [this message]
2013-11-08  0:02   ` Kevin Hilman
2013-11-08  4:58   ` Joel Fernandes
2013-11-08  4:58     ` Joel Fernandes
2013-11-08  6:28     ` Kevin Hilman
2013-11-08  6:28       ` Kevin Hilman
2013-11-08 16:14       ` Joel Fernandes
2013-11-08 16:14         ` Joel Fernandes
2013-11-08 18:03         ` Nishanth Menon
2013-11-08 18:03           ` Nishanth Menon
2013-11-08 18:51         ` Kevin Hilman
2013-11-08 18:51           ` Kevin Hilman
2013-11-08  7:59   ` Daniel Mack
2013-11-08  7:59     ` Daniel Mack

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=87siv7pxpp.fsf@linaro.org \
    --to=khilman@linaro.org \
    --cc=Russ.Dill@ti.com \
    --cc=balajitk@ti.com \
    --cc=gururaja.hebbar@ti.com \
    --cc=joelf@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mporter@ti.com \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=s.neumann@raumfeld.com \
    --cc=vaibhav.bedia@gmail.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 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.