Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754247AbaBFOVn (ORCPT ); Thu, 6 Feb 2014 09:21:43 -0500 Received: from www.linutronix.de ([62.245.132.108]:35106 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbaBFOVi (ORCPT ); Thu, 6 Feb 2014 09:21:38 -0500 Date: Thu, 6 Feb 2014 15:21:36 +0100 (CET) From: Thomas Gleixner To: Ivan Khoronzhuk cc: santosh.shilimkar@ti.com, rob@landley.net, linux@arm.linux.org.uk, galak@codeaurora.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, daniel.lezcano@linaro.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, grygorii.strashko@ti.com Subject: Re: [PATCH v5 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone In-Reply-To: <52F3975B.2080806@ti.com> Message-ID: References: <1391608060-10760-1-git-send-email-ivan.khoronzhuk@ti.com> <1391608060-10760-2-git-send-email-ivan.khoronzhuk@ti.com> <52F3975B.2080806@ti.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) 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 On Thu, 6 Feb 2014, Ivan Khoronzhuk wrote: > On 02/05/2014 10:27 PM, Thomas Gleixner wrote: > > On Wed, 5 Feb 2014, Ivan Khoronzhuk wrote: > > > + /* here we have to be sure the timer has been disabled */ > > Sigh. This is not a proper explanation for a barrier, really. You want > > to explain what it serializes against what. i.e. you want to explain > > why you are using the relaxed functions and avoid a separate non > > relaxed variant in favour of an explicit barrier. > > > > > + __iowmb(); > > The proper thing is to have an inline function key_stone_barrier() and > > a full explanation of the issue in exactly that place instead of > > handwaving comments here and there. > > > > Thanks, > > > > tglx > > I can add new inline function like: > > /** > * keystone_timer_barrier: write memory barrier > * use explicit barrier to avoid using readl/writel non relaxed function > * variants, because in our case relaxed variants hide the true places > * where barrier is needed. > */ > static inline void keystone_timer_barrier(void) > { > __iowmb(); > } > > and use it where it is needed. > Are you OK with it? > > And I propose to leave comments under the barriers in order to be > able to understand why they are used. Sounds good. -- 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/