17 Jul, 2019

1 commit

  • The PPS assert/clear offset corrections are set by the PPS_SETPARAMS
    ioctl in the pps_ktime structs, which also contain flags. The flags are
    not initialized by applications (using the timepps.h header) and they
    are not used by the kernel for anything except returning them back in
    the PPS_GETPARAMS ioctl.

    Set the flags to zero to make it clear they are unused and avoid leaking
    uninitialized data of the PPS_SETPARAMS caller to other applications
    that have a read access to the PPS device.

    Link: http://lkml.kernel.org/r/20190702092251.24303-1-mlichvar@redhat.com
    Signed-off-by: Miroslav Lichvar
    Reviewed-by: Thomas Gleixner
    Acked-by: Rodolfo Giometti
    Cc: Greg KH
    Cc: Dan Carpenter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Miroslav Lichvar
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    675 mass ave cambridge ma 02139 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 441 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Michael Ellerman (powerpc)
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520071858.739733335@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

12 Feb, 2018

1 commit

  • This is the mindless scripted replacement of kernel use of POLL*
    variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
    L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
    for f in $L; do sed -i "-es/^\([^\"]*\)\(\\)/\\1E\\2/" $f; done
    done

    with de-mangling cleanups yet to come.

    NOTE! On almost all architectures, the EPOLL* constants have the same
    values as the POLL* constants do. But they keyword here is "almost".
    For various bad reasons they aren't the same, and epoll() doesn't
    actually work quite correctly in some cases due to this on Sparc et al.

    The next patch from Al will sort out the final differences, and we
    should be all done.

    Scripted-by: Al Viro
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

29 Nov, 2017

1 commit


17 Mar, 2017

2 commits


20 Aug, 2013

1 commit


28 Feb, 2013

1 commit


14 Feb, 2013

2 commits

  • Remove the cdev from the system (with cdev_del) *before* deallocating it
    (in pps_device_destruct, called via kobject_put from device_destroy).

    Also prevent deallocating a device with open file handles.

    A better long-term fix is probably to remove the cdev from the pps_device
    entirely, and instead have all devices reference one global cdev. Then
    the deallocation ordering becomes simpler.

    But that's more complex and invasive change, so we leave that
    for later.

    Signed-off-by: George Spelvin
    Cc: stable
    Acked-by: Rodolfo Giometti
    Signed-off-by: Greg Kroah-Hartman

    George Spelvin
     
  • The PPS serial line discipline wants to attach a PPS device to a tty
    without changing the tty code to add a struct pps_device * pointer.

    Since the number of PPS devices in a typical system is generally very low
    (n=1 is by far the most common), it's practical to search the entire list
    of allocated pps devices. (We capture the timestamp before the lookup,
    so the timing isn't affected.)

    It is a bit ugly that this function, which is part of the in-kernel
    PPS API, has to be in pps.c as opposed to kapi,c, but that's not
    something that affects users.

    Signed-off-by: George Spelvin
    Acked-by: Rodolfo Giometti
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    George Spelvin
     

06 Oct, 2012

1 commit

  • To avoid name conflicts:

    drivers/video/riva/fbdev.c:281:9: sparse: preprocessor token MAX_LEVEL redefined

    While at it, also make the other names more consistent and add
    parentheses.

    [akpm@linux-foundation.org: repair fallout]
    [sfr@canb.auug.org.au: IB/mlx4: fix for MAX_ID_MASK to MAX_IDR_MASK name change]
    Signed-off-by: Fengguang Wu
    Cc: Bernd Petrovitsch
    Cc: walter harms
    Cc: Glauber Costa
    Signed-off-by: Stephen Rothwell
    Cc: Roland Dreier
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fengguang Wu
     

31 Jul, 2012

1 commit

  • We should return PTR_ERR if the call to the device_create function fails.
    Without this patch we instead return the value from a successful call to
    cdev_add if the call to device_create fails.

    Signed-off-by: Emil Goode
    Acked-by: Devendra Naga
    Cc: Alexander Gordeev
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Emil Goode
     

06 Mar, 2012

1 commit


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