12 Oct, 2016

1 commit

  • CONFIG_NO_HZ currently only sets the default value of dynticks config so
    if PPS kernel consumer needs periodic timer ticks it should depend on
    !CONFIG_NO_HZ_COMMON instead of !CONFIG_NO_HZ.

    Otherwise it is possible to enable it even on tickless system which has
    CONFIG_NO_HZ not set and CONFIG_NO_HZ_IDLE (or CONFIG_NO_HZ_FULL) set.

    Link: http://lkml.kernel.org/r/57E2B769.50202@maciej.szmigiero.name
    Signed-off-by: Maciej S. Szmigiero
    Acked-by: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maciej S. Szmigiero
     

23 Jul, 2016

1 commit

  • With this command sequence:

    modprobe plip
    modprobe pps_parport
    rmmod pps_parport

    the partport_pps modules causes this crash:

    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: parport_detach+0x1d/0x60 [pps_parport]
    Oops: 0000 [#1] SMP
    ...
    Call Trace:
    parport_unregister_driver+0x65/0xc0 [parport]
    SyS_delete_module+0x187/0x210

    The sequence that builds up to this is:

    1) plip is loaded and takes the parport device for exclusive use:

    plip0: Parallel port at 0x378, using IRQ 7.

    2) pps_parport then fails to grab the device:

    pps_parport: parallel port PPS client
    parport0: cannot grant exclusive access for device pps_parport
    pps_parport: couldn't register with parport0

    3) rmmod of pps_parport is then killed because it tries to access
    pardev->name, but pardev (taken from port->cad) is NULL.

    So add a check for NULL in the test there too.

    Link: http://lkml.kernel.org/r/20160714115245.12651-1-jslaby@suse.cz
    Signed-off-by: Jiri Slaby
    Acked-by: Rodolfo Giometti
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

02 Oct, 2015

2 commits

  • The pps_event_time uses two 'timespec' structures internally, which
    suffer from the y2038 problem. The uses of this structure are
    fairly self-contained in the pps code, so this replaces them all at
    once.

    Unfortunately, this includes the sfc ethernet driver aside from the
    pps subsystem, so we change that one as well. Both touch the
    same data structure, and there probably is no good way to split
    the patch into smaller units.

    Acked-by: Richard Cochran
    Acked-by: David S. Miller
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Arnd Bergmann
    Signed-off-by: John Stultz

    Arnd Bergmann
     
  • There is only one user of the hardpps function in the kernel, so
    it makes sense to atomically change it over to using 64-bit
    timestamps for y2038 safety. In the hardpps implementation,
    we also need to change the pps_normtime structure, which is
    similar to struct timespec and also requires a 64-bit
    seconds portion.

    This introduces two temporary variables in pps_kc_event() to
    do the conversion, they will be removed again in the next step,
    which seemed preferable to having a larger patch changing it
    all at the same time.

    Acked-by: Richard Cochran
    Acked-by: David S. Miller
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Arnd Bergmann
    Signed-off-by: John Stultz

    Arnd Bergmann
     

20 Oct, 2014

1 commit


13 Nov, 2013

1 commit


13 Sep, 2013

1 commit


12 Sep, 2013

1 commit


20 Aug, 2013

1 commit


04 Jul, 2013

3 commits


02 May, 2013

1 commit

  • Pull VFS updates from Al Viro,

    Misc cleanups all over the place, mainly wrt /proc interfaces (switch
    create_proc_entry to proc_create(), get rid of the deprecated
    create_proc_read_entry() in favor of using proc_create_data() and
    seq_file etc).

    7kloc removed.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
    don't bother with deferred freeing of fdtables
    proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
    proc: Make the PROC_I() and PDE() macros internal to procfs
    proc: Supply a function to remove a proc entry by PDE
    take cgroup_open() and cpuset_open() to fs/proc/base.c
    ppc: Clean up scanlog
    ppc: Clean up rtas_flash driver somewhat
    hostap: proc: Use remove_proc_subtree()
    drm: proc: Use remove_proc_subtree()
    drm: proc: Use minor->index to label things, not PDE->name
    drm: Constify drm_proc_list[]
    zoran: Don't print proc_dir_entry data in debug
    reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
    proc: Supply an accessor for getting the data from a PDE's parent
    airo: Use remove_proc_subtree()
    rtl8192u: Don't need to save device proc dir PDE
    rtl8187se: Use a dir under /proc/net/r8180/
    proc: Add proc_mkdir_data()
    proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
    proc: Move PDE_NET() to fs/proc/proc_net.c
    ...

    Linus Torvalds
     

01 May, 2013

2 commits

  • drivers/pps/kc.c:37:1: sparse: symbol 'pps_kc_hardpps_lock' was not declared. Should it be static?
    drivers/pps/kc.c:39:19: sparse: symbol 'pps_kc_hardpps_dev' was not declared. Should it be static?
    drivers/pps/kc.c:40:5: sparse: symbol 'pps_kc_hardpps_mode' was not declared. Should it be static?

    Signed-off-by: Fengguang Wu
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fengguang Wu
     
  • Make CONFIG_PPS_DEBUG and CONFIG_NTP_PPS be hidden if CONFIG_PPS is not
    selected, so that we are not prompted for these configuration options if
    CONFIG_PPS is not set.

    Signed-off-by: Florian Fainelli
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Florian Fainelli
     

30 Apr, 2013

1 commit

  • Include missing linux/slab.h inclusions where the source file is currently
    expecting to get kmalloc() and co. through linux/proc_fs.h.

    Signed-off-by: David Howells
    Acked-by: Greg Kroah-Hartman
    cc: linux-s390@vger.kernel.org
    cc: sparclinux@vger.kernel.org
    cc: linux-efi@vger.kernel.org
    cc: linux-mtd@lists.infradead.org
    cc: devel@driverdev.osuosl.org
    cc: x86@kernel.org
    Signed-off-by: Al Viro

    David Howells
     

28 Feb, 2013

2 commits

  • devm_kzalloc allocates memory that is released when a driver detaches.
    This patch uses devm_kzalloc for data that is allocated in the probe
    function of a platform device and is only freed in the remove function.

    Signed-off-by: Julia Lawall
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Convert to the much saner new idr interface.

    Signed-off-by: Tejun Heo
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

14 Feb, 2013

5 commits

  • The PPS (Pulse-Per-Second) line discipline has developed a number of
    unhealthy attachments to core tty data and functions, ultimately leading
    to its breakage.

    The previous patches fixed the crashing. This one reduces coupling further
    by eliminating the timestamp parameter from the dcd_change ldisc method.
    This reduces header file linkage and makes the extension more generic,
    and the timestamp read is delayed only slightly, from just before the
    ldisc->ops->dcd_change method call to just after.

    Fix attendant build breakage in
    drivers/tty/n_tty.c
    drivers/tty/tty_buffer.c
    drivers/staging/speakup/selection.c
    drivers/staging/dgrp/dgrp_*.c

    Cc: William Hubbs
    Cc: Chris Brannon
    Cc: Kirk Reiser
    Cc: Samuel Thibault
    Signed-off-by: Peter Hurley
    Signed-off-by: George Spelvin
    Acked-by: Rodolfo Giometti
    Signed-off-by: Greg Kroah-Hartman

    George Spelvin
     
  • PPS is not really the must-have subsystem that warrants crashing
    the machine if the ldisc interface is broken.

    Signed-off-by: Peter Hurley
    Signed-off-by: George Spelvin
    Acked-by: Rodolfo Giometti
    Signed-off-by: Greg Kroah-Hartman

    George Spelvin
     
  • 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
     
  • Now that N_TTY uses tty->disc_data for its private data,
    'subclass' ldiscs cannot use ->disc_data for their own private data.
    (This is a regression is v3.8-rc1)

    Use pps_lookup_dev to associate the tty with the pps source instead.

    This fixes a crashing regression in 3.8-rc1.

    Signed-off-by: George Spelvin
    Acked-by: Rodolfo Giometti
    Cc: stable
    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
     

19 Jan, 2013

1 commit

  • The option allows you to remove TTY and compile without errors. This
    saves space on systems that won't support TTY interfaces anyway.
    bloat-o-meter output is below.

    The bulk of this patch consists of Kconfig changes adding "depends on
    TTY" to various serial devices and similar drivers that require the TTY
    layer. Ideally, these dependencies would occur on a common intermediate
    symbol such as SERIO, but most drivers "select SERIO" rather than
    "depends on SERIO", and "select" does not respect dependencies.

    bloat-o-meter output comparing our previous minimal to new minimal by
    removing TTY. The list is filtered to not show removed entries with awk
    '$3 != "-"' as the list was very long.

    add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
    function old new delta
    chr_dev_init 166 170 +4
    allow_signal 80 82 +2
    static.__warned 143 142 -1
    disallow_signal 63 62 -1
    __set_special_pids 95 94 -1
    unregister_console 126 121 -5
    start_kernel 546 541 -5
    register_console 593 588 -5
    copy_from_user 45 40 -5
    sys_setsid 128 120 -8
    sys_vhangup 32 19 -13
    do_exit 1543 1526 -17
    bitmap_zero 60 40 -20
    arch_local_irq_save 137 117 -20
    release_task 674 652 -22
    static.spin_unlock_irqrestore 308 260 -48

    Signed-off-by: Joe Millenbach
    Reviewed-by: Jamey Sharp
    Reviewed-by: Josh Triplett
    Signed-off-by: Greg Kroah-Hartman

    Joe Millenbach
     

04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Nov, 2012

1 commit


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


03 Nov, 2011

3 commits

  • Add "depends on GENERIC_HARDIRQS" to avoid compile breakage on s390:

    drivers/built-in.o: In function `pps_gpio_remove':
    linux-next/drivers/pps/clients/pps-gpio.c:189: undefined reference to `free_irq'

    Signed-off-by: Heiko Carstens
    Cc: James Nuss
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • This client driver allows you to use a GPIO pin as a source for PPS
    signals. Platform data [1] are used to specify the GPIO pin number,
    label, assert event edge type, and whether clear events are captured.

    This driver is based on the work by Ricardo Martins who submitted an
    initial implementation [2] of a PPS IRQ client driver to the linuxpps
    mailing-list on Dec 3 2010.

    [1] include/linux/pps-gpio.h
    [2] http://ml.enneenne.com/pipermail/linuxpps/2010-December/004155.html

    [akpm@linux-foundation.org: remove unneeded cast of void*]
    Signed-off-by: James Nuss
    Cc: Ricardo Martins
    Acked-by: Rodolfo Giometti
    Signed-off-by: Ricardo Martins
    Cc: Alexander Gordeev
    Cc: Igor Plyatov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Nuss
     
  • A default echo function has been provided so it is no longer an error when
    you specify PPS_ECHOASSERT or PPS_ECHOCLEAR without an explicit echo
    function. This allows some code re-use and also makes it easier to write
    client drivers since the default echo function does not normally need to
    change.

    Signed-off-by: James Nuss
    Reviewed-by: Ben Gardiner
    Acked-by: Rodolfo Giometti
    Cc: Ricardo Martins
    Cc: Alexander Gordeev
    Cc: Igor Plyatov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Nuss
     

31 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • Remove code enabled only when CONFIG_PREEMPT_RT is turned on because it is
    not used in the vanilla kernel.

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

    Alexander Gordeev
     

17 Mar, 2011

1 commit


05 Mar, 2011

1 commit

  • This driver causes hard lockups, when the active clock soure is jiffies.

    The reason is that it loops with interrupts disabled waiting for a
    timestamp to be reached by polling getnstimeofday(). Though with a
    jiffies clocksource, when that code runs on the same CPU which is
    responsible for updating jiffies, then we loop in circles for ever
    simply because the timer interrupt cannot update jiffies. So both UP
    and SMP can be affected.

    There is no easy fix for that problem so make it depend on BROKEN for
    now.

    Signed-off-by: Thomas Gleixner
    Cc: Alexander Gordeev
    Cc: Rodolfo Giometti
    Cc: john stultz
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

26 Feb, 2011

1 commit


26 Jan, 2011

2 commits

  • Both pps_parport and pps_gen_parport are written in a way that they
    can't share a port with any other driver. This can result in locking up
    the process that loads modules or even the whole kernel if the modules
    are compiled in. Use PARPORT_FLAG_EXCL to indicate this.

    Signed-off-by: Alexander Gordeev
    Cc: Alexander Gordeev
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev
     
  • Signed-off-by: Rodolfo Giometti
    Reported-by: Ingo Molnar
    Cc: Alexander Gordeev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rodolfo Giometti
     

14 Jan, 2011

1 commit

  • Add PPS signal generator which utilizes STROBE pin of a parallel port to
    send PPS signals. It uses parport abstraction layer and hrtimers to
    precisely control the signal.

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

    Alexander Gordeev