From patchwork Tue Jan 6 02:04:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 5571131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4171ABF6C3 for ; Tue, 6 Jan 2015 02:07:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4DB0E20320 for ; Tue, 6 Jan 2015 02:07:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 238EA20306 for ; Tue, 6 Jan 2015 02:07:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y8JWC-0005yi-QU; Tue, 06 Jan 2015 02:05:12 +0000 Received: from utopia.booyaka.com ([74.50.51.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y8JW7-0004iL-Jm for linux-arm-kernel@lists.infradead.org; Tue, 06 Jan 2015 02:05:08 +0000 Received: (qmail 31041 invoked by uid 1019); 6 Jan 2015 02:04:45 -0000 Date: Tue, 6 Jan 2015 02:04:45 +0000 (UTC) From: Paul Walmsley To: Lokesh Vutla , Roger Quadros Subject: Re: [PATCH] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc In-Reply-To: <54AA4CD4.40105@ti.com> Message-ID: References: <1418917790-1791-1-git-send-email-rogerq@ti.com> <5492F84E.7020706@ti.com> <54AA4CD4.40105@ti.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150105_180507_786324_73364223 X-CRM114-Status: GOOD ( 21.94 ) X-Spam-Score: -0.0 (/) Cc: nm@ti.com, tony@atomide.com, santosh.shilimkar@oracle.com, nsekhar@ti.com, linux-kernel@vger.kernel.org, t-kristo@ti.com, bcousson@baylibre.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Roger, Lokesh, could you try this one instead? It passes all the basic tests here except it does not boot on the 4460 VAR-SOM-OM - unclear why at this point - but it would be good to see if it works on your AM4372 boards, since I don't have that one. Test logs are here: http://www.pwsan.com/omap/testlogs/hwmod_skip_only_remap_v3.19-rc/20150105171744/ - Paul From 4f2e13bd2181e0ebede3aabc484aa2339830748a Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 5 Jan 2015 15:49:57 -0700 Subject: [PATCH] Only skip ioremap() if IP block does not have OCP header registers. Experimental. Acked-by: Roger Quadros --- arch/arm/mach-omap2/omap_hwmod.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index cbb908dc5cf0..03df8833d399 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1938,6 +1938,8 @@ static int _reset(struct omap_hwmod *oh) pr_debug("omap_hwmod: %s: resetting\n", oh->name); if (oh->class->reset) { + WARN(!oh->_mpu_rt_va, "Attempt to call custom reset with no MPU register target ioremapped: %s", + oh->name); r = oh->class->reset(oh); } else { if (oh->rst_lines_cnt > 0) { @@ -2358,15 +2360,19 @@ static int of_dev_hwmod_lookup(struct device_node *np, } /** - * _init_mpu_rt_base - populate the virtual address for a hwmod + * _init_mpu_rt_base - populate the MPU port and virtual address * @oh: struct omap_hwmod * to locate the virtual address * @data: (unused, caller should pass NULL) * @index: index of the reg entry iospace in device tree * @np: struct device_node * of the IP block's device node in the DT data * - * Cache the virtual address used by the MPU to access this IP block's - * registers. This address is needed early so the OCP registers that - * are part of the device's address space can be ioremapped properly. + * Cache the interconnect target port and the virtual address used by + * the MPU to access this IP block's registers. The address is needed + * early so the OCP registers that are part of the device's address + * space can be ioremapped properly. The presence or absence of the + * interconnect target port also indicates whether the hwmod code + * should wait for the IP block to indicate readiness after it is + * enabled. * * Returns 0 on success, -EINVAL if an invalid hwmod is passed, and * -ENXIO on absent or invalid register target address space. @@ -2385,6 +2391,13 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data, if (oh->_int_flags & _HWMOD_NO_MPU_PORT) return -ENXIO; + /* + * If there's no need for the hwmod code to read or write to + * the IP block registers, bail out early before the ioremap() + */ + if (!oh->class->sysc) + return 0; + mem = _find_mpu_rt_addr_space(oh); if (!mem) { pr_debug("omap_hwmod: %s: no MPU register target found\n", @@ -2451,14 +2464,10 @@ static int __init _init(struct omap_hwmod *oh, void *data) oh->name, np->name); } - if (oh->class->sysc) { - r = _init_mpu_rt_base(oh, NULL, index, np); - if (r < 0) { - WARN(1, "omap_hwmod: %s: doesn't have mpu register target base\n", - oh->name); - return 0; - } - } + r = _init_mpu_rt_base(oh, NULL, index, np); + if (r < 0) + pr_debug("omap_hwmod: %s: doesn't have mpu register target base\n", + oh->name); r = _init_clocks(oh, NULL); if (r < 0) {