All of lore.kernel.org
 help / color / mirror / Atom feed
From: ivan.khoronzhuk@ti.com (Ivan Khoronzhuk)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
Date: Thu, 6 Feb 2014 16:08:27 +0200	[thread overview]
Message-ID: <52F3975B.2080806@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402052123560.24986@ionos.tec.linutronix.de>


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.

-- 
Regards,
Ivan Khoronzhuk

WARNING: multiple messages have this Message-ID (diff)
From: Ivan Khoronzhuk <ivan.khoronzhuk-l0cyMroinI0@public.gmane.org>
To: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Cc: santosh.shilimkar-l0cyMroinI0@public.gmane.org,
	rob-VoJi6FS/r0vR7s880joybQ@public.gmane.org,
	linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	grygorii.strashko-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH v5 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
Date: Thu, 6 Feb 2014 16:08:27 +0200	[thread overview]
Message-ID: <52F3975B.2080806@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402052123560.24986-3cz04HxQygjZikZi3RtOZ1XZhhPuCNm+@public.gmane.org>


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.

-- 
Regards,
Ivan Khoronzhuk

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
To: Thomas Gleixner <tglx@linutronix.de>
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
Date: Thu, 6 Feb 2014 16:08:27 +0200	[thread overview]
Message-ID: <52F3975B.2080806@ti.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402052123560.24986@ionos.tec.linutronix.de>


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.

-- 
Regards,
Ivan Khoronzhuk


  reply	other threads:[~2014-02-06 14:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 13:47 [PATCH v5 0/3] Introduce clocksource driver for Keystone platform Ivan Khoronzhuk
2014-02-05 13:47 ` Ivan Khoronzhuk
2014-02-05 13:47 ` Ivan Khoronzhuk
2014-02-05 13:47 ` [PATCH v5 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk
2014-02-05 20:27   ` Thomas Gleixner
2014-02-05 20:27     ` Thomas Gleixner
2014-02-06 14:08     ` Ivan Khoronzhuk [this message]
2014-02-06 14:08       ` Ivan Khoronzhuk
2014-02-06 14:08       ` Ivan Khoronzhuk
2014-02-06 14:21       ` Thomas Gleixner
2014-02-06 14:21         ` Thomas Gleixner
2014-02-06  0:35   ` Josh Cartwright
2014-02-06  0:35     ` Josh Cartwright
2014-02-06 14:09     ` Ivan Khoronzhuk
2014-02-06 14:09       ` Ivan Khoronzhuk
2014-02-06 14:09       ` Ivan Khoronzhuk
2014-02-05 13:47 ` [PATCH v5 2/3] clocksource: keystone: add bindings for keystone timer Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk
2014-02-05 14:39   ` Rob Herring
2014-02-05 14:39     ` Rob Herring
2014-02-05 16:18     ` Ivan Khoronzhuk
2014-02-05 16:18       ` Ivan Khoronzhuk
2014-02-05 17:41       ` Rob Herring
2014-02-05 17:41         ` Rob Herring
2014-02-05 18:52         ` Ivan Khoronzhuk
2014-02-05 18:52           ` Ivan Khoronzhuk
2014-02-05 23:36           ` Rob Herring
2014-02-05 23:36             ` Rob Herring
2014-02-06 14:09             ` Ivan Khoronzhuk
2014-02-06 14:09               ` Ivan Khoronzhuk
2014-02-05 13:47 ` [PATCH v5 3/3] arm: dts: keystone: add keystone timer entry Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk
2014-02-05 13:47   ` Ivan Khoronzhuk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F3975B.2080806@ti.com \
    --to=ivan.khoronzhuk@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.