Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: OMAP2: hwmod: Fix "register offset NULL check" bug
@ 2012-12-18 12:56 Hebbar Gururaja
  2012-12-18 12:55 ` Felipe Balbi
  2012-12-19  2:13 ` Paul Walmsley
  0 siblings, 2 replies; 8+ messages in thread
From: Hebbar Gururaja @ 2012-12-18 12:56 UTC (permalink / raw)
  To: linux-arm-kernel

From: "Hebbar, Gururaja" <gururaja.hebbar@ti.com>

omap4_cminst_wait_module_ready() checks if register offset is NULL.

int omap4_cminst_wait_module_ready(u8 part, 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.

Since the actual base address is verified in
omap4_cminst_read_inst_reg(), this check here is not required at all
and hence can be removed.

Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
---
Changes in v2:
	- update commit message to reflect the actual cause. Previous
	message conveyed a wrong/opposite message.

:100644 100644 7f9a464... 40545ff... M	arch/arm/mach-omap2/cminst44xx.c
 arch/arm/mach-omap2/cminst44xx.c |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c
index 7f9a464..40545ff 100644
--- a/arch/arm/mach-omap2/cminst44xx.c
+++ b/arch/arm/mach-omap2/cminst44xx.c
@@ -271,9 +271,6 @@ int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs,
 {
 	int i = 0;
 
-	if (!clkctrl_offs)
-		return 0;
-
 	omap_test_timeout(_is_module_ready(part, inst, cdoffs, clkctrl_offs),
 			  MAX_MODULE_READY_TIME, i);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-31  5:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 12:56 [PATCH v2] ARM: OMAP2: hwmod: Fix "register offset NULL check" bug Hebbar Gururaja
2012-12-18 12:55 ` Felipe Balbi
2012-12-19  2:13 ` Paul Walmsley
2012-12-20  4:20   ` Hebbar, Gururaja
2012-12-20  7:35     ` Paul Walmsley
2013-01-30 14:07       ` Hebbar, Gururaja
2013-01-30 16:39         ` Paul Walmsley
2013-01-31  5:25           ` Hebbar, Gururaja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox