Skip to contentSkip to conversation

arm: remove unused code in delay.S

PATCH Superseded Steve Chen 4 participants 13 messages Sep 18, 2009 – Sep 22, 2009 Arm (32-bit)

lore
Share & tools
lore

Steve Chen

author
#0 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

Document #if 0 code block in delay.S and make it selectable for compile.

---
 arch/arm/Kconfig     |   31 +++++++++++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..f44cb70 100644
@@ -813,6 +813,37 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

+config OLD_CPU_DELAY
+ depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+ bool "Different delay() code for some older CPUs"
+ def_bool n
+ help

+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.
+
+	  Lastly, below are 2 lists.  The first list contains the processors
+	  that would benefit from enabling this flag, and the second list
+	  contains processor that are known to have issues.  Please note that
+	  both lists are by no means complete.  Entries are expected to be
+	  added and refined.  If you like to update the list, please send a
+	  patch to Linux ARM mailing list.

+
+ CPUs should enable this flag
+ ARM610
+ ARM710
+
+ CPUs should disable this flag
+ StrongARM
endmenu

source "arch/arm/common/Kconfig"

arch/arm/lib/delay.S +1 -1
index 8d6a876..67e679b 100644
@@ -42,7 +42,7 @@ ENTRY(__const_udelay)				@ 0 <= r0 <= 0x7fffff06
 @ Delay routine
 ENTRY(__delay)
 		subs	r0, r0, #1
-#if 0
+#ifdef CONFIG_OLD_CPU_DELAY
 		movls	pc, lr
 		subs	r0, r0, #1
 		movls	pc, lr
#1 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

Quoted 16 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

---
 arch/arm/Kconfig     |   31 +++++++++++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..f44cb70 100644
@@ -813,6 +813,37 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register

arch/arm/Kconfig

Quoted 6 lines
arch/arm/Kconfig +4 -0
 	  may not be available in non-secure mode.
 
+config OLD_CPU_DELAY
+	depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+	bool "Different delay() code for some older CPUs"
+	def_bool n

IIRC it will be no by default

Best Regards,
J.

#2 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

In reply to Steve Chen

Hello Steve,

Quoted 16 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

---
 arch/arm/Kconfig     |   31 +++++++++++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..f44cb70 100644
@@ -813,6 +813,37 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register

arch/arm/Kconfig

Quoted 6 lines
arch/arm/Kconfig +4 -0
 	  may not be available in non-secure mode.
 
+config OLD_CPU_DELAY
+	depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+	bool "Different delay() code for some older CPUs"
+	def_bool n

as already noted, n is the default (that would better be expressed using "default n" btw).

Quoted 10 lines
arch/arm/Kconfig +10 -0
+	help
+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+

arch/arm/Kconfig

Quoted 10 lines
arch/arm/Kconfig +10 -0
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.
+
+	  Lastly, below are 2 lists.  The first list contains the processors
+	  that would benefit from enabling this flag, and the second list
+	  contains processor that are known to have issues.  Please note that
+	  both lists are by no means complete.  Entries are expected to be
+	  added and refined.  If you like to update the list, please send a
+	  patch to Linux ARM mailing list.

I'd delete the last three sentences.

arch/arm/Kconfig

Quoted 6 lines
arch/arm/Kconfig +6 -0
+	  CPUs should enable this flag
+		ARM610
+		ARM710
+
+	  CPUs should disable this flag
+		StrongARM

everything armv5+ ?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
author
#3 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

Quoted 21 lines · Uwe Kleine-K?nig

Hello Steve,

Quoted 18 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

---
 arch/arm/Kconfig     |   31 +++++++++++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..f44cb70 100644
@@ -813,6 +813,37 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

Quoted 6 lines

arch/arm/Kconfig

Quoted 4 lines
arch/arm/Kconfig +4 -0
+config OLD_CPU_DELAY
+	depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+	bool "Different delay() code for some older CPUs"
+	def_bool n

as already noted, n is the default (that would better be expressed using "default n" btw).

Jean-Christope/Uwe, I'll change it to "default n".

Quoted 14 lines
Quoted 14 lines
arch/arm/Kconfig +13 -0
+	help
+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.
Quoted 8 lines

arch/arm/Kconfig

Quoted 7 lines
arch/arm/Kconfig +7 -0
+
+	  Lastly, below are 2 lists.  The first list contains the processors
+	  that would benefit from enabling this flag, and the second list
+	  contains processor that are known to have issues.  Please note that
+	  both lists are by no means complete.  Entries are expected to be
+	  added and refined.  If you like to update the list, please send a
+	  patch to Linux ARM mailing list.

I'd delete the last three sentences.

Well, do. Anything after "Entries are expected to be..." will be deleted.

Quoted 8 lines

arch/arm/Kconfig

Quoted 7 lines
arch/arm/Kconfig +6 -0
+	  CPUs should enable this flag
+		ARM610
+		ARM710
+
+	  CPUs should disable this flag
+		StrongARM

everything armv5+ ?

If you know for sure, I'll add it. Since I don't know if that is true, I like to have some confirmation. Come to think of it, it may be a good idea to include the source of the info in the CPU list. I'll put

	ARM610 (rmk)
	ARM710 (rmk)

etc. in the next revision since the information was extracted from Russel's comments in this e-mail thread.

Quoted 4 lines

Best regards
Uwe

#4 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

Quoted 22 lines · Steve Chen
Quoted 21 lines · Uwe Kleine-K?nig

Hello Steve,

Quoted 18 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

---
 arch/arm/Kconfig     |   31 +++++++++++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 32 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..f44cb70 100644
@@ -813,6 +813,37 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

Quoted 8 lines
Quoted 6 lines

arch/arm/Kconfig

Quoted 4 lines
arch/arm/Kconfig +4 -0
+config OLD_CPU_DELAY
+	depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+	bool "Different delay() code for some older CPUs"
+	def_bool n

as already noted, n is the default (that would better be expressed using "default n" btw).

Jean-Christope/Uwe, I'll change it to "default n".

simply remove it will be better

Best Regards,
J.

Quoted 17 lines
Quoted 17 lines
Quoted 7 lines
arch/arm/Kconfig +5 -0
+	help
+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.

arch/arm/Kconfig

Quoted 10 lines
arch/arm/Kconfig +10 -0
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.
+
+	  Lastly, below are 2 lists.  The first list contains the processors

simply remove it will be better

Best Regards,
J.> > > + that would benefit from enabling this flag, and the second list

Quoted 6 lines
Quoted 5 lines

arch/arm/Kconfig

Quoted 4 lines
arch/arm/Kconfig +4 -0
+	  contains processor that are known to have issues.  Please note that
+	  both lists are by no means complete.  Entries are expected to be
+	  added and refined.  If you like to update the list, please send a
+	  patch to Linux ARM mailing list.

I'd delete the last three sentences.

Quoted 11 lines

Well, do. Anything after "Entries are expected to be..." will be deleted.

Quoted 8 lines

arch/arm/Kconfig

Quoted 7 lines
arch/arm/Kconfig +6 -0
+	  CPUs should enable this flag
+		ARM610
+		ARM710
+
+	  CPUs should disable this flag
+		StrongARM

everything armv5+ ?

IIRC StrongARM is armv4
ARM610 & 710 is armv3

Best Regards,
J.

author
#5 lore raw

PATCH v3 1/1 arm: remove unused code in delay.S

Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 1 line · Steve Chen

On Fri, 2009-09-18 at 21:09 +0200, Uwe Kleine-K?nig wrote:

...

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	def_bool n

as already noted, n is the default (that would better be expressed using "default n" btw).

Jean-Christope/Uwe, I'll change it to "default n".

simply remove it will be better

Sure, I can remove it altogether.

...

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.
+
+	  Lastly, below are 2 lists.  The first list contains the processors

simply remove it will be better

Remove the entire last paragraph? I guess the header of the list does explain everything. I'll remove it.

...

Quoted 10 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 7 lines
(quoted diff) +6 -0
+	  CPUs should enable this flag
+		ARM610
+		ARM710
+
+	  CPUs should disable this flag
+		StrongARM

everything armv5+ ?

IIRC StrongARM is armv4
ARM610 & 710 is armv3

If all armv4 are StrongARM, I can just remove it from the "depends" list. I'll need some help confirming. At this point, I'm not sure what else to change in this list.

Thanks for the inputs.

Steve

author
#6 lore raw

PATCH v4 1/1 arm: remove unused code in delay.S

In reply to Jean-Christophe PLAGNIOL-VILLARD

Document #if 0 code block in delay.S and make it selectable for compile.

---

 arch/arm/Kconfig     |   23 +++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 24 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..9a5a49a 100644
@@ -813,6 +813,29 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

+config OLD_CPU_DELAY
+ depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+ bool "Different delay() code for some older CPUs"
+ help

+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.

+
+ CPUs should enable this flag
+ ARM610 (rmk)
+ ARM710 (rmk)
+
+ CPUs should disable this flag
+ StrongARM (rmk)
endmenu

source "arch/arm/common/Kconfig"

arch/arm/lib/delay.S +1 -1
index 8d6a876..67e679b 100644
@@ -42,7 +42,7 @@ ENTRY(__const_udelay)				@ 0 <= r0 <= 0x7fffff06
 @ Delay routine
 ENTRY(__delay)
 		subs	r0, r0, #1
-#if 0
+#ifdef CONFIG_OLD_CPU_DELAY
 		movls	pc, lr
 		subs	r0, r0, #1
 		movls	pc, lr
#7 lore raw

PATCH v4 1/1 arm: remove unused code in delay.S

Hello Steve,

Quoted 11 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

I'm very surprised you added these Reviewed-by: tags.

IMO you should not add them without the explicit permission and request of the corresponding person. (That means that at least mine should not be there.)

Moreover Reviewed-by: has a meaning (described in
Documentation/SubmittingPatches).

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
author
#8 lore raw

PATCH v4 1/1 arm: remove unused code in delay.S

Quoted 14 lines · Uwe Kleine-K?nig

Hello Steve,

Quoted 11 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

Quoted 9 lines

I'm very surprised you added these Reviewed-by: tags.

IMO you should not add them without the explicit permission and request of the corresponding person. (That means that at least mine should not be there.)

Moreover Reviewed-by: has a meaning (described in
Documentation/SubmittingPatches).

My only intention was to give credit to all who contributed (at least try). I already sent out a patch with all Reviewed-by tags removed. I can add back in anyone who wish to be added.

Regards,

Steve

#9 lore raw

PATCH v4 1/1 arm: remove unused code in delay.S

2009/9/19 Steve Chen <[email protected]>:

Quoted 21 lines · Uwe Kleine-K?nig
Quoted 20 lines

Hello Steve,

Quoted 11 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

I'm very surprised you added these Reviewed-by: tags.

IMO you should not add them without the explicit permission and request of the corresponding person. ?(That means that at least mine should not be there.)

Quoted 7 lines
Quoted 3 lines

Moreover Reviewed-by: has a meaning (described in
Documentation/SubmittingPatches).

My only intention was to give credit to all who contributed (at least try). ?I already sent out a patch with all Reviewed-by tags removed. ?I can add back in anyone who wish to be added.

It's better to say:
Comments by Felipe Contreras, Jamie Lokier, Jean-Christophe, etc.

I did not review your patch, I merely provided the original one, and made some comments.

Cheers.

Signature · 1 line
Felipe Contreras
author
#10 lore raw

PATCH v4 1/1 arm: remove unused code in delay.S

Quoted 30 lines · Felipe Contreras

2009/9/19 Steve Chen <[email protected]>:

Quoted 21 lines · Uwe Kleine-K?nig
Quoted 20 lines

Hello Steve,

Quoted 11 lines · Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

I'm very surprised you added these Reviewed-by: tags.

IMO you should not add them without the explicit permission and request of the corresponding person. (That means that at least mine should not be there.)

Quoted 7 lines
Quoted 3 lines

Moreover Reviewed-by: has a meaning (described in
Documentation/SubmittingPatches).

My only intention was to give credit to all who contributed (at least try). I already sent out a patch with all Reviewed-by tags removed. I can add back in anyone who wish to be added.

Quoted 6 lines

It's better to say:
Comments by Felipe Contreras, Jamie Lokier, Jean-Christophe, etc.

I did not review your patch, I merely provided the original one, and made some comments.

If there are no objections by COB Monday (US PST), I'll resend the patch with the "Comments" line added.

Regards,

Steve

author
#11 lore raw

PATCH 1/1 arm: remove unused code in delay.S

In reply to Steve Chen

Document #if 0 code block in delay.S and make it selectable for compile.

---

 arch/arm/Kconfig     |   23 +++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 24 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..9a5a49a 100644
@@ -813,6 +813,29 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

+config OLD_CPU_DELAY
+ depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+ bool "Different delay() code for some older CPUs"
+ help

+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.

+
+ CPUs should enable this flag
+ ARM610 (rmk)
+ ARM710 (rmk)
+
+ CPUs should disable this flag
+ StrongARM (rmk)
endmenu

source "arch/arm/common/Kconfig"

arch/arm/lib/delay.S +1 -1
index 8d6a876..67e679b 100644
@@ -42,7 +42,7 @@ ENTRY(__const_udelay)				@ 0 <= r0 <= 0x7fffff06
 @ Delay routine
 ENTRY(__delay)
 		subs	r0, r0, #1
-#if 0
+#ifdef CONFIG_OLD_CPU_DELAY
 		movls	pc, lr
 		subs	r0, r0, #1
 		movls	pc, lr
author
#12 lore raw

PATCH v5 1/1 arm: remove unused code in delay.S

Document #if 0 code block in delay.S and make it selectable for compile.

Comments by
Felipe Contreras <[email protected]> Jamie Lokier <[email protected]> Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Krzysztof Halasa <[email protected]>
Marek Vasut <[email protected]>
Pavel Machek <[email protected]>
Sergei Shtylyov <[email protected]>
Uwe Kleine-K?nig <[email protected]>

---

 arch/arm/Kconfig     |   23 +++++++++++++++++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 24 insertions(+), 1 deletions(-)
arch/arm/Kconfig +0 -0
index aef63c8..9a5a49a 100644
@@ -813,6 +813,29 @@ config ARM_ERRATA_460075
 	  ACTLR register. Note that setting specific bits in the ACTLR

register
may not be available in non-secure mode.

+config OLD_CPU_DELAY
+ depends on CPU_32v3 || CPU_32v4 || CPU_32v4T
+ bool "Different delay() code for some older CPUs"
+ help

+	  Enable this if observing longer than expected delays.  This code
+	  improves delay accuracy for some CPUs.  However, it can also cause
+	  delay duration to be too short for others which leads to stability
+	  issues.
+
+	  In other words, do not enable unless you can guarantee that the
+	  processor (or ALL of the processors if building a generic kernel)
+	  delays for at least the time requested after enabling.
+
+	  ARM610 and ARM710 are known to benefit from enabling this option.
+	  It should not be enabled for StrongARMs, because it is known
+	  to produce too short delays on those.

+
+ CPUs should enable this flag
+ ARM610 (rmk)
+ ARM710 (rmk)
+
+ CPUs should disable this flag
+ StrongARM (rmk)
endmenu

source "arch/arm/common/Kconfig"

arch/arm/lib/delay.S +1 -1
index 8d6a876..67e679b 100644
@@ -42,7 +42,7 @@ ENTRY(__const_udelay)				@ 0 <= r0 <= 0x7fffff06
 @ Delay routine
 ENTRY(__delay)
 		subs	r0, r0, #1
-#if 0
+#ifdef CONFIG_OLD_CPU_DELAY
 		movls	pc, lr
 		subs	r0, r0, #1
 		movls	pc, lr