From: John Stultz Date: Fri, 28 Sep 2012 22:00:27 +0000 (-0400) Subject: Merge branch 'arnds-jiffies-fix' into fortglx/3.7/time X-Git-Tag: drm-fsl-dcu-for-next~8897^2~2^2 X-Git-Url: http://git.agner.ch/gitweb/?a=commitdiff_plain;h=28f2b02bc581ffc835bc1691b18d03f62fcf0395;p=linux-drm-fsl-dcu.git Merge branch 'arnds-jiffies-fix' into fortglx/3.7/time Sort out conflict with Arnd's patch that preserves the unconditional LATCH value. Signed-off-by: John Stultz --- 28f2b02bc581ffc835bc1691b18d03f62fcf0395 diff --cc include/linux/jiffies.h index 388edb54bfb6,44e389d8e8fd..c6d5b2afdc96 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@@ -51,10 -51,22 +51,13 @@@ #define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH)) \ + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN)) + /* LATCH is used in the interval timer and ftape setup. */ + #define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ + -#ifdef CLOCK_TICK_RATE - -/* - * HZ is the requested value. However the CLOCK_TICK_RATE may not allow - * for exactly HZ. So SHIFTED_HZ is high res HZ ("<< 8" is for accuracy) - */ -# define SHIFTED_HZ (SH_DIV(CLOCK_TICK_RATE, LATCH, 8)) -#else -# define SHIFTED_HZ (HZ << 8) -#endif +extern int register_refined_jiffies(long clock_tick_rate); /* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ -#define TICK_NSEC (SH_DIV(1000000UL * 1000, SHIFTED_HZ, 8)) +#define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ) /* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ #define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)