From patchwork Thu Jan 31 15:30:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 2074131 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 58C17DF2E5 for ; Thu, 31 Jan 2013 15:30:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753942Ab3AaPad (ORCPT ); Thu, 31 Jan 2013 10:30:33 -0500 Received: from utopia.booyaka.com ([74.50.51.50]:52352 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751886Ab3AaPad (ORCPT ); Thu, 31 Jan 2013 10:30:33 -0500 Received: (qmail 28677 invoked by uid 1019); 31 Jan 2013 15:30:32 -0000 Date: Thu, 31 Jan 2013 15:30:32 +0000 (UTC) From: Paul Walmsley To: Hebbar Gururaja cc: tony@atomide.com, b-cousson@ti.com, khilman@deeprootsystems.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com, sudhakar.raj@ti.com, linux@arm.linux.org.uk, hvaibhav@ti.com, vaibhav.bedia@ti.com, Koen Kooi Subject: Re: [Patch v2 2/2] ARM: OMAP2: am33xx-hwmod: Fix "register offset NULL check" bug In-Reply-To: <1359642327-5542-3-git-send-email-gururaja.hebbar@ti.com> Message-ID: References: <1359642327-5542-1-git-send-email-gururaja.hebbar@ti.com> <1359642327-5542-3-git-send-email-gururaja.hebbar@ti.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org + Koen Hi On Thu, 31 Jan 2013, Hebbar Gururaja wrote: > am33xx_cm_wait_module_ready() checks if register offset is NULL. > > int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs) > { > int i = 0; > > if (!clkctrl_offs) > return 0; > > In case of AM33xx, CLKCTRL register offset for different clock domains > are not uniformly placed. An example of this would be the RTC clock > domain with CLKCTRL offset at 0x00. > In such cases the module ready check is skipped which leads to a data > abort during boot-up when RTC registers is accessed. > > Remove this check here to avoid checking module readiness for modules > with clkctrl register offset at 0x00. > > Signed-off-by: Hebbar Gururaja Some text has been added to the patch description to describe Koen's test results, and the updated patch has been queued for v3.8-rc fixes. Updated patch follows. - Paul From: Hebbar Gururaja Date: Thu, 31 Jan 2013 19:55:27 +0530 Subject: [PATCH] ARM: OMAP2: am33xx-hwmod: Fix "register offset NULL check" bug am33xx_cm_wait_module_ready() checks if register offset is NULL. int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs) { int i = 0; if (!clkctrl_offs) return 0; In case of AM33xx, CLKCTRL register offset for different clock domains are not uniformly placed. An example of this would be the RTC clock domain with CLKCTRL offset at 0x00. In such cases the module ready check is skipped which leads to a data abort during boot-up when RTC registers is accessed. Remove this check here to avoid checking module readiness for modules with clkctrl register offset at 0x00. Koen Kooi notes that this patch fixes a crash on boot with CONFIG_RTC_DRV_OMAP=y with v3.8-rc5. Signed-off-by: Hebbar Gururaja Cc: Koen Kooi [paul@pwsan.com: noted Koen's test in the patch description] Signed-off-by: Paul Walmsley --- arch/arm/mach-omap2/cm33xx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index 058ce3c..325a515 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -241,9 +241,6 @@ int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, u16 clkctrl_offs) { int i = 0; - if (!clkctrl_offs) - return 0; - omap_test_timeout(_is_module_ready(inst, cdoffs, clkctrl_offs), MAX_MODULE_READY_TIME, i);