From: Kevin Hilman <khilman@ti.com>
To: Govindraj <govindraj.ti@gmail.com>
Cc: "Govindraj.R" <govindraj.raja@ti.com>,
linux-omap@vger.kernel.org, linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Tony Lindgren <tony@atomide.com>, Partha Basak <p-basak2@ti.com>,
Vishwanath Sripathy <vishwanath.bs@ti.com>,
Rajendra Nayak <rnayak@ti.com>,
Santosh Shilimkar <santosh.shilimkar@ti.com>
Subject: Re: [PATCH v6 14/16] OMAP2+: UART: Take console_lock in suspend path if not taken
Date: Wed, 12 Oct 2011 16:47:37 -0700 [thread overview]
Message-ID: <87mxd5n55y.fsf@ti.com> (raw)
In-Reply-To: <CAAL8m4zrveqqS3vq=dqMkS2gT24_=1UO+ukbxnQVf+AX4TBaVQ@mail.gmail.com> (Govindraj's message of "Wed, 12 Oct 2011 16:53:05 +0530")
Govindraj <govindraj.ti@gmail.com> writes:
> On Wed, Oct 12, 2011 at 12:31 AM, Kevin Hilman <khilman@ti.com> wrote:
>> "Govindraj.R" <govindraj.raja@ti.com> writes:
>>
>>> In suspend path the console_lock is taken by uart_port_suspend
>>> however when no_console_suspend is used console_lock is not taken.
>>>
>>> During system wide suspend omap_pwr_domain hooks cut all
>>> clocks that are left enabled. So its unsafe to proceed printing after
>>> clocks are cut by pwr_domain hooks.
>>
>> As I've mentioned in previous reviews, when no_console_suspend is
>> enabled, the user has explicitly requested console output during
>> suspend. In order to support that, we should not be cutting clocks at
>> all in that mode.
>>
>> One way to address this would be to just disable runtime PM in the
>> ->prepare method of the driver if no_console_suspend is enabled.
>>
>
> Okay fine exploring this option, right API's would be to use
> pm_runtime_forbid/allow.
Yes.
> <<SNIP>>
>
> +static int serial_omap_runtime_prepare(struct device *dev)
> +{
> + if (!console_suspend_enabled)
> + pm_runtime_forbid(dev);
> +
> + return 0;
> +}
> +
> +static void serial_omap_runtime_complete(struct device *dev)
> +{
> + if (!console_suspend_enabled)
> + pm_runtime_allow(dev);
> +}
> +
> static const struct dev_pm_ops serial_omap_dev_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(serial_omap_suspend, serial_omap_resume)
> SET_RUNTIME_PM_OPS(serial_omap_runtime_suspend,
> serial_omap_runtime_resume, NULL)
> + .prepare = serial_omap_runtime_prepare,
> + .complete = serial_omap_runtime_complete,
> };
OK, but please add comments to these functions about exactly why they
are needed.
>
> But to either use runtime forbid or disable we have ensure that
> power_domain hooks don't go ahead and disable
> the clocks with omap_device_idle as *runtime forbid or disable will
> not set runtime_status to RPM_SUSPENDED*
> and will stay in RPM_ACTIVE if we call runtime disable or forbid from
> active state.
Correct.
> in power_domain hooks we just check the pm_runtime_status_suspended
> this will be false even if
> we do runtime disable/forbid and it will cut uart clocks always.
>
> So we may need below check also:
>
> diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
> index 26aee5c..286a534 100644
> --- a/arch/arm/plat-omap/omap_device.c
> +++ b/arch/arm/plat-omap/omap_device.c
> @@ -592,7 +592,8 @@ static int _od_suspend_noirq(struct device *dev)
>
> ret = pm_generic_suspend_noirq(dev);
>
> - if (!ret && !pm_runtime_status_suspended(dev)) {
> + if (!ret && pm_runtime_enabled(dev) &&
> + !pm_runtime_status_suspended(dev)) {
> if (pm_generic_runtime_suspend(dev) == 0) {
> omap_device_idle(pdev);
> od->flags |= OMAP_DEVICE_SUSPENDED;
This isn't right either because devices that may not yet be initialized
(or loaded) may not have runtime PM enabled, so those devices may not
be properly idled.
We have an omap_device API to disable this feature at the PM domain level:
omap_device_disable_idle_on_suspend(). All you should have to do is to
use this API in the device init code on the console UART if
no_console_suspend has been enabled.
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: khilman@ti.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 14/16] OMAP2+: UART: Take console_lock in suspend path if not taken
Date: Wed, 12 Oct 2011 16:47:37 -0700 [thread overview]
Message-ID: <87mxd5n55y.fsf@ti.com> (raw)
In-Reply-To: <CAAL8m4zrveqqS3vq=dqMkS2gT24_=1UO+ukbxnQVf+AX4TBaVQ@mail.gmail.com> (Govindraj's message of "Wed, 12 Oct 2011 16:53:05 +0530")
Govindraj <govindraj.ti@gmail.com> writes:
> On Wed, Oct 12, 2011 at 12:31 AM, Kevin Hilman <khilman@ti.com> wrote:
>> "Govindraj.R" <govindraj.raja@ti.com> writes:
>>
>>> In suspend path the console_lock is taken by uart_port_suspend
>>> however when no_console_suspend is used console_lock is not taken.
>>>
>>> During system wide suspend omap_pwr_domain hooks cut all
>>> clocks that are left enabled. So its unsafe to proceed printing after
>>> clocks are cut by pwr_domain hooks.
>>
>> As I've mentioned in previous reviews, when no_console_suspend is
>> enabled, the user has explicitly requested console output during
>> suspend. ?In order to support that, we should not be cutting clocks at
>> all in that mode.
>>
>> One way to address this would be to just disable runtime PM in the
>> ->prepare method of the driver if no_console_suspend is enabled.
>>
>
> Okay fine exploring this option, right API's would be to use
> pm_runtime_forbid/allow.
Yes.
> <<SNIP>>
>
> +static int serial_omap_runtime_prepare(struct device *dev)
> +{
> + if (!console_suspend_enabled)
> + pm_runtime_forbid(dev);
> +
> + return 0;
> +}
> +
> +static void serial_omap_runtime_complete(struct device *dev)
> +{
> + if (!console_suspend_enabled)
> + pm_runtime_allow(dev);
> +}
> +
> static const struct dev_pm_ops serial_omap_dev_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(serial_omap_suspend, serial_omap_resume)
> SET_RUNTIME_PM_OPS(serial_omap_runtime_suspend,
> serial_omap_runtime_resume, NULL)
> + .prepare = serial_omap_runtime_prepare,
> + .complete = serial_omap_runtime_complete,
> };
OK, but please add comments to these functions about exactly why they
are needed.
>
> But to either use runtime forbid or disable we have ensure that
> power_domain hooks don't go ahead and disable
> the clocks with omap_device_idle as *runtime forbid or disable will
> not set runtime_status to RPM_SUSPENDED*
> and will stay in RPM_ACTIVE if we call runtime disable or forbid from
> active state.
Correct.
> in power_domain hooks we just check the pm_runtime_status_suspended
> this will be false even if
> we do runtime disable/forbid and it will cut uart clocks always.
>
> So we may need below check also:
>
> diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
> index 26aee5c..286a534 100644
> --- a/arch/arm/plat-omap/omap_device.c
> +++ b/arch/arm/plat-omap/omap_device.c
> @@ -592,7 +592,8 @@ static int _od_suspend_noirq(struct device *dev)
>
> ret = pm_generic_suspend_noirq(dev);
>
> - if (!ret && !pm_runtime_status_suspended(dev)) {
> + if (!ret && pm_runtime_enabled(dev) &&
> + !pm_runtime_status_suspended(dev)) {
> if (pm_generic_runtime_suspend(dev) == 0) {
> omap_device_idle(pdev);
> od->flags |= OMAP_DEVICE_SUSPENDED;
This isn't right either because devices that may not yet be initialized
(or loaded) may not have runtime PM enabled, so those devices may not
be properly idled.
We have an omap_device API to disable this feature at the PM domain level:
omap_device_disable_idle_on_suspend(). All you should have to do is to
use this API in the device init code on the console UART if
no_console_suspend has been enabled.
Kevin
next prev parent reply other threads:[~2011-10-12 23:47 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-30 11:02 [PATCH v6 10/16] OMAP2+: UART: Modify omap_uart_can_sleep function Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-09-30 11:02 ` [PATCH v6 11/16] OMAP2+: UART: Move errata handling from serial.c to omap-serial Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-10-11 21:01 ` Kevin Hilman
2011-10-11 21:01 ` Kevin Hilman
2011-10-12 10:43 ` Govindraj
2011-10-12 10:43 ` Govindraj
2011-09-30 11:02 ` [PATCH v6 12/16] OMAP2+: UART: Allow UART parameters to be configured from board file Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-10-11 18:53 ` Kevin Hilman
2011-10-11 18:53 ` Kevin Hilman
2011-10-12 10:44 ` Govindraj
2011-10-12 10:44 ` Govindraj
2011-09-30 11:02 ` [PATCH v6 13/16] OMAP2+: UART: Make the RX_TIMEOUT for DMA configurable for each UART Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-09-30 11:02 ` [PATCH v6 14/16] OMAP2+: UART: Take console_lock in suspend path if not taken Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-10-11 19:01 ` Kevin Hilman
2011-10-11 19:01 ` Kevin Hilman
2011-10-12 11:23 ` Govindraj
2011-10-12 11:23 ` Govindraj
2011-10-12 23:47 ` Kevin Hilman [this message]
2011-10-12 23:47 ` Kevin Hilman
2011-10-13 1:11 ` Govindraj
2011-10-13 1:11 ` Govindraj
2011-09-30 11:02 ` [PATCH v6 15/16] OMAP2+: UART: Enable back uart clocks with runtime API for early console Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-10-11 21:06 ` Kevin Hilman
2011-10-11 21:06 ` Kevin Hilman
2011-10-12 14:04 ` Govindraj
2011-10-12 14:04 ` Govindraj
2011-10-13 0:00 ` Kevin Hilman
2011-10-13 0:00 ` Kevin Hilman
2011-10-13 1:22 ` Govindraj
2011-10-13 1:22 ` Govindraj
2011-10-13 21:01 ` Kevin Hilman
2011-10-13 21:01 ` Kevin Hilman
2011-10-14 14:18 ` Govindraj
2011-10-14 14:18 ` Govindraj
2011-10-14 17:12 ` Kevin Hilman
2011-10-14 17:12 ` Kevin Hilman
2011-09-30 11:02 ` [PATCH v6 16/16] OMAP2+: UART: Do not gate uart clocks if used for debug_prints Govindraj.R
2011-09-30 11:02 ` Govindraj.R
2011-10-11 18:24 ` [PATCH v6 10/16] OMAP2+: UART: Modify omap_uart_can_sleep function Kevin Hilman
2011-10-11 18:24 ` Kevin Hilman
2011-10-12 13:38 ` Govindraj
2011-10-12 13:38 ` Govindraj
2011-10-12 19:41 ` Kevin Hilman
2011-10-12 19:41 ` Kevin Hilman
2011-10-13 1:09 ` Govindraj
2011-10-13 1:09 ` Govindraj
2011-10-13 6:59 ` Jean Pihet
2011-10-13 6:59 ` Jean Pihet
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=87mxd5n55y.fsf@ti.com \
--to=khilman@ti.com \
--cc=govindraj.raja@ti.com \
--cc=govindraj.ti@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=p-basak2@ti.com \
--cc=rnayak@ti.com \
--cc=santosh.shilimkar@ti.com \
--cc=tony@atomide.com \
--cc=vishwanath.bs@ti.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.