mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Antony Pavlov <antonynpavlov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC] clocksource: dummy: don't show message on first cs read
Date: Mon, 1 Dec 2014 07:31:40 +0100	[thread overview]
Message-ID: <20141201063140.GB30369@pengutronix.de> (raw)
In-Reply-To: <1417180052-16824-1-git-send-email-antonynpavlov@gmail.com>

On Fri, Nov 28, 2014 at 04:07:32PM +0300, Antony Pavlov wrote:
> In the commit
> 
>     commit 96cae61eba199b9c3f5451f293cf60db2b535164
>     Author: Sascha Hauer <s.hauer@pengutronix.de>
>     Date:   Tue Sep 30 08:25:55 2014 +0200
> 
>         clock: Add a variable with the first timestamp after startup
> 
>         For measuring the startup time it's useful to save the first
>         timestamp after the clocksource has been registered.
> 
> the behaviour of clocksource subsystem is changed: every registered
> clocksource is called at least once. So the dummy clocksource (if enabled)
> _ALWAYS_ prints a confusing 'Using dummy clocksource' warning.
> 
> This patch fixes the situation: now the 'Using dummy clocksource'
> warning is printed only if the dummy clocksource is called second time.

I don't like this very much. The dummy clocksource expects some certain
behaviour of the common clocksource code and works around this when it
changes. How about integrating the dummy clocksource into the core
instead, like

uint64_t get_time_ns(void)
{
	if (!current_clock)
		return dummy_counter++;

	...
}

Then add a initcall which warns later if we still don't have a valid
clocksource?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-12-01  6:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28 13:07 Antony Pavlov
2014-12-01  6:31 ` Sascha Hauer [this message]
2014-12-01 10:01   ` Antony Pavlov

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=20141201063140.GB30369@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=antonynpavlov@gmail.com \
    --cc=barebox@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