From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Emilio Lopez <emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org>,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kevin.z.m.zh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
sunny-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org,
shuge-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org,
zhuzhenhua-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org
Subject: Re: [PATCH v3 3/5] spi: sunxi: Add Allwinner A31 SPI controller driver
Date: Tue, 4 Feb 2014 10:09:26 +0100 [thread overview]
Message-ID: <20140204090926.GI25625@lukather> (raw)
In-Reply-To: <20140204002110.GP22609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2355 bytes --]
Hi Mark,
On Tue, Feb 04, 2014 at 12:21:10AM +0000, Mark Brown wrote:
> On Fri, Jan 31, 2014 at 11:47:04PM +0100, Maxime Ripard wrote:
> > On Fri, Jan 31, 2014 at 12:48:09PM +0000, Mark Brown wrote:
> > > On Fri, Jan 31, 2014 at 11:55:50AM +0100, Maxime Ripard wrote:
>
> > > > + pm_runtime_enable(&pdev->dev);
> > > > + if (!pm_runtime_enabled(&pdev->dev)) {
> > > > + ret = sun6i_spi_runtime_resume(&pdev->dev);
> > > > + if (ret) {
> > > > + dev_err(&pdev->dev, "Couldn't resume the device\n");
> > > > + return ret;
> > > > + }
> > > > + }
>
> > > No, as discussed don't do this - notice how other drivers aren't written
> > > this way either. Like I said leave the device powered on startup and
> > > then let it be idled by runtime PM.
>
> > Well, some SPI drivers are actually written like that (all the tegra
>
> It's not been done consistently, no - that should be fixed.
>
> > SPI drivers for example). It's not an excuse, but waking up the device
> > only to put it back in suspend right away seems kind of
>
> It isn't awesome, no. Ideally the runtime PM code would do this but
> then you couldn't ifdef the operations which as far as I can tell is the
> main thing people want from disabling it and it gets complicated for
> devices that genuinely do power up on startup so here we are.
We discussed it with Kevin on IRC, and he suggested that we move that
pm_runtime initialization to the SPI core, but I guess that would also
mean that all drivers shouldn't ifdef the operations, so that the core
can call the runtime_resume callback directly.
However, I don't really get why any driver should be doing so, since
you still need these functions to at least to the device
suspend/resume in the probe/remove, and you don't really want to
duplicate the code.
Right now, about half of the SPI drivers using auto_runtime_pm are
using a ifdef, the other half is not.
> > inefficient. Plus, the pm_runtime_idle callback you suggested are
> > actually calling runtime_idle, while we want to call runtime_suspend.
>
> Yeah, I didn't actually check if I was looking at the right call there.
I was actually wrong, it does so in its very last line.
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/5] spi: sunxi: Add Allwinner A31 SPI controller driver
Date: Tue, 4 Feb 2014 10:09:26 +0100 [thread overview]
Message-ID: <20140204090926.GI25625@lukather> (raw)
In-Reply-To: <20140204002110.GP22609@sirena.org.uk>
Hi Mark,
On Tue, Feb 04, 2014 at 12:21:10AM +0000, Mark Brown wrote:
> On Fri, Jan 31, 2014 at 11:47:04PM +0100, Maxime Ripard wrote:
> > On Fri, Jan 31, 2014 at 12:48:09PM +0000, Mark Brown wrote:
> > > On Fri, Jan 31, 2014 at 11:55:50AM +0100, Maxime Ripard wrote:
>
> > > > + pm_runtime_enable(&pdev->dev);
> > > > + if (!pm_runtime_enabled(&pdev->dev)) {
> > > > + ret = sun6i_spi_runtime_resume(&pdev->dev);
> > > > + if (ret) {
> > > > + dev_err(&pdev->dev, "Couldn't resume the device\n");
> > > > + return ret;
> > > > + }
> > > > + }
>
> > > No, as discussed don't do this - notice how other drivers aren't written
> > > this way either. Like I said leave the device powered on startup and
> > > then let it be idled by runtime PM.
>
> > Well, some SPI drivers are actually written like that (all the tegra
>
> It's not been done consistently, no - that should be fixed.
>
> > SPI drivers for example). It's not an excuse, but waking up the device
> > only to put it back in suspend right away seems kind of
>
> It isn't awesome, no. Ideally the runtime PM code would do this but
> then you couldn't ifdef the operations which as far as I can tell is the
> main thing people want from disabling it and it gets complicated for
> devices that genuinely do power up on startup so here we are.
We discussed it with Kevin on IRC, and he suggested that we move that
pm_runtime initialization to the SPI core, but I guess that would also
mean that all drivers shouldn't ifdef the operations, so that the core
can call the runtime_resume callback directly.
However, I don't really get why any driver should be doing so, since
you still need these functions to at least to the device
suspend/resume in the probe/remove, and you don't really want to
duplicate the code.
Right now, about half of the SPI drivers using auto_runtime_pm are
using a ifdef, the other half is not.
> > inefficient. Plus, the pm_runtime_idle callback you suggested are
> > actually calling runtime_idle, while we want to call runtime_suspend.
>
> Yeah, I didn't actually check if I was looking at the right call there.
I was actually wrong, it does so in its very last line.
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140204/60ce6bb9/attachment.sig>
WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Mark Brown <broonie@kernel.org>
Cc: Mike Turquette <mturquette@linaro.org>,
Emilio Lopez <emilio@elopez.com.ar>,
linux-sunxi@googlegroups.com, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, kevin.z.m.zh@gmail.com,
sunny@allwinnertech.com, shuge@allwinnertech.com,
zhuzhenhua@allwinnertech.com
Subject: Re: [PATCH v3 3/5] spi: sunxi: Add Allwinner A31 SPI controller driver
Date: Tue, 4 Feb 2014 10:09:26 +0100 [thread overview]
Message-ID: <20140204090926.GI25625@lukather> (raw)
In-Reply-To: <20140204002110.GP22609@sirena.org.uk>
[-- Attachment #1: Type: text/plain, Size: 2355 bytes --]
Hi Mark,
On Tue, Feb 04, 2014 at 12:21:10AM +0000, Mark Brown wrote:
> On Fri, Jan 31, 2014 at 11:47:04PM +0100, Maxime Ripard wrote:
> > On Fri, Jan 31, 2014 at 12:48:09PM +0000, Mark Brown wrote:
> > > On Fri, Jan 31, 2014 at 11:55:50AM +0100, Maxime Ripard wrote:
>
> > > > + pm_runtime_enable(&pdev->dev);
> > > > + if (!pm_runtime_enabled(&pdev->dev)) {
> > > > + ret = sun6i_spi_runtime_resume(&pdev->dev);
> > > > + if (ret) {
> > > > + dev_err(&pdev->dev, "Couldn't resume the device\n");
> > > > + return ret;
> > > > + }
> > > > + }
>
> > > No, as discussed don't do this - notice how other drivers aren't written
> > > this way either. Like I said leave the device powered on startup and
> > > then let it be idled by runtime PM.
>
> > Well, some SPI drivers are actually written like that (all the tegra
>
> It's not been done consistently, no - that should be fixed.
>
> > SPI drivers for example). It's not an excuse, but waking up the device
> > only to put it back in suspend right away seems kind of
>
> It isn't awesome, no. Ideally the runtime PM code would do this but
> then you couldn't ifdef the operations which as far as I can tell is the
> main thing people want from disabling it and it gets complicated for
> devices that genuinely do power up on startup so here we are.
We discussed it with Kevin on IRC, and he suggested that we move that
pm_runtime initialization to the SPI core, but I guess that would also
mean that all drivers shouldn't ifdef the operations, so that the core
can call the runtime_resume callback directly.
However, I don't really get why any driver should be doing so, since
you still need these functions to at least to the device
suspend/resume in the probe/remove, and you don't really want to
duplicate the code.
Right now, about half of the SPI drivers using auto_runtime_pm are
using a ifdef, the other half is not.
> > inefficient. Plus, the pm_runtime_idle callback you suggested are
> > actually calling runtime_idle, while we want to call runtime_suspend.
>
> Yeah, I didn't actually check if I was looking at the right call there.
I was actually wrong, it does so in its very last line.
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-02-04 9:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 10:55 [PATCH v3 0/5] Add Allwinner A31 SPI controller support Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
[not found] ` <1391165752-1819-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-31 10:55 ` [PATCH v3 1/5] clk: sunxi: Add support for PLL6 on the A31 Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` [PATCH v3 2/5] ARM: sun6i: dt: Add PLL6 and SPI module clocks Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` [PATCH v3 3/5] spi: sunxi: Add Allwinner A31 SPI controller driver Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
[not found] ` <1391165752-1819-4-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-01-31 12:48 ` Mark Brown
2014-01-31 12:48 ` Mark Brown
2014-01-31 12:48 ` Mark Brown
[not found] ` <20140131124809.GE22609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-31 22:47 ` Maxime Ripard
2014-01-31 22:47 ` Maxime Ripard
2014-01-31 22:47 ` Maxime Ripard
2014-02-04 0:21 ` Mark Brown
2014-02-04 0:21 ` Mark Brown
2014-02-04 0:21 ` Mark Brown
[not found] ` <20140204002110.GP22609-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-02-04 9:09 ` Maxime Ripard [this message]
2014-02-04 9:09 ` Maxime Ripard
2014-02-04 9:09 ` Maxime Ripard
2014-02-04 11:02 ` Mark Brown
2014-02-04 11:02 ` Mark Brown
2014-02-04 11:02 ` Mark Brown
2014-01-31 10:55 ` [PATCH v3 4/5] ARM: sun6i: dt: Add SPI controllers to the A31 DTSI Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` [PATCH v3 5/5] ARM: sunxi: Enable A31 SPI and SID in the defconfig Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
2014-01-31 10:55 ` Maxime Ripard
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=20140204090926.GI25625@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=emilio-0Z03zUJReD5OxF6Tv1QG9Q@public.gmane.org \
--cc=kevin.z.m.zh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=shuge-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org \
--cc=sunny-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.org \
--cc=zhuzhenhua-0TFLnhJekD6UEPyfVivIlAC/G2K4zDHf@public.gmane.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 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.