From patchwork Mon Oct 22 20:33:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 1627891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 0EA47DF2F6 for ; Mon, 22 Oct 2012 20:41:04 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQOmU-0007Ir-Nw; Mon, 22 Oct 2012 20:39:27 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQOmQ-0007Hg-LQ for linux-arm-kernel@lists.infradead.org; Mon, 22 Oct 2012 20:39:23 +0000 Received: by mail-pb0-f49.google.com with SMTP id xa7so2145804pbc.36 for ; Mon, 22 Oct 2012 13:39:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=JGf68hSclzkqDxFf8YnlNzbVmPud/bWcNek03DFLaAA=; b=j+5zJsMxFcJRx8qD1quQPnvBS22Tg/G+K2EBn6J55zdhmztUk1ZqVvSxqDHuli3nGZ Rbs6doF3sLOu43W50Q+fE/xi0QZSINjRSYKPU3eScYsgzM+V7b/QmfHjYBRE6BG1b9be XwgZ0ZmrHD/9hbmxOMBYkgYFGfFmaHM/+H1KsClH847Ty5xcfj5cFqSHMG2zY9QtsYvw dk5yLc386VvYo35Fx3wjoZ/HQ7iLLjNL6hURYSdJZOw2lg3OH2YDA64kFa+VVvCkXwh4 ak6MGcG1KyxjNJI8PoF5OZNtF2z1Hzb26JCi06MR0qxeZz6O1RzF6fmiNxlLxPNmUtEX iy9A== Received: by 10.66.73.6 with SMTP id h6mr28876822pav.69.1350938011291; Mon, 22 Oct 2012 13:33:31 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPS id o7sm6425312pay.14.2012.10.22.13.33.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 13:33:30 -0700 (PDT) From: Kevin Hilman To: linux-omap@vger.kernel.org, Paul Walmsley Subject: [PATCH] ARM: OMAP3: Beagle: fix OPP customization and initcall ordering Date: Mon, 22 Oct 2012 13:33:29 -0700 Message-Id: <1350938009-22716-1-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.8.0 X-Gm-Message-State: ALoCoQn7w5slr3WMQ3jzAUEwpf+/aqtPz/Zh7620JW4dHiFf/aiJFEjii6viLr2z/58NPp3Idi3K X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kevin Hilman After commit 24d7b40a60cf19008334bcbcbd98da374d4d9c64 (ARM: OMAP2+: PM: MPU DVFS: use generic CPU device for MPU-SS), OPPs are registered using an existing CPU device, not the omap_device for MPU-SS. First, fix the board file to use get_cpu_device() as required by the above commit, otherwise custom OPPs will be added to the wrong device. Second, the board files OPP init is called from the its init_machine method, and the generic CPU devices are not yet created when init_machine is run. Therefore OPP initialization will fail. To fix, use a device_initcall() for the board file's OPP customization. Reported-by: Paul Walmsley Signed-off-by: Kevin Hilman --- Tony, unless there are objections, I'll add this to a series of PM related fixes I have left for v3.7-rc. arch/arm/mach-omap2/board-omap3beagle.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 388c431..befad2a 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -444,12 +445,13 @@ static struct omap_board_mux board_mux[] __initdata = { }; #endif -static void __init beagle_opp_init(void) +static int __init beagle_opp_init(void) { int r = 0; - /* Initialize the omap3 opp table */ - if (omap3_opp_init()) { + /* Initialize the omap3 opp table if not already created. */ + r = omap3_opp_init(); + if (IS_ERR_VALUE(r) && (r != -EEXIST)) { pr_err("%s: opp default init failed\n", __func__); return; } @@ -458,13 +460,13 @@ static void __init beagle_opp_init(void) if (cpu_is_omap3630()) { struct device *mpu_dev, *iva_dev; - mpu_dev = omap_device_get_by_hwmod_name("mpu"); + mpu_dev = get_cpu_device(0); iva_dev = omap_device_get_by_hwmod_name("iva"); if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", __func__, mpu_dev, iva_dev); - return; + return -ENODEV; } /* Enable MPU 1GHz and lower opps */ r = opp_enable(mpu_dev, 800000000); @@ -484,8 +486,9 @@ static void __init beagle_opp_init(void) opp_disable(iva_dev, 660000000); } } - return; + return 0; } +device_initcall(beagle_opp_init); static void __init omap3_beagle_init(void) { @@ -522,8 +525,6 @@ static void __init omap3_beagle_init(void) /* Ensure SDRC pins are mux'd for self-refresh */ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); - - beagle_opp_init(); } MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")