[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALAqxLXPbVZr0aXceM6bFHd3xu=4W-DinQL8yMMsVYEecPSeHw@mail.gmail.com>
Date: Mon, 27 Jul 2015 21:11:28 -0700
From: John Stultz <john.stultz@...aro.org>
To: Christopher Hall <christopher.s.hall@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Richard Cochran <richardcochran@...il.com>,
Ingo Molnar <mingo@...hat.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
john.ronciak@...el.com, "H. Peter Anvin" <hpa@...or.com>,
"x86@...nel.org" <x86@...nel.org>,
lkml <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/5] Add calls to translate Always Running Timer (ART) to
system time
On Mon, Jul 27, 2015 at 5:46 PM, Christopher Hall
<christopher.s.hall@...el.com> wrote:
> +static bool checked_art_to_tsc(cycle_t *tsc)
> +{
> + if (!has_art())
> + return false;
> + *tsc = art_to_tsc(*tsc);
> + return true;
> +}
> +
> +static int art_to_rawmono64(struct timespec64 *rawmono, cycle_t art)
> +{
> + if (!checked_art_to_tsc(&art))
> + return -ENXIO;
> + return tsc_to_rawmono64(rawmono, art);
> +}
> +EXPORT_SYMBOL(art_to_rawmono64);
This all seems to assume the TSC is the current clocksource, which it
may not be if the user has overridden it.
If instead there were a counter_to_rawmono64() which took the counter
value and maybe the name of the clocksource (if the strncmp is
affordable for your use), it might be easier for the core to provide
an error if the current timekeeping clocksource isn't the one the
counter value is based on. This would also allow the tsc_to_*()
midlayers to be dropped (since they don't seem to do much).
thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists