Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756792AbbEUWAR (ORCPT ); Thu, 21 May 2015 18:00:17 -0400 Received: from www.linutronix.de ([62.245.132.108]:40368 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755414AbbEUWAO (ORCPT ); Thu, 21 May 2015 18:00:14 -0400 Date: Fri, 22 May 2015 00:00:22 +0200 (CEST) From: Thomas Gleixner To: Ezequiel Garcia cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Daniel Lezcano , devicetree@vger.kernel.org, Andrew Bresticker , James Hartley , James Hogan , Damien.Horsley@imgtec.com, Govindraj.Raja@imgtec.com Subject: Re: [PATCH 6/7] clocksource: Add Pistachio clocksource-only driver In-Reply-To: <1432244506-15388-1-git-send-email-ezequiel.garcia@imgtec.com> Message-ID: References: <1432244260-14908-1-git-send-email-ezequiel.garcia@imgtec.com> <1432244506-15388-1-git-send-email-ezequiel.garcia@imgtec.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 826 Lines: 27 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/