Re: [PATCH 33/36] AArch64: Generic timers support

From: Arnd Bergmann
Date: Fri Jul 13 2012 - 12:32:41 EST


On Friday 13 July 2012, Catalin Marinas wrote:
> > Architectures that always have a working clock source would then just
> > not include the timex.h header and #define ACT_HZ HZ in common code.
>
> Would something like below be enough?
>
> Also, are there any implications if we boot with clocksource=jiffies?
>
> --- a/include/linux/jiffies.h
> +++ b/include/linux/jiffies.h
> @@ -55,7 +55,11 @@
> + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
>
> /* HZ is the requested value. ACTHZ is actual HZ ("<< 8" is for accuracy) */
> +#ifdef CLOCK_TICK_RATE
> #define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
> +#else
> +#define ACTHZ (HZ << 8)
> +#endif
>
> /* TICK_NSEC is the time between ticks in nsec assuming real ACTHZ */
> #define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8))
>

I think that's a very good step in the right direction, yes.

It does not let us get rid of the asm/timex.h file, but that's actually
a separate problem. It also wouldn't hurt to put the LATCH definition
in the same #ifdef.

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>

Arnd

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/