Skip to contentSkip to conversation

OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

PATCH In review Hema HK 2 participants 3 messages Sep 23, 2010 – Sep 24, 2010

Subsystems (4)
lore
Share & tools
lore

Hema HK

author
#0 lore raw

PATCH 1/1 OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

OMAP USBOTG module has a requirement to set the autoidle bit only after setting smartidle bit. Modified the _sys_enable api to set the smartidle first and then the autoidle bit. Setting this will not have any impact on the other modules.

Cc Felipe Balbi <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Cousson, Benoit <[email protected]>
Cc Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +12 -6
Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c
===================================================================
@@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwm
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	if (sf & SYSC_HAS_AUTOIDLE) {
-		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
-			0 : 1;
-		_set_module_autoidle(oh, idlemode, &v);
-	}
-
 	/* XXX OCP ENAWAKEUP bit? */
 
 	/*
@@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwm
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the autoidle bit only after setting the smartidle bit
+	 * as this is requirement for some modules like USBOTG.
+	 * Setting this will not have any impact on the other modules.
+	 */
+	if (sf & SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode, &v);
+		_write_sysconfig(v, oh);
+	}
 }
 
 /**
#1 lore raw

Paul,

Quoted 9 lines

-----Original Message-----
From: Kalliguddi, Hema
Sent: Friday, September 24, 2010 9:17 AM
To: [email protected]
Cc: Kalliguddi, Hema; Basak, Partha; Balbi, Felipe; Tony Lindgren; Kevin Hilman; Cousson, Benoit; Paul Walmsley
Subject: [PATCH] OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

Quoted 7 lines

OMAP USBOTG module has a requirement to set the autoidle bit only after setting smartidle bit. Modified the _sys_enable api to set the smartidle
first and then the autoidle bit. Setting this will not have any impact on the
other modules.

Review comments from Benoit and Sergie are fixed in this patch. Benoit acked the older version of the patch and you had asked me re-post with Review comments incorporated.

http://www.mail-archive.com/[email protected]/msg35464.html

Quoted 48 lines
Cc Felipe Balbi <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Cousson, Benoit <[email protected]>
Cc Paul Walmsley <[email protected]>

---
arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++++++++------

1 file changed, 12 insertions(+), 6 deletions(-)

Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c
===================================================================

arch/arm/mach-omap2/omap_hwmod.c +12 -6
@@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwm
 		_set_master_standbymode(oh, idlemode, &v);
 	}
 
-	if (sf & SYSC_HAS_AUTOIDLE) {
-		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
-			0 : 1;
-		_set_module_autoidle(oh, idlemode, &v);
-	}
-
 	/* XXX OCP ENAWAKEUP bit? */
 
 	/*
@@ -672,6 +666,18 @@ static void _sysc_enable(struct omap_hwm
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the autoidle bit only after setting the smartidle bit
+	 * as this is requirement for some modules like USBOTG.
+	 * Setting this will not have any impact on the other modules.
+	 */
+	if (sf & SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode, &v);
+		_write_sysconfig(v, oh);
+	}
 }
 
 /**
maintainer
#2 lore raw
In reply to Hema HK

Hello Hema,

Quoted 5 lines · Hema HK

OMAP USBOTG module has a requirement to set the autoidle bit only after setting smartidle bit. Modified the _sys_enable api to set the smartidle first and then the autoidle bit. Setting this will not have any impact on the other modules.

Quoted 7 lines
Cc Felipe Balbi <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc Cousson, Benoit <[email protected]>
Cc Paul Walmsley <[email protected]>

Thanks, added Benoît's ack, updated this to apply after Rajendra's ENAWAKEUP patch, and queued for 2.6.37.

- Paul