From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/1] arm64: Early boot time stamps
Date: Thu, 22 Nov 2018 14:14:29 +0000 [thread overview]
Message-ID: <86lg5lrygq.wl-marc.zyngier@arm.com> (raw)
In-Reply-To: <20181121175841.if3vyumzvw3yoovi@soleen.tm1wkky2jk1uhgkn0ivaxijq1c.bx.internal.cloudapp.net>
On Wed, 21 Nov 2018 17:58:41 +0000,
Pavel Tatashin <pasha.tatashin@soleen.com> wrote:
>
> On 18-11-21 17:47:07, Will Deacon wrote:
> > > + /*
> > > + * The arm64 boot protocol mandates that CNTFRQ_EL0 reflects
> > > + * the timer frequency. To avoid breakage on misconfigured
> > > + * systems, do not register the early sched_clock if the
> > > + * programmed value if zero. Other random values will just
> > > + * result in random output.
> > > + */
> > > + if (!freq)
> > > + return;
> > > +
> > > + arch_timer_read_counter = arch_counter_get_cntvct;
> >
> > Why do you need to assign this here?
> >
> > > + sched_clock_register(arch_timer_read_counter, ARCH_TIMER_NBITS, freq);
> >
> > arch_timer_read_counter can be reassigned once the arm_arch_timer driver
> > has probed; what stops this from being unused as the sched_clock after that
> > has happened? I worry that toggling the function pointer could lead to
> > sched_clock() going backwards.
>
> No reason, I will revert it back to use a local variable.
I think the issue is that you are doing an assignment for something
that the kernel has already statically initialized.
> I agree, time can go backward for a period of time while we switch
> to permanent clock later, if that clock is different.
It is worse than that. You're setting up sched_clock with an
unreliable clock source which can go backward at any point, not just
at handover time.
I'd rather we have the timestamping code be able to use another souce
than sched_clock, and eventually switch to it once sched_clock is
registered (and properly corrected.
Thanks,
M.
--
Jazz is not dead, it just smell funny.
next prev parent reply other threads:[~2018-11-22 14:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 14:43 [PATCH v2 0/1] Early boot time stamps for arm64 Pavel Tatashin
2018-11-20 14:43 ` [PATCH v2 1/1] arm64: Early boot time stamps Pavel Tatashin
2018-11-21 17:47 ` Will Deacon
2018-11-21 17:58 ` Pavel Tatashin
2018-11-22 14:14 ` Marc Zyngier [this message]
2018-12-05 16:01 ` Pavel Tatashin
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=86lg5lrygq.wl-marc.zyngier@arm.com \
--to=marc.zyngier@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox