Messages in this thread | | | Date | Fri, 22 May 2015 00:00:22 +0200 (CEST) | From | Thomas Gleixner <> | Subject | Re: [PATCH 6/7] clocksource: Add Pistachio clocksource-only driver |
| |
On Thu, 21 May 2015, Ezequiel Garcia wrote: > +static cycle_t clocksource_read_cycles(struct clocksource *cs) > +{ > + u32 counter, overflw; > + unsigned long flags; > + > + raw_spin_lock_irqsave(&lock, flags);
Hmm. Is that lock really necessary to read that counter? The clocksource is global. And if its actually used for timekeeping, the lock can get heavy contended.
> + overflw = gpt_readl(TIMER_CURRENT_OVERFLOW_VALUE, 0); > + counter = gpt_readl(TIMER_CURRENT_VALUE, 0); > + raw_spin_unlock_irqrestore(&lock, flags); > + > + return ~(cycle_t)counter; > +}
Thanks,
tglx
| |