14 Jan, 2011

5 commits

  • MONOTONIC_RAW clock timestamps are ideally suited for frequency
    calculation and also fit well into the original NTP hardpps design. Now
    phase and frequency can be adjusted separately: the former based on
    REALTIME clock and the latter based on MONOTONIC_RAW clock.

    A new function getnstime_raw_and_real is added to timekeeping subsystem to
    capture both timestamps at the same time and atomically.

    Signed-off-by: Alexander Gordeev
    Acked-by: John Stultz
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Using device index as a pointer needs some unnecessary work to be done
    every time the pointer is needed (in irq handler for example). Using a
    direct pointer is much more easy (and safe as well).

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Add a helper function to gather timestamps. This way clients don't have
    to duplicate it.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • There was a race in PPS_FETCH ioctl handler when several processes want to
    obtain PPS data simultaneously using sleeping PPS_FETCH. They all sleep
    most of the time in the system call.

    With the old approach when the first process waiting on the pps queue is
    waken up it makes new system call right away and zeroes pps->go. So other
    processes continue to sleep. This is a clear race condition because of
    the global 'go' variable.

    With the new approach pps->last_ev holds some value increasing at each PPS
    event. PPS_FETCH ioctl handler saves current value to the local variable
    at the very beginning so it can safely check that there is a new event by
    just comparing both variables.

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Here are some very trivial fixes combined:

    - add macro definitions to protect header file from including several times

    - remove declaration for an unexistent array

    - fix typos

    Signed-off-by: Alexander Gordeev
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     

19 Jun, 2009

1 commit

  • This patch adds the kernel side of the PPS support currently named
    "LinuxPPS".

    PPS means "pulse per second" and a PPS source is just a device which
    provides a high precision signal each second so that an application can
    use it to adjust system clock time.

    Common use is the combination of the NTPD as userland program with a GPS
    receiver as PPS source to obtain a wallclock-time with sub-millisecond
    synchronisation to UTC.

    To obtain this goal the userland programs shoud use the PPS API
    specification (RFC 2783 - Pulse-Per-Second API for UNIX-like Operating
    Systems, Version 1.0) which in part is implemented by this patch. It
    provides a set of chars devices, one per PPS source, which can be used to
    get the time signal. The RFC's functions can be implemented by accessing
    to these char devices.

    Signed-off-by: Rodolfo Giometti
    Cc: David Woodhouse
    Cc: Greg KH
    Cc: Randy Dunlap
    Cc: Kay Sievers
    Acked-by: Alan Cox
    Cc: Michael Kerrisk
    Cc: Christoph Hellwig
    Cc: Roman Zippel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rodolfo Giometti