linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/8] Dynamic clock devices
@ 2010-11-04 19:26 Richard Cochran
  2010-11-04 19:28 ` [PATCH RFC 1/8] Introduce dynamic " Richard Cochran
                   ` (9 more replies)
  0 siblings, 10 replies; 25+ messages in thread
From: Richard Cochran @ 2010-11-04 19:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-api, Alan Cox, Arnd Bergmann, Christoph Lameter,
	John Stultz, Peter Zijlstra, Thomas Gleixner

Okay, here is a work in progress, not well tested, but I would like to
get some feedback whether the direction is good or not.

The first patch introduces clock devices which can appear and
disappear like usb devices (and, I suppose, hot plug PCI but I am not
too sure that what is offered here would really work in that case).
The subsequent patches convert the clock_ and timer_ system calls, one
by one.

The clock_ syscalls are moved into a new file and they call the older
posix functions when needed. The timer_ syscalls stay where they are,
in posix-timers.c, since I did not want to change the fairly involved
timer management code. Eventually, we could remove the posix clock_*
functions for the CLOCK_* ids from posix-timers.c and rework them
using the new dynamic clock api. That would leave just the timer code
in posix-timers.c, as the file name suggests.

I dropped the idea of having user space open a sysfs file in order to
get a reference to a clock, since there are no open/release hooks
within sysfs for drivers (coincidentally, there has been some talk
about this on the lkml recently, but previously Greg KH object to
abusing sysfs as a "clockfs").

Instead, since many clocks (hpet, rtc, ptp, ...) will want to offer a
custom chardev for special advanced functionality, the dynamic clock
layer registers a cdev for the driver, placing its own hooks into the
open/release methods. The driver thus needs to access its private data
via a standard access method (not just by using fp->private_data). If
a driver doesn't want any chardev functions, that is okay, too.

Well, please take a look and let me know what you think.

Thanks,

Richard


Richard Cochran (8):
  Introduce dynamic clock devices
  clock device: convert clock_gettime
  clock device: convert clock_getres
  clock device: convert clock_settime
  clock device: convert timer_create
  clock device: convert timer_delete
  clock device: convert timer_gettime
  clock device: convert timer_settime

 include/linux/clockdevice.h  |  117 +++++++++++++++
 include/linux/posix-timers.h |   23 +++-
 include/linux/time.h         |    2 +
 kernel/posix-timers.c        |   51 +++++--
 kernel/time/Makefile         |    3 +-
 kernel/time/clockdevice.c    |  336 ++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 518 insertions(+), 14 deletions(-)
 create mode 100644 include/linux/clockdevice.h
 create mode 100644 kernel/time/clockdevice.c


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

end of thread, other threads:[~2010-12-06 14:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 19:26 [PATCH RFC 0/8] Dynamic clock devices Richard Cochran
2010-11-04 19:28 ` [PATCH RFC 1/8] Introduce dynamic " Richard Cochran
2010-11-08  6:38   ` Arnd Bergmann
2010-12-04 14:55     ` Richard Cochran
2010-12-06 14:14       ` Arnd Bergmann
2010-11-04 19:28 ` [PATCH RFC 2/8] clock device: convert clock_gettime Richard Cochran
2010-11-08  6:56   ` Arnd Bergmann
2010-11-09 10:26     ` Richard Cochran
2010-11-09 12:47       ` Arnd Bergmann
2010-11-09 21:37     ` john stultz
2010-11-10 10:16       ` Arnd Bergmann
2010-11-08 23:37   ` john stultz
2010-11-09  8:23     ` Richard Cochran
2010-11-09 21:10       ` john stultz
2010-11-15  9:41         ` Richard Cochran
2010-11-04 19:28 ` [PATCH RFC 3/8] clock device: convert clock_getres Richard Cochran
2010-11-04 19:29 ` [PATCH RFC 4/8] clock device: convert clock_settime Richard Cochran
2010-11-04 19:29 ` [PATCH RFC 5/8] clock device: convert timer_create Richard Cochran
2010-11-04 19:30 ` [PATCH RFC 6/8] clock device: convert timer_delete Richard Cochran
2010-11-04 19:30 ` [PATCH RFC 7/8] clock device: convert timer_gettime Richard Cochran
2010-11-04 19:30 ` [PATCH RFC 8/8] clock device: convert timer_settime Richard Cochran
2010-11-08 23:01 ` [PATCH RFC 0/8] Dynamic clock devices john stultz
2010-11-15  9:34   ` Richard Cochran
2010-11-15 10:01 ` Paul Mundt
2010-11-18 16:33   ` Richard Cochran

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).