public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [patch 02/23] GTOD: persistent clock support, core
@ 2006-10-03 13:53 David Brownell
  2006-10-03 19:19 ` john stultz
  0 siblings, 1 reply; 8+ messages in thread
From: David Brownell @ 2006-10-03 13:53 UTC (permalink / raw)
  To: john stultz; +Cc: Linux Kernel list

> Implement generic timekeeping suspend/resume accounting by introducing 
> the read_persistent_clock() interface. This is an arch specific 
> function that returns the seconds since the epoch using the arch 
> defined battery backed clock.

I remain unclear what's expected to happen when there IS no such
architcture-defined clock ... but where the system itself still
has one, e.g. a board may access one through I2C or SPI once IRQs
are working normally.

You'll recall that I had pointed out that the drivers/rtc framework
provides CONFIG_RTC_HCTOSYS, which already unifies quite a lot of
the "persistent" clocks in the way you described above, but without
that nasty requirement of working without IRQs enabled.


> +/**
> + * read_persistent_clock -  Return time in seconds from the persistent clock.
> + *
> + * Weak dummy function for arches that do not yet support it.
> + * Returns seconds from epoch using the battery backed persistent clock.
> + * Returns zero if unsupported.
> + *
> + *  XXX - Do be sure to remove it once all arches implement it.

But not all architectures **CAN** support this notion ...


> + */
> +unsigned long __attribute__((weak)) read_persistent_clock(void)
> +{
> +       return 0;
> +}
> +
>
>  /* 
>   * timekeeping_init - Initializes the clocksource and common timekeeping values
>   */
>  void __init timekeeping_init(void)
>  {
>         unsigned long flags;
> +       unsigned long sec = read_persistent_clock();

... and timekeeping_init() is called before I2C or SPI could be used,
since IRQs aren't enabled yet and accessing those busses can't be
done in general without IRQs enabled.


> @@ -774,13 +801,23 @@ static int timekeeping_suspended;
>  static int timekeeping_resume(struct sys_device *dev)
>  {
>         unsigned long flags;
> +       unsigned long now = read_persistent_clock();

Again: sys_device resume() is called with IRQs disabled, which
prevents access to many systems' persistent clocks.  In fact,
after posting this example patch

  http://marc.theaimsgroup.com/?l=linux-kernel&m=115600629813751&w=2

I never heard anything more from you on this issue.  Given this
particular patch (in $SUBJECT) should I assume you're going to
just ignore the issues whereby RTCs ("persistent clocks") can't
always meet the no-IRQs-needed assumptions being made here?  Or
address isssues like using pointer-to-function instead of using
linker tricks?

  http://marc.theaimsgroup.com/?l=linux-kernel&m=115600629825461&w=2

Those class suspend/resume hooks are now merged to kernel.org, by
the way, so that example patch is now pretty much deployable.

- Dave


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [patch 00/23]
@ 2006-09-29 23:58 Thomas Gleixner
  2006-09-29 23:58 ` [patch 02/23] GTOD: persistent clock support, core Thomas Gleixner
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Gleixner @ 2006-09-29 23:58 UTC (permalink / raw)
  To: LKML
  Cc: Andrew Morton, Ingo Molnar, Jim Gettys, John Stultz,
	David Woodhouse, Arjan van de Ven, Dave Jones

We are pleased to announce the next version of our "high resolution 
timers" and "dynticks" patchset, which implements two important features 
that Linux lacked for many years.

The patchset is against 2.6.18-mm2. (Since our last release there were 
no big changes, other than bugfixes and internal releasification 
cleanups, and the merge to -mm. The queue is bisect-friendly.)

If review and feedback is positive we'd like this patchset to be added 
to the 2.6.19 kernel. It has been maintained ontop of ktimers initially 
(more than a year ago), and then ontop of hrtimers (after ktimers were 
renamed to hrtimers and the hrtimer subsystem went upstream in January). 
Various -hrt iterations have been announced on lkml numerous times in 
the past year.

Now that the hrtimers subsystem and most of John Stultz Generic Time Of 
Day work is upstream, this patchset is straightforward and carries 
little risks if high-res timers are turned off (which is the default).

This patchset has been tested on various i686 systems. (We have the 
x86_64 patches too, but we'd like to concentrate on this first wave 
initially.)

The patchset can also be found at:

  http://www.tglx.de/projects/hrtimers/2.6.18-mm2/patch-2.6.18-mm2-hrt-dyntick1.patches.tar.bz2

	Thomas, Ingo

--


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-10-04 19:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03 13:53 [patch 02/23] GTOD: persistent clock support, core David Brownell
2006-10-03 19:19 ` john stultz
2006-10-04 17:50   ` David Brownell
2006-10-04 19:09     ` john stultz
  -- strict thread matches above, loose matches on Subject: below --
2006-09-29 23:58 [patch 00/23] Thomas Gleixner
2006-09-29 23:58 ` [patch 02/23] GTOD: persistent clock support, core Thomas Gleixner
2006-09-30  8:35   ` Andrew Morton
2006-09-30 17:15     ` Jan Engelhardt
2006-10-02 21:49     ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox