lkml.org 
[lkml]   [2015]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] clocksource: st_lpc: Add LPC timer as a clocksource.
On Fri, 17 Apr 2015, Peter Griffin wrote:
> +/* Low Power Timer */
> +#define LPC_LPT_LSB_OFF 0x400
> +#define LPC_LPT_MSB_OFF 0x404
> +#define LPC_LPT_START_OFF 0x408
> +
> +struct st_lpc {
> + struct clk *clk;
> + void __iomem *iomem_cs;
> +};
> +
> +static struct st_lpc *st_lpc;
> +
> +static u64 notrace st_lpc_counter_read(void)
> +{
> + u64 counter;
> + u32 lower;
> + u32 upper, old_upper;
> +
> + upper = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_MSB_OFF);
> + do {
> + old_upper = upper;
> + lower = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_LSB_OFF);
> + upper = readl_relaxed(st_lpc->iomem_cs + LPC_LPT_MSB_OFF);
> + } while (upper != old_upper);
> +
> + counter = upper;
> + counter <<= 32;
> + counter |= lower;
> + return counter;


What's the point of this exercise? The kernel can handle 32bit
clocksources nicely. So why do you want to artificially expand them to
64bit by adding useless loops and hoops to a hotpath?

Thanks,

tglx


\
 
 \ /
  Last update: 2015-04-21 12:01    [W:0.121 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site