From patchwork Fri Oct 6 04:20:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 115023 Delivered-To: patches@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1331186qgn; Thu, 5 Oct 2017 21:20:37 -0700 (PDT) X-Received: by 10.46.75.18 with SMTP id y18mr318154lja.113.1507263637141; Thu, 05 Oct 2017 21:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507263637; cv=none; d=google.com; s=arc-20160816; b=RN2FPJJQLWoEcwS5qVSfBkJtL+HE/omPSr+UP+fSGzVblwJp5ohtXz/7fSFQiu8wR8 KCsIWkZFvVSgChiTQrQzK0TKfXCKU19EKYSaqDTg3HVR9stLhylwNXUz8MuY3cJ5gv61 ggqKXXwBHHIndFUQu1fN4UvD3ImPcKDo98dPxs0cVG69PgymFo5OLX1JUb5zBXJQ5uJP hG8MX3XTXIes0UddjoeKcpl224nONWAQBvwvWqvQV0hBkZ2rq74KUGFpNCjc2CEnZxNF oMLZSqsUatddvXA+I59isdbT0FUr2Y8Pkx1zlwK4wybf4MJ/arm72IA5Qhcd/AHSygWv r1VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=IruMBmRsebCHSl/s7fv9vWLvFPAbFPPGNYYESET3R6I=; b=WEYdShv49skogxkbS7p78cCKIOjoTOKizcyYDD7DaV1ykZ4+2J+dgCtqX42/lM58Ft ZU7JxAvdX3pnjDmpWMwN5sjOrajiM+ObyTtxHWN0/cafsvLVKJe6w3uQFeSWCai34IVY Mbgd5mRXwBg3QJwYabR4o3RPumerJf6vG4hbrBi+sJzByBRimQ/1ySXYb+kuvRb9QSxe pXEq0sHVHJBe83s/Y6mSkvuOKIe/TwRbd76ZtYbjw30V3eNt2g2ahk+ntxcueI/Xk3oL R25U+LARFfdE0cEQMCyQ9TJ7ZcHwb0MLS/qnF5GQHgE9HcTHs6+fxuX2yT5Sll5p1DVl dWnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F81HHs8K; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id p65sor74565lja.47.2017.10.05.21.20.36 for (Google Transport Security); Thu, 05 Oct 2017 21:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F81HHs8K; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IruMBmRsebCHSl/s7fv9vWLvFPAbFPPGNYYESET3R6I=; b=F81HHs8KxsjsjgHLUA/45UH7QRlTdHs0qIx3eMF/Vj9wjVKCskU9W2QD4yEmpg2jja gKLO5ZFZOxUwr+wYZw3klOFoQZ8CRLEQY+WCv3BZWxUdvoWyf+3GJRLjcQQXCrW1oAWu Uc8xSme/0QVTNnwRw2nw6a4nVbikExh7uX5Ho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=IruMBmRsebCHSl/s7fv9vWLvFPAbFPPGNYYESET3R6I=; b=NELNKaPWZ/z8LaWb2ppMJyNOBGuiUjFAt/S5+dflkWx3UA44S5fQYNPIsOOJMF/IL2 96dLRcrAE1kteQzrd/dYbwZ3q9fw6WF13YvlTt7RsdVvYecb1/Ja/1/n+QYZTTba2Hwo 6anHyh9mTtfJtIuL24aVX56o9WzXQiMu3KQEDVOz2bm+lidvuc8AdDAe2SyTVC5lfse1 1TSuCW4A1UHYyFbqLvqErgsPx4YsRMg6y205n21ybwR4LmBv1tQei9q+SaxFenXqgWDD xNrDbYGIKfuqNUVAHyjo1m9dQ4bgSnDww50tPV3436QNNJcASDOdDjIbePsmH+MhdtuM uIFA== X-Gm-Message-State: AMCzsaWVydfshlCGw0eOT/EGcgqeWhrufyOnexVU4gXhwC0PHvRFDt1a PsIX9mQIj+cnCgSyyP/b+9KIPh5O X-Google-Smtp-Source: AOwi7QA2Q1sg6h2iCag8CnkZOQNry9syc7VU7Zihh81R0G4fc+vkNGNNeKjRb7QIdYfcGqnW0EZ2Gw== X-Received: by 10.46.84.13 with SMTP id i13mr165850ljb.60.1507263636533; Thu, 05 Oct 2017 21:20:36 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-67.NA.cust.bahnhof.se. [158.174.22.67]) by smtp.gmail.com with ESMTPSA id j63sm96813lfi.80.2017.10.05.21.20.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Oct 2017 21:20:35 -0700 (PDT) From: Ulf Hansson To: Linus Walleij , Arnd Bergmann , arm@kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ulf Hansson , Thara Gopinath , "Rafael J. Wysocki" Subject: [PATCH] ARM: ux500: Fix regression while init PM domains Date: Fri, 6 Oct 2017 06:20:25 +0200 Message-Id: <1507263625-16756-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 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 Cc: "Rafael J. Wysocki" Signed-off-by: Ulf Hansson --- 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(-) -- 2.7.4 Reviewed-by: Linus Walleij 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 #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 #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(); }