All of lore.kernel.org
 help / color / mirror / Atom feed
From: bjorn.forsman@gmail.com (Bjørn Forsman)
To: linux-arm-kernel@lists.infradead.org
Subject: [Openpxa-users] Linux udelay() is way off
Date: Thu, 20 Jan 2011 21:25:36 +0100	[thread overview]
Message-ID: <AANLkTikawLY2QcoUdcrF-SmmAbGM1MhzWLZogKb=5VAV@mail.gmail.com> (raw)
In-Reply-To: <20110120193013.GL6335@n2100.arm.linux.org.uk>

2011/1/20 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Thu, Jan 20, 2011 at 08:18:10PM +0100, Bj?rn Forsman wrote:
>> [ ? 11.425363] cpufreq-core: saving 518144 as reference value for
>> loops_per_jiffy; freq is 312000 kHz
>> [ ? 11.425523] cpufreq-core: scaling loops_per_jiffy to 1036288 for
>> frequency 624000 kHz
>
> So despite scaling lpj by a factor of two for the doubling in clock
> frequency, we see a 30% error in it?

No. udelay() is ~30 % of what it should be. My gpio + oscilloscope
test showed that udelay(50) => 16 us in real time with cpufreq
enabled. This gives 16/50 = 0.32.

> Is it possible to boot at 624MHz and report the resulting lpj?

I think I need some help doing that. I found some clock setup in
<u-boot-pxa>/arch/arm/cpu/pxa/start.S (OpenPXA tree) but I'm not
familiar with it.

> Alternatively, call calibrate_delay() after the cpufreq switch to
> 624MHz, disabling the 'printed' stuff and see what it reports.

First attempts at moving calibrate_delay() after freq switch failed. I
will try more. Just had to send this so stop the misunderstanding
about how much udelay() is off...

What do you mean by disabling the 'printed' stuff? The cpufreq debug stuff?

Best regards,
Bj?rn Forsman

> I wonder if this is a case where it scales according to
>
> ? ? ? ?new_lpj = ref_lpj * (new_freq / ref_freq) + some_offset
>
> rather than just
>
> ? ? ? ?new_lpj = ref_lpj * (new_freq / ref_freq)

  reply	other threads:[~2011-01-20 20:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTin_cCzNWhJnD=A2h1qiKpeUrnPrSZPs_Kmfjjd1@mail.gmail.com>
2011-01-20 17:00 ` [Openpxa-users] Linux udelay() is way off Marek Vasut
2011-01-20 17:55   ` Russell King - ARM Linux
2011-01-20 19:18     ` Bjørn Forsman
2011-01-20 19:30       ` Russell King - ARM Linux
2011-01-20 20:25         ` Bjørn Forsman [this message]
2011-01-20 22:10           ` Russell King - ARM Linux
2011-01-21  0:02             ` Bjørn Forsman
2011-01-21 17:46         ` Bjørn Forsman
2011-01-21 18:11           ` Marek Vasut
2011-01-21 18:55             ` Bjørn Forsman
2011-01-23 10:35           ` Marek Vasut
2011-01-25 17:45             ` Bjørn Forsman
2011-01-25 20:18               ` Marek Vasut
2011-01-21  7:29       ` Saravana Kannan
2011-01-21 17:56         ` Bjørn Forsman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikawLY2QcoUdcrF-SmmAbGM1MhzWLZogKb=5VAV@mail.gmail.com' \
    --to=bjorn.forsman@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.