* [PATCH] ARM: ux500: Fix regression while init PM domains
@ 2017-10-06 4:20 Ulf Hansson
2017-10-08 23:31 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2017-10-06 4:20 UTC (permalink / raw)
To: Linus Walleij, Arnd Bergmann, arm
Cc: linux-pm, linux-arm-kernel, Ulf Hansson, Thara Gopinath,
Rafael J. Wysocki
The commit afece3ab9a36 ("PM / Domains: Add time accounting to various
genpd states") causes a boot regression for ux500.
The problem occurs when the ux500 machine code calls pm_genpd_init(), which
since the above change triggers a call to ktime_get(). More precisely,
because ux500 initializes PM domains in the init_IRQ() phase of the boot,
timekeeping has not yet been initialized.
Fix the problem by moving the initialization of the PM domains to after
timekeeping has been initialized.
Fixes: afece3ab9a36 ("PM / Domains: Add time accounting to various genpd..")
Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
Note, since the commit afece3ab9a36 ("PM / Domains: Add time accounting to
various genpd states") potentially could cause similar problems for other SoCs,
I have walked through the callers of pm_genpd_init(). At this point I couldn't
find any other SoC having these problems.
Kind regards
Uffe
---
arch/arm/mach-ux500/cpu-db8500.c | 4 ++++
arch/arm/mach-ux500/pm.c | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 71a34e8..57058ac 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -32,6 +32,7 @@
#include <asm/mach/arch.h>
#include "db8500-regs.h"
+#include "pm_domains.h"
static int __init ux500_l2x0_unlock(void)
{
@@ -157,6 +158,9 @@ static const struct of_device_id u8500_local_bus_nodes[] = {
static void __init u8500_init_machine(void)
{
+ /* Initialize ux500 power domains */
+ ux500_pm_domains_init();
+
/* automatically probe child nodes of dbx5x0 devices */
if (of_machine_is_compatible("st-ericsson,u8540"))
of_platform_populate(NULL, u8500_local_bus_nodes,
diff --git a/arch/arm/mach-ux500/pm.c b/arch/arm/mach-ux500/pm.c
index a970e7f..f6c33a0 100644
--- a/arch/arm/mach-ux500/pm.c
+++ b/arch/arm/mach-ux500/pm.c
@@ -19,7 +19,6 @@
#include <linux/of_address.h>
#include "db8500-regs.h"
-#include "pm_domains.h"
/* ARM WFI Standby signal register */
#define PRCM_ARM_WFI_STANDBY (prcmu_base + 0x130)
@@ -203,7 +202,4 @@ void __init ux500_pm_init(u32 phy_base, u32 size)
/* Set up ux500 suspend callbacks. */
suspend_set_ops(UX500_SUSPEND_OPS);
-
- /* Initialize ux500 power domains */
- ux500_pm_domains_init();
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: ux500: Fix regression while init PM domains
2017-10-06 4:20 [PATCH] ARM: ux500: Fix regression while init PM domains Ulf Hansson
@ 2017-10-08 23:31 ` Linus Walleij
2017-10-19 15:46 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2017-10-08 23:31 UTC (permalink / raw)
To: Ulf Hansson, arm@kernel.org
Cc: Arnd Bergmann, linux-pm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, Thara Gopinath,
Rafael J. Wysocki
On Fri, Oct 6, 2017 at 6:20 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> The commit afece3ab9a36 ("PM / Domains: Add time accounting to various
> genpd states") causes a boot regression for ux500.
>
> The problem occurs when the ux500 machine code calls pm_genpd_init(), which
> since the above change triggers a call to ktime_get(). More precisely,
> because ux500 initializes PM domains in the init_IRQ() phase of the boot,
> timekeeping has not yet been initialized.
>
> Fix the problem by moving the initialization of the PM domains to after
> timekeeping has been initialized.
>
> Fixes: afece3ab9a36 ("PM / Domains: Add time accounting to various genpd..")
> Cc: Thara Gopinath <thara.gopinath@linaro.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
ARM SoC folks: please apply this directly for fixes!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ARM: ux500: Fix regression while init PM domains
2017-10-08 23:31 ` Linus Walleij
@ 2017-10-19 15:46 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-10-19 15:46 UTC (permalink / raw)
To: Linus Walleij
Cc: Ulf Hansson, arm@kernel.org, Thara Gopinath, Rafael J. Wysocki,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
On Mon, Oct 9, 2017 at 1:31 AM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Fri, Oct 6, 2017 at 6:20 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
>> The commit afece3ab9a36 ("PM / Domains: Add time accounting to various
>> genpd states") causes a boot regression for ux500.
>>
>> The problem occurs when the ux500 machine code calls pm_genpd_init(), which
>> since the above change triggers a call to ktime_get(). More precisely,
>> because ux500 initializes PM domains in the init_IRQ() phase of the boot,
>> timekeeping has not yet been initialized.
>>
>> Fix the problem by moving the initialization of the PM domains to after
>> timekeeping has been initialized.
>>
>> Fixes: afece3ab9a36 ("PM / Domains: Add time accounting to various genpd..")
>> Cc: Thara Gopinath <thara.gopinath@linaro.org>
>> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> ARM SoC folks: please apply this directly for fixes!
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-19 15:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-06 4:20 [PATCH] ARM: ux500: Fix regression while init PM domains Ulf Hansson
2017-10-08 23:31 ` Linus Walleij
2017-10-19 15:46 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).