From: Kevin Hilman <khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "Yang\, Wenyou" <Wenyou.Yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"linux-spi\@vger.kernel.org"
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel\@vger.kernel.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, "Ferre\,
Nicolas" <Nicolas.FERRE-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
"linux-arm-kernel\@lists.infradead.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH] spi/atmel: add support for runtime PM
Date: Mon, 20 Oct 2014 11:09:19 -0700 [thread overview]
Message-ID: <7hd29mfwa8.fsf@deeprootsystems.com> (raw)
In-Reply-To: <B256D81BAE5131468A838E5D7A243641BF594F37@penmbx01> (Wenyou Yang's message of "Mon, 20 Oct 2014 02:05:42 +0000")
"Yang, Wenyou" <Wenyou.Yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> writes:
>> -----Original Message-----
>> From: Kevin Hilman [mailto:khilman-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org]
>> Sent: Friday, October 17, 2014 10:22 PM
>> To: Mark Brown
>> Cc: Yang, Wenyou; linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Ferre,
>> Nicolas; linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>> Subject: Re: [PATCH] spi/atmel: add support for runtime PM
>>
>> Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> writes:
>>
>> > On Fri, Oct 17, 2014 at 06:02:35AM -0700, Kevin Hilman wrote:
>> >> Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> writes:
>> >
>> >> > + if (!pm_runtime_suspended(dev)) {
>> >> > + clk_disable_unprepare(as->clk);
>> >> > + pinctrl_pm_select_sleep_state(dev);
>> >> > + }
>> >
>> >> a.k.a. pm_runtime_put_sync() since the ->runtime_suspend() callback
>> >> does the same thing.
>> >
>> > Will that do the right thing when runtime PM is disabled in Kconfig?
>>
>> Good point.
>>
>> Then the way to make this cleaner, and obvious on inspection that system
>> suspend/resume are doing the same thing as runtime suspend/resume is to have -
>> >suspend call the runtime_suspend function.
>>
>> The runtime suspend/resume functions then should be wrapped in CONFIG_PM
>> instead of CONFIG_PM_RUNTIME.
> But if the runtime PM is disabled, __pm_runtime_idle() return -ENOSYS,
> which invoked by pm_runtime_put_sync(), in spite of the runtime
> suspend/resume functions wrapper,
You won't be calling _put_sync(), instead you'll just directly call
atmel_spi_runtime_suspend().
The goal is to make it obvious upon reading that ->suspend and
->runtime_suspend are doing exactly the same thing.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: khilman@kernel.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] spi/atmel: add support for runtime PM
Date: Mon, 20 Oct 2014 11:09:19 -0700 [thread overview]
Message-ID: <7hd29mfwa8.fsf@deeprootsystems.com> (raw)
In-Reply-To: <B256D81BAE5131468A838E5D7A243641BF594F37@penmbx01> (Wenyou Yang's message of "Mon, 20 Oct 2014 02:05:42 +0000")
"Yang, Wenyou" <Wenyou.Yang@atmel.com> writes:
>> -----Original Message-----
>> From: Kevin Hilman [mailto:khilman at kernel.org]
>> Sent: Friday, October 17, 2014 10:22 PM
>> To: Mark Brown
>> Cc: Yang, Wenyou; linux-spi at vger.kernel.org; linux-kernel at vger.kernel.org; Ferre,
>> Nicolas; linux-arm-kernel at lists.infradead.org
>> Subject: Re: [PATCH] spi/atmel: add support for runtime PM
>>
>> Mark Brown <broonie@kernel.org> writes:
>>
>> > On Fri, Oct 17, 2014 at 06:02:35AM -0700, Kevin Hilman wrote:
>> >> Wenyou Yang <wenyou.yang@atmel.com> writes:
>> >
>> >> > + if (!pm_runtime_suspended(dev)) {
>> >> > + clk_disable_unprepare(as->clk);
>> >> > + pinctrl_pm_select_sleep_state(dev);
>> >> > + }
>> >
>> >> a.k.a. pm_runtime_put_sync() since the ->runtime_suspend() callback
>> >> does the same thing.
>> >
>> > Will that do the right thing when runtime PM is disabled in Kconfig?
>>
>> Good point.
>>
>> Then the way to make this cleaner, and obvious on inspection that system
>> suspend/resume are doing the same thing as runtime suspend/resume is to have -
>> >suspend call the runtime_suspend function.
>>
>> The runtime suspend/resume functions then should be wrapped in CONFIG_PM
>> instead of CONFIG_PM_RUNTIME.
> But if the runtime PM is disabled, __pm_runtime_idle() return -ENOSYS,
> which invoked by pm_runtime_put_sync(), in spite of the runtime
> suspend/resume functions wrapper,
You won't be calling _put_sync(), instead you'll just directly call
atmel_spi_runtime_suspend().
The goal is to make it obvious upon reading that ->suspend and
->runtime_suspend are doing exactly the same thing.
Kevin
WARNING: multiple messages have this Message-ID (diff)
From: Kevin Hilman <khilman@kernel.org>
To: "Yang\, Wenyou" <Wenyou.Yang@atmel.com>
Cc: Mark Brown <broonie@kernel.org>,
"linux-spi\@vger.kernel.org" <linux-spi@vger.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ferre\, Nicolas" <Nicolas.FERRE@atmel.com>,
"linux-arm-kernel\@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] spi/atmel: add support for runtime PM
Date: Mon, 20 Oct 2014 11:09:19 -0700 [thread overview]
Message-ID: <7hd29mfwa8.fsf@deeprootsystems.com> (raw)
In-Reply-To: <B256D81BAE5131468A838E5D7A243641BF594F37@penmbx01> (Wenyou Yang's message of "Mon, 20 Oct 2014 02:05:42 +0000")
"Yang, Wenyou" <Wenyou.Yang@atmel.com> writes:
>> -----Original Message-----
>> From: Kevin Hilman [mailto:khilman@kernel.org]
>> Sent: Friday, October 17, 2014 10:22 PM
>> To: Mark Brown
>> Cc: Yang, Wenyou; linux-spi@vger.kernel.org; linux-kernel@vger.kernel.org; Ferre,
>> Nicolas; linux-arm-kernel@lists.infradead.org
>> Subject: Re: [PATCH] spi/atmel: add support for runtime PM
>>
>> Mark Brown <broonie@kernel.org> writes:
>>
>> > On Fri, Oct 17, 2014 at 06:02:35AM -0700, Kevin Hilman wrote:
>> >> Wenyou Yang <wenyou.yang@atmel.com> writes:
>> >
>> >> > + if (!pm_runtime_suspended(dev)) {
>> >> > + clk_disable_unprepare(as->clk);
>> >> > + pinctrl_pm_select_sleep_state(dev);
>> >> > + }
>> >
>> >> a.k.a. pm_runtime_put_sync() since the ->runtime_suspend() callback
>> >> does the same thing.
>> >
>> > Will that do the right thing when runtime PM is disabled in Kconfig?
>>
>> Good point.
>>
>> Then the way to make this cleaner, and obvious on inspection that system
>> suspend/resume are doing the same thing as runtime suspend/resume is to have -
>> >suspend call the runtime_suspend function.
>>
>> The runtime suspend/resume functions then should be wrapped in CONFIG_PM
>> instead of CONFIG_PM_RUNTIME.
> But if the runtime PM is disabled, __pm_runtime_idle() return -ENOSYS,
> which invoked by pm_runtime_put_sync(), in spite of the runtime
> suspend/resume functions wrapper,
You won't be calling _put_sync(), instead you'll just directly call
atmel_spi_runtime_suspend().
The goal is to make it obvious upon reading that ->suspend and
->runtime_suspend are doing exactly the same thing.
Kevin
next prev parent reply other threads:[~2014-10-20 18:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-16 1:49 [PATCH] spi/atmel: add support for runtime PM Wenyou Yang
2014-10-16 1:49 ` Wenyou Yang
2014-10-16 1:49 ` Wenyou Yang
2014-10-16 7:30 ` Mark Brown
2014-10-16 7:30 ` Mark Brown
[not found] ` <20141016073004.GL27755-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-16 8:09 ` Yang, Wenyou
2014-10-16 8:09 ` Yang, Wenyou
2014-10-16 8:09 ` Yang, Wenyou
2014-10-17 13:02 ` Kevin Hilman
2014-10-17 13:02 ` Kevin Hilman
2014-10-17 13:57 ` Mark Brown
2014-10-17 13:57 ` Mark Brown
[not found] ` <20141017135716.GS1820-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-17 14:22 ` Kevin Hilman
2014-10-17 14:22 ` Kevin Hilman
2014-10-17 14:22 ` Kevin Hilman
[not found] ` <7hd29qhj3i.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2014-10-17 14:31 ` Mark Brown
2014-10-17 14:31 ` Mark Brown
2014-10-17 14:31 ` Mark Brown
2014-10-20 2:05 ` Yang, Wenyou
2014-10-20 2:05 ` Yang, Wenyou
2014-10-20 2:05 ` Yang, Wenyou
2014-10-20 18:09 ` Kevin Hilman [this message]
2014-10-20 18:09 ` Kevin Hilman
2014-10-20 18:09 ` Kevin Hilman
2014-10-21 0:51 ` Yang, Wenyou
2014-10-21 0:51 ` Yang, Wenyou
2014-10-21 0:51 ` Yang, Wenyou
[not found] ` <7hk33yhms4.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
2014-10-20 1:59 ` Yang, Wenyou
2014-10-20 1:59 ` Yang, Wenyou
2014-10-20 1:59 ` Yang, Wenyou
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=7hd29mfwa8.fsf@deeprootsystems.com \
--to=khilman-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=Nicolas.FERRE-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=Wenyou.Yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@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 \
/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.