Skip to contentSkip to conversation

OMAP: Hwmod api changes

PATCH In review Hema HK 5 participants 6 messages Sep 22, 2010 – Sep 23, 2010 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore

Hema HK

author
#0 lore raw

PATCH v3 7/9 OMAP: Hwmod api changes

OMAP USBOTG modules has a requirement to set the auto idle bit only after setting smart idle bit. Modified the _sys_enable api to set the smart idle 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 +13 -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,19 @@ static void _sysc_enable(struct omap_hwm
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the auto idle 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 modues.
+	 */
+
+	if (sf & SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags & HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode, &v);
+	}
+	_write_sysconfig(v, oh);
 }
 
 /**

A message that is not in the archive (sent off-list or not yet received): 1285201816-26516-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org

#2 lore raw

Hello.

Quoted 20 lines · Hema HK

OMAP USBOTG modules has a requirement to set the auto idle bit only after setting smart idle bit. Modified the _sys_enable api to set the smart idle 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(-)

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

arch/arm/mach-omap2/omap_hwmod.c +0 -0

[...]

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 672

Quoted 8 lines
arch/arm/mach-omap2/omap_hwmod.c +4 -0
@@ -672,6 +666,19 @@ static void _sysc_enable(struct omap_hwm
 		_set_clockactivity(oh, oh->class->sysc->clockact, &v);
 
 	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the auto idle bit only after setting the smartidle bit
+	 * as this is requirement for some modules like USBOTG

Need period at the end of sentense, and the next sentense should satrt with
capital letter. Sorry for the grammar nitpicking. :-)

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 674

Quoted 2 lines
arch/arm/mach-omap2/omap_hwmod.c +2 -0
+	 * setting this will not have any impact on the other modues.
+	 */

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to a message not in the archive

Hello Hema,

Quoted 4 lines · Hema HK

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

Please incorporate the comments from Benoît and Sergei and post this patch separately from your other MUSB patches, and we'll try to get it in for 2.6.37.

- Paul

Acked-by on v3 7/9
#4 lore raw
In reply to Hema HK

Hi Hema,

Quoted 4 lines · Hema

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

I think you should change the subject, because it does not reflect accurately the patch.

Just a little bit of nitpicking...
For me, an API change is a change in the signature of the API, not a change inside an API. Otherwise, since 99% of the code is inside a function, we can call most patches like that... Moreover I don't think _sysc_enable can be considered as an API since it is a pure static helper function not exported to the outside.

Something like that seems more accurate for my point of view:

OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

Quoted 30 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 +0 -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? */
 
  	/*

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 671

Quoted 6 lines
arch/arm/mach-omap2/omap_hwmod.c +3 -0
@@ -672,6 +666,19 @@ static void _sysc_enable(struct omap_hwm
  		_set_clockactivity(oh, oh->class->sysc->clockact,&v);
 
  	_write_sysconfig(v, oh);
+
+	/*
+	 * Set the auto idle bit only after setting the smartidle bit

Typo: autoidle without space

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 672

Quoted 1 line
arch/arm/mach-omap2/omap_hwmod.c +1 -0
+	 * as this is requirement for some modules like USBOTG

The new official name is usb_otg_hs.

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 673

Quoted 1 line
arch/arm/mach-omap2/omap_hwmod.c +1 -0
+	 * setting this will not have any impact on the other modues.

Typo: modules

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 675

Quoted 2 lines
arch/arm/mach-omap2/omap_hwmod.c +2 -0
+	 */
+

You can remove that blank line.

arch/arm/mach-omap2/omap_hwmod.c static void _sysc_enable(struct omap_hwm · line 681

Quoted 6 lines
arch/arm/mach-omap2/omap_hwmod.c +6 -0
+	if (sf&  SYSC_HAS_AUTOIDLE) {
+		idlemode = (oh->flags&  HWMOD_NO_OCP_AUTOIDLE) ?
+			0 : 1;
+		_set_module_autoidle(oh, idlemode,&v);
+	}
+	_write_sysconfig(v, oh);

You should move that inside the if, it will save an useless call in case SYSC_HAS_AUTOIDLE is not set.

Beside these minors comments this patch looks fine to me.

I had some concern about the extra overhead added for every IPs that does not need that at all, meaning every IPs beside the usb_otg_hs...

But then I realized that autoidle is anyway enabled by default, and since the sysconfig value is cached, it should not generate any write access to most IPs that will not try to disable the autoidle.

Regards,
Benoit

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 18 lines · Benoit

Hi Hema,

Quoted 4 lines · Hema

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

I think you should change the subject, because it does not reflect accurately the patch.

Just a little bit of nitpicking...
For me, an API change is a change in the signature of the API, not a change inside an API. Otherwise, since 99% of the code is inside a function, we can call most patches like that...
Moreover I don't think _sysc_enable can be considered as an API since it is a pure static helper function not exported to the outside.

Quoted 3 lines

Something like that seems more accurate for my point of view:

OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

+1

Signature · 5 lines
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

Hi,

Quoted 29 lines

-----Original Message-----
From: Balbi, Felipe
Sent: Thursday, September 23, 2010 11:53 AM
To: Cousson, Benoit
Cc: Kalliguddi, Hema; [email protected]; [email protected]; Basak, Partha; Balbi, Felipe; Tony Lindgren; Kevin Hilman; Paul Walmsley
Subject: Re: [PATCH 7/9 v3] OMAP: Hwmod api changes

Quoted 4 lines · Benoit

Hi Hema,

Quoted 1 line · Hema

OMAP USBOTG modules has a requirement to set the auto idle

bit only after

Quoted 1 line
Quoted 1 line

setting smart idle bit. Modified the _sys_enable api to set

the smart idle

Quoted 1 line
Quoted 1 line

first and then the autoidle bit. Setting this will not have

any impact on the

Quoted 10 lines
Quoted 1 line

other modules.

I think you should change the subject, because it does not reflect accurately the patch.

Just a little bit of nitpicking...
For me, an API change is a change in the signature of the API, not a change inside an API. Otherwise, since 99% of the code is inside a function, we can call most patches like that...
Moreover I don't think _sysc_enable can be considered as an

Quoted 9 lines

API since it

Quoted 5 lines

is a pure static helper function not exported to the outside.

Something like that seems more accurate for my point of view:

OMAP: hwmod: Set autoidle after smartidle during _sysc_enable

+1

I Agree. I will do the changes accordingly and post the patch.

Quoted 3 lines
Signature · 1 line
balbi