From: khilman@kernel•org (Kevin Hilman)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 05/11] ARM: imx6: set initial power mode in pm function
Date: Wed, 29 Apr 2015 09:35:28 -0700 [thread overview]
Message-ID: <7h383ix57z.fsf@deeprootsystems.com> (raw)
In-Reply-To: <20150429060446.GA27573@dragon> (Shawn Guo's message of "Wed, 29 Apr 2015 14:04:58 +0800")
Shawn Guo <shawn.guo@linaro•org> writes:
> Hi Kevin,
>
> On Tue, Apr 28, 2015 at 11:42:48AM -0700, Kevin Hilman wrote:
>> Hi Shawn,
>>
>> On Sun, Apr 26, 2015 at 7:31 AM, Shawn Guo <shawn.guo@linaro•org> wrote:
>> > Rather than setting initial low-power mode in every single i.MX6 clock
>> > initialization function, we should really do that in pm code. Let's
>> > move imx6q_set_lpm(WAIT_CLOCKED) call into imx6_pm_common_init().
>> >
>> > While at it, let's rename the function to imx6_set_lpm() since it's
>> > actually common for all i.MX6 SoCs.
>> >
>> > Signed-off-by: Shawn Guo <shawn.guo@linaro•org>
>>
>> Some boot failures on imx6[1] (multi_v7_defconfig) were bisected down
>> to this patch. A simple revert doesn't build, so I was unable tot
>> test a direct revert. However, from the boot failures you can see
>> that while multi_v7_defconfig boots fail, the imx_v6_v7_defconfig
>> boots fine.
>
> This reminds me that cpuidle support is not turned on in
> imx_v6_v7_defconfig. I will send a patch to enable it for testing
> coverage.
>
>> Disabling CONFIG_CPU_IDLE in multi_v7_defconfig allows
>> this to start booting again on my wandboard quad, so I think there is
>> something wrong with the cpuidle changes.
>
> I just tracked down the issue, and sent a fix like below.
Thanks for the quick fix.
> The kernelci.org boot automation farm helps. Thanks.
Glad it's useful. We're doing a build/boot test of your fix now, and
will keep you updated.
In the mean time...,
> ----8<-------------------------------
> From 056a5da1b56a057762eccd52b5b6b920c7f56b14 Mon Sep 17 00:00:00 2001
> From: Shawn Guo <shawn.guo@linaro•org>
> Date: Wed, 29 Apr 2015 13:07:03 +0800
> Subject: [PATCH] ARM: imx6: initialize CCM_CLPCR_LPM into RUN mode earlier
>
> Commit 4631960d26da ("ARM: imx6: set initial power mode in pm function")
> moves imx6_set_lpm() from clock init function into
> imx6_pm_common_init(). This causes a hang when cpuidle support is
> enabled. The reason for that is ARM core clock is shut down
> unexpectedly by WAIT mode. It happens with the following call stack:
>
> cpuidle_register_governor()
> cpuidle_switch_governor()
> cpuidle_uninstall_idle_handler()
> synchronize_sched()
> wait_rcu_gp()
> wait_for_completion()
>
> When wait_for_completion() is called as above, all cores are idle/WFI.
> Hence, the reset value of CCM_CLPCR_LPM - WAIT mode, will trigger a
> hardware shutdown of the ARM core clock.
>
> To fix the regression, we need to ensure that CCM_CLPCR_LPM is
> initialized into RUN mode earlier than cpuidle governor registration,
> which is a postcore_initcall. This patch creates function
> imx6_pm_ccm_init() to map CCM block and initialize CCM_CLPCR_LPM into
> RUN mode, and have the function called from machine .init_irq hook,
> which should be early enough.
>
> Reported-by: Kevin Hilman <khilman@kernel•org>
> Fixes: 4631960d26da ("ARM: imx6: set initial power mode in pm function")
> Signed-off-by: Shawn Guo <shawn.guo@linaro•org>
...I did a quick test of this locally on my wandboard-quad, and it's now
booting with multi_v7_defconfig too.
Tested-by: Kevin Hilman <khilman@linaro•org>
next prev parent reply other threads:[~2015-04-29 16:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-26 14:31 [PATCH 00/11] ARM: imx: move clock drivers into drivers/clk Shawn Guo
2015-04-26 14:31 ` [PATCH 01/11] ARM: imx: use dynamic mapping for timer Shawn Guo
2015-04-26 14:31 ` [PATCH 02/11] ARM: imx: use dynamic mapping for CCM Shawn Guo
2015-04-26 19:45 ` Nicolae Rosia
2015-04-27 7:54 ` Shawn Guo
2015-04-26 14:31 ` [PATCH 03/11] ARM: imx: move revision definitions and declarations into a header Shawn Guo
2015-04-26 14:31 ` [PATCH 04/11] ARM: imx5: let pm code map CCM block on its own Shawn Guo
2015-04-26 14:31 ` [PATCH 05/11] ARM: imx6: set initial power mode in pm function Shawn Guo
2015-04-28 18:42 ` Kevin Hilman
2015-04-29 6:04 ` Shawn Guo
2015-04-29 16:35 ` Kevin Hilman [this message]
2015-04-30 15:22 ` Shawn Guo
2015-04-26 14:31 ` [PATCH 06/11] ARM: imx6: let pm code map CCM block on its own Shawn Guo
2015-04-26 14:31 ` [PATCH 07/11] ARM: imx6: do not use cpu_is_xxx() in clock driver Shawn Guo
2015-04-26 14:31 ` [PATCH 08/11] ARM: imx: add clk-pllv1 type support Shawn Guo
2015-04-26 14:31 ` [PATCH 09/11] ARM: imx: remove inclusions of platform headers Shawn Guo
2015-04-26 14:31 ` [PATCH 10/11] ARM: imx: move clock drivers into drivers/clk Shawn Guo
2015-05-01 18:34 ` Stephen Boyd
2015-04-26 14:31 ` [PATCH 11/11] MAINTAINERS: add new folders into IMX entry Shawn Guo
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=7h383ix57z.fsf@deeprootsystems.com \
--to=khilman@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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