lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1253089566.3273.152.camel@linux-1lbu>
Date:	Wed, 16 Sep 2009 03:26:06 -0500
From:	Steve Chen <schen@...sta.com>
To:	Krzysztof Halasa <khc@...waw.pl>
Cc:	Felipe Contreras <felipe.contreras@...il.com>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Jamie Lokier <jamie@...reable.org>,
	linux-kernel@...r.kernel.org, Marek Vasut <marek.vasut@...il.com>,
	Pavel Machek <pavel@....cz>,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] arm: remove unused code in delay.S

On Wed, 2009-09-16 at 00:47 +0200, Krzysztof Halasa wrote:
> Steve Chen <schen@...sta.com> writes:
> 
> > If I know for sure that these are the processors that need that block of
> > code, your suggestion makes perfect sense.  Unfortunately, I don't know.
> 
> Then I wouldn't write "Accurate delays". "Different", maybe.
> "Accurate", we don't know.
You are right.  "Accurate delays" isn't appropriate.  Probably want
something along the lines of "try this and see if helps".

> 
> > My primary goals are
> >
> > 1.  Put a stop to this thread (so far I have failed miserably)
> > 2.  Document that block of code.
> > 3.  If it makes someone's life easier.. it would be a bonus.
> 
> Uncertain comments don't make life easier. Just write what's certain,
> or nothing if nothing is.
Makes sense.  Based on both yours and Marek's inputs, I changed the
wording.  The patch is below.

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

Signed-off-by: Steve Chen <schen@...sta.com>

---

 arch/arm/Kconfig     |    8 ++++++++
 arch/arm/lib/delay.S |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index aef63c8..ca8d535 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -813,6 +813,14 @@ 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 "Accurate delays for some older CPUs"
+	def_bool n
+	help
+	  Try enable this if observing longer than expected delays and need
+	  more accuracy.  May cause instability in some CPUs.
+
 endmenu
 
 source "arch/arm/common/Kconfig"
diff --git a/arch/arm/lib/delay.S b/arch/arm/lib/delay.S
index 8d6a876..67e679b 100644
--- a/arch/arm/lib/delay.S
+++ b/arch/arm/lib/delay.S
@@ -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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ