linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: johnstul@us.ibm.com (john stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/5] arm:omap1/2/3/4:Convert 32k-Sync clocksource driver to platform_driver
Date: Wed, 25 Jan 2012 15:53:30 -0800	[thread overview]
Message-ID: <1327535610.2141.15.camel@localhost> (raw)
In-Reply-To: <1326886086-27313-2-git-send-email-hvaibhav@ti.com>

On Wed, 2012-01-18 at 16:58 +0530, Vaibhav Hiremath wrote:
> +/**
> + * read_persistent_clock -  Return time from a persistent clock.
> + *
> + * Reads the time from a source which isn't disabled during PM, the
> + * 32k sync timer.  Convert the cycles elapsed since last read into
> + * nsecs and adds to a monotonically increasing timespec.
> + */
> +void read_persistent_clock(struct timespec *ts)
> +{
> +	cycles_t delta;
> +	struct timespec *tsp;
> +	unsigned long long nsecs;
> +	struct omap_counter_32k_device  *omap = cs;
> +
> +	if (!omap) {
> +		ts->tv_sec = 0;
> +		ts->tv_nsec = 0;
> +		return;
> +	}
> +	tsp = &omap->persistent_ts;
> +
> +	omap->last_cycles = omap->cycles;
> +	omap->cycles = omap->cs.read(&omap->cs);
> +	delta = omap->cycles - omap->last_cycles;
> +
> +	nsecs = clocksource_cyc2ns(delta,
> +			omap->cs.mult, omap->cs.shift);
> +
> +	timespec_add_ns(tsp, nsecs);
> +	*ts = *tsp;
> +}

Hrm. So read_persistent_clock should probably be defined once per arch.
So I'm not sure if it makes sense to include this implementation into
the generic drivers/clocksource directory, as if some other arch tried
to include this clocksource (say if they had the same hardware) they
might have collisions w/ their read_persistent_clock implementation.


I'm all for being able to re-use clocksource drivers. But this is the
sort of thing that makes me worry we're maybe being too aggressive in
pushing clocksources that really are fairly arch/platform specific into
drivers/clocksource/

thanks
-john

  parent reply	other threads:[~2012-01-25 23:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 11:28 [RFC PATCH 0/5] arm:omap1/2/3/4: 32k sync timer cleanup Vaibhav Hiremath
2012-01-18 11:28 ` [RFC PATCH 1/5] arm:omap1/2/3/4:Convert 32k-Sync clocksource driver to platform_driver Vaibhav Hiremath
2012-01-18 11:59   ` Russell King - ARM Linux
2012-01-18 13:34     ` Hiremath, Vaibhav
2012-01-18 14:11       ` Russell King - ARM Linux
2012-01-18 14:19         ` Hiremath, Vaibhav
2012-01-18 14:25         ` Marc Zyngier
2012-01-18 14:38           ` Hiremath, Vaibhav
2012-01-18 14:45             ` Marc Zyngier
2012-01-18 14:50               ` Russell King - ARM Linux
2012-01-19 13:09                 ` Tony Lindgren
2012-01-19 13:30                   ` Hiremath, Vaibhav
2012-01-25 23:53   ` john stultz [this message]
2012-01-30  8:49     ` Hiremath, Vaibhav
2012-01-18 11:28 ` [RFC PATCH 2/5] arm:omap2/3: Add idle_st bits for ST_32KSYNC timer Vaibhav Hiremath
2012-01-18 11:28 ` [RFC PATCH 3/5] arm:omap1/2/3/4: Add 32k counter data to hwmod database Vaibhav Hiremath
2012-01-18 11:28 ` [RFC PATCH 4/5] arm:omap1/2/3/4: Add platform hookup code for counter-32k driver Vaibhav Hiremath
2012-01-18 11:28 ` [RFC PATCH 5/5] arm:omap1/2/3: Change dev name for sync_32k_ick clk to omap-counter-32k Vaibhav Hiremath

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=1327535610.2141.15.camel@localhost \
    --to=johnstul@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).