14 Jan, 2011

7 commits

  • Add an optional feature of PPSAPI, kernel consumer support, which uses the
    added hardpps() function.

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

    Alexander Gordeev
     
  • Now pps_idr_lock is never used in interrupt context so we can replace
    spin_lock_irq/spin_unlock_irq with plain spin_lock/spin_unlock. But
    there is also a potential race condition when someone can steal an id
    which was allocated by idr_pre_get before it is used. So convert spin
    lock to mutex and protect the whole id generation process.

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

    Alexander Gordeev
     
  • Since now idr is only used to manage char device id's and not used in
    kernel API anymore it should be moved to pps.c. This also makes it
    possible to release id only at actual device freeing so nobody can
    register a pps device with the same id while our device is not freed yet.

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

    Alexander Gordeev
     
  • Since we now have direct pointers to struct pps_device everywhere it's
    easy to use dev_* functions to print messages instead of plain printks.
    Where dev_* cannot be used printks are converted to pr_*.

    Signed-off-by: Alexander Gordeev
    Acked-by: 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
     
  • 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
     
  • Move variable declarations where they are used in pps_cdev_ioctl.

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

    Alexander Gordeev
     

12 Nov, 2009

1 commit


27 Aug, 2009

1 commit

  • Fix incorrect verdict check and returns error if device_create failed,
    otherwise driver triggers kernel oops.

    Signed-off-by: Joonwoo Park
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joonwoo Park
     

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