[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fa81694-7bd2-564b-e5b9-ae53b9ea6620@sigmadesigns.com>
Date: Thu, 16 Nov 2017 16:26:51 +0100
From: Marc Gonzalez <marc_gonzalez@...madesigns.com>
To: Russell King - ARM Linux <linux@...linux.org.uk>
CC: Linus Torvalds <torvalds@...ux-foundation.org>,
Alan Cox <gnomes@...rguk.ukuu.org.uk>,
LKML <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
John Stultz <john.stultz@...aro.org>,
Douglas Anderson <dianders@...omium.org>,
Nicolas Pitre <nico@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Will Deacon <will.deacon@....com>,
Jonathan Austin <jonathan.austin@....com>,
Arnd Bergmann <arnd@...db.de>,
Kevin Hilman <khilman@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Thibaud Cornic <thibaud_cornic@...madesigns.com>,
Mason <slash.tmp@...e.fr>
Subject: Re: [RFC] Improving udelay/ndelay on platforms where that is possible
On 15/11/2017 14:13, Russell King - ARM Linux wrote:
> udelay() needs to offer a consistent interface so that drivers know
> what to expect no matter what the implementation is. Making one
> implementation conform to your ideas while leaving the other
> implementations with other expectations is a recipe for bugs.
>
> If you really want to do this, fix the loops_per_jiffy implementation
> as well so that the consistency is maintained.
Hello Russell,
It seems to me that, when using DFS, there's a serious issue with loop-based
delays. (IIRC, it was you who pointed this out a few years ago.)
If I'm reading arch/arm/kernel/smp.c correctly, loops_per_jiffy is scaled
when the frequency changes.
But arch/arm/lib/delay-loop.S starts by loading the current value of
loops_per_jiffy, computes the number of times to loop, and then loops.
If the frequency increases when the core is in __loop_delay, the
delay will be much shorter than requested.
Is this a correct assessment of the situation?
(BTW, does arch/arm/lib/delay-loop.S load the per_cpu loops_per_jiffy
or the system-wide variable?)
Should loop-based delays be disabled when CPUFREQ is enabled?
Regards.
Powered by blists - more mailing lists