13 Oct, 2016

1 commit


04 Oct, 2016

1 commit

  • A call to 'ida_simple_remove()' is missing in the error handling path.

    This as been spotted with the following coccinelle script which tries to
    detect missing 'ida_simple_remove()' call in error handling paths.

    ///////////////
    @@
    expression x;
    identifier l;
    @@

    * x = ida_simple_get(...);
    ...
    if (...) {
    ...
    }
    ...
    if (...) {
    ...
    goto l;
    }
    ...
    * l: ... when != ida_simple_remove(...);

    Signed-off-by: Christophe JAILLET
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Christophe Jaillet
     

07 Sep, 2016

1 commit

  • gpio_to_irq does not return NO_IRQ but instead returns a negative
    error code on failure. Returning NO_IRQ from the function has no
    negative effects as we only compare the result to the expected
    interrupt number, but it's better to return a proper failure
    code for consistency, and we should remove NO_IRQ from the kernel
    entirely.

    Signed-off-by: Arnd Bergmann
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

30 May, 2016

1 commit

  • If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops.

    Fixes: 2ece068e1b1d ('ptp: use memdup_user().')
    Signed-off-by: Dan Carpenter
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Dan Carpenter
     

24 May, 2016

1 commit

  • Use memdup_user to duplicate a memory region from user-space to
    kernel-space, instead of open coding using kmalloc & copy_from_user.

    Signed-off-by: Muhammad Falak R Wani
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Muhammad Falak R Wani
     

16 Mar, 2016

1 commit

  • Pull timer updates from Thomas Gleixner:
    "The timer department delivers this time:

    - Support for cross clock domain timestamps in the core code plus a
    first user. That allows more precise timestamping for PTP and
    later for audio and other peripherals.

    The ptp/e1000e patches have been acked by the relevant maintainers
    and are carried in the timer tree to avoid merge ordering issues.

    - Support for unregistering the current clocksource watchdog. That
    lifts a limitation for switching clocksources which has been there
    from day 1

    - The usual pile of fixes and updates to the core and the drivers.
    Nothing outstanding and exciting"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (26 commits)
    time/timekeeping: Work around false positive GCC warning
    e1000e: Adds hardware supported cross timestamp on e1000e nic
    ptp: Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping
    x86/tsc: Always Running Timer (ART) correlated clocksource
    hrtimer: Revert CLOCK_MONOTONIC_RAW support
    time: Add history to cross timestamp interface supporting slower devices
    time: Add driver cross timestamp interface for higher precision time synchronization
    time: Remove duplicated code in ktime_get_raw_and_real()
    time: Add timekeeping snapshot code capturing system time and counter
    time: Add cycles to nanoseconds translation
    jiffies: Use CLOCKSOURCE_MASK instead of constant
    clocksource: Introduce clocksource_freq2mult()
    clockevents/drivers/exynos_mct: Implement ->set_state_oneshot_stopped()
    clockevents/drivers/arm_global_timer: Implement ->set_state_oneshot_stopped()
    clockevents/drivers/arm_arch_timer: Implement ->set_state_oneshot_stopped()
    clocksource/drivers/arm_global_timer: Register delay timer
    clocksource/drivers/lpc32xx: Support timer-based ARM delay
    clocksource/drivers/lpc32xx: Support periodic mode
    clocksource/drivers/lpc32xx: Don't use the prescaler counter for clockevents
    clocksource/drivers/rockchip: Add err handle for rk_timer_init
    ...

    Linus Torvalds
     

04 Mar, 2016

1 commit

  • Currently, network /system cross-timestamping is performed in the
    PTP_SYS_OFFSET ioctl. The PTP clock driver reads gettimeofday() and
    the gettime64() callback provided by the driver. The cross-timestamp
    is best effort where the latency between the capture of system time
    (getnstimeofday()) and the device time (driver callback) may be
    significant.

    The getcrosststamp() callback and corresponding PTP_SYS_OFFSET_PRECISE
    ioctl allows the driver to perform this device/system correlation when
    for example cross timestamp hardware is available. Modern Intel
    systems can do this for onboard Ethernet controllers using the ART
    counter. There is virtually zero latency between captures of the ART
    and network device clock.

    The capabilities ioctl (PTP_CLOCK_GETCAPS), is augmented allowing
    applications to query whether or not drivers implement the
    getcrosststamp callback, providing more precise cross timestamping.

    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Andy Lutomirski
    Cc: kevin.b.stanton@intel.com
    Cc: kevin.j.clarke@intel.com
    Cc: hpa@zytor.com
    Cc: jeffrey.t.kirsher@intel.com
    Cc: netdev@vger.kernel.org
    Acked-by: Richard Cochran
    Signed-off-by: Christopher S. Hall
    [jstultz: Commit subject tweaks]
    Signed-off-by: John Stultz

    Christopher S. Hall
     

30 Jan, 2016

1 commit


01 Apr, 2015

5 commits


13 Aug, 2014

1 commit

  • We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
    meet kernel coding style guidelines. This issue was reported by checkpatch.

    A simplified version of the semantic patch that makes this change is as
    follows (http://coccinelle.lip6.fr/):

    //

    @@
    identifier i;
    declarer name DEFINE_PCI_DEVICE_TABLE;
    initializer z;
    @@

    - DEFINE_PCI_DEVICE_TABLE(i)
    + const struct pci_device_id i[]
    = z;

    //

    [bhelgaas: add semantic patch]
    Signed-off-by: Benoit Taine
    Signed-off-by: Bjorn Helgaas

    Benoit Taine
     

02 Jul, 2014

1 commit

  • The ptp pin function programming does not allow calibration pin to change
    function. This is problematic on hardware that uses the default calibration
    pin for other purposes.

    Removing this limitation does not impact calibration if userspace does not
    reprogram the calibration pin.

    Signed-off-by: Stefan Sørensen
    Signed-off-by: David S. Miller

    Stefan Sørensen
     

18 Jun, 2014

1 commit

  • The ptp_pch driver is for a companion chip to the Intel Atom E600
    series processors. These are 32-bit x86 processors so the driver is
    only needed on X86_32.

    Signed-off-by: Jean Delvare
    Cc: Richard Cochran
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Jean Delvare
     

13 May, 2014

1 commit

  • Conflicts:
    drivers/net/ethernet/altera/altera_sgdma.c
    net/netlink/af_netlink.c
    net/sched/cls_api.c
    net/sched/sch_api.c

    The netlink conflict dealt with moving to netlink_capable() and
    netlink_ns_capable() in the 'net' tree vs. supporting 'tc' operations
    in non-init namespaces. These were simple transformations from
    netlink_capable to netlink_ns_capable.

    The Altera driver conflict was simply code removal overlapping some
    void pointer cast cleanups in net-next.

    Signed-off-by: David S. Miller

    David S. Miller
     

12 May, 2014

1 commit

  • Fix kconfig warnings:

    PTP_1588_CLOCK selects NET_PTP_CLASSIFY, which depends on NET,
    so PTP_1588_CLOCK should also depend on NET.

    PTP_1588_CLOCK_PCH selects PTP_1588_CLOCK so the former should
    depend on NET.

    warning: (IXP4XX_ETH && PTP_1588_CLOCK) selects NET_PTP_CLASSIFY which has unmet direct dependencies (NET)

    warning: (SFC && TILE_NET && BFIN_MAC_USE_HWSTAMP && TIGON3 && FEC && E1000E && IGB && IXGBE && I40E && MLX4_EN && SXGBE_ETH && STMMAC_ETH && TI_CPTS && PTP_1588_CLOCK_GIANFAR && PTP_1588_CLOCK_IXP46X && DP83640_PHY && PTP_1588_CLOCK_PCH) selects PTP_1588_CLOCK which has unmet direct dependencies (NET)
    [This warning is caused by the new 'depends on NET' in PTP_1588_CLOCK.]

    Signed-off-by: Randy Dunlap
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Randy Dunlap
     

29 Apr, 2014

1 commit

  • PTP Hardware Clock drivers specify a maximum frequency adjustment that
    their clocks can accommodate. Normally, user space programs will want to
    respect the advertised limits. However, no kernel or driver code checks
    that the dialed frequency offset is within the bounds, and out of range
    values can lead to surprising results.

    This patch fixes the issue by rejecting bad values.

    Signed-off-by: Richard Cochran
    Signed-off-by: David S. Miller

    Richard Cochran
     

02 Apr, 2014

1 commit

  • This commit fixes a build error reported by Fengguang, that is
    triggered when CONFIG_NETWORK_PHY_TIMESTAMPING is not set:

    ERROR: "ptp_classify_raw" [drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.ko] undefined!

    The fix is to introduce its own file for the PTP BPF classifier,
    so that PTP_1588_CLOCK and/or NETWORK_PHY_TIMESTAMPING can select
    it independently from each other. IXP4xx driver on ARM needs to
    select it as well since it does not seem to select PTP_1588_CLOCK
    or similar that would pull it in automatically.

    This also allows for hiding all of the internals of the BPF PTP
    program inside that file, and only exporting relevant API bits
    to drivers.

    This patch also adds a kdoc documentation of ptp_classify_raw()
    API to make it clear that it can return PTP_CLASS_* defines. Also,
    the BPF program has been translated into bpf_asm code, so that it
    can be more easily read and altered (extensively documented in [1]).

    In the kernel tree under tools/net/ we have bpf_asm and bpf_dbg
    tools, so the commented program can simply be translated via
    `./bpf_asm -c prog` where prog is a file that contains the
    commented code. This makes it easily readable/verifiable and when
    there's a need to change something, jump offsets etc do not need
    to be replaced manually which can be very error prone. Instead,
    a newly translated version via bpf_asm can simply replace the old
    code. I have checked opcode diffs before/after and it's the very
    same filter.

    [1] Documentation/networking/filter.txt

    Fixes: 164d8c666521 ("net: ptp: do not reimplement PTP/BPF classifier")
    Reported-by: Fengguang Wu
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Alexei Starovoitov
    Cc: Richard Cochran
    Cc: Jiri Benc
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Daniel Borkmann
     

22 Mar, 2014

3 commits


16 Jan, 2014

1 commit

  • On archs like S390 or um this driver cannot build nor work.
    Make it depend on HAS_IOMEM to bypass build failures.

    drivers/ptp/ptp_pch.c: In function ‘pch_remove’:
    drivers/ptp/ptp_pch.c:571:3: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]
    drivers/ptp/ptp_pch.c: In function ‘pch_probe’:
    drivers/ptp/ptp_pch.c:621:2: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration]

    Signed-off-by: Richard Weinberger
    Signed-off-by: David S. Miller

    Richard Weinberger
     

27 Sep, 2013

1 commit

  • This platform supports gpiolib, so remove the custom API use
    and replace with calls to gpiolib. Also request the GPIO before
    starting to use it.

    Cc: Imre Kaloz
    Cc: Alexandre Courbot
    Cc: netdev@vger.kernel.org
    Acked-by: Richard Cochran
    Acked-by: Krzysztof Halasa
    Signed-off-by: Linus Walleij

    Linus Walleij
     

27 Jul, 2013

1 commit


25 Jun, 2013

1 commit

  • Some drivers can be built on more platforms than they run on. This is
    a burden for users and distributors who package a kernel. They have to
    manually deselect some (for them useless) drivers when updating their
    configs via oldconfig. And yet, sometimes it is even impossible to
    disable the drivers without patching the kernel.

    Introduce a new config option COMPILE_TEST and make all those drivers
    to depend on the platform they run on, or on the COMPILE_TEST option.
    Now, when users/distributors choose COMPILE_TEST=n they will not have
    the drivers in their allmodconfig setups, but developers still can
    compile-test them with COMPILE_TEST=y.

    Now the drivers where we use this new option:
    * PTP_1588_CLOCK_PCH: The PCH EG20T is only compatible with Intel Atom
    processors so it should depend on x86.
    * FB_GEODE: Geode is 32-bit only so only enable it for X86_32.
    * USB_CHIPIDEA_IMX: The OF_DEVICE dependency will be met on powerpc
    systems -- which do not actually support the hardware via that
    method.
    * INTEL_MID_PTI: It is specific to the Penwell type of Intel Atom
    device.

    [v2]
    * remove EXPERT dependency

    [gregkh - remove chipidea portion, as it's incorrect, and also doesn't
    apply to my driver-core tree]

    Signed-off-by: Jiri Slaby
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Jeff Mahoney
    Cc: Alexander Shishkin
    Cc: linux-usb@vger.kernel.org
    Cc: Florian Tobias Schandinat
    Cc: linux-geode@lists.infradead.org
    Cc: linux-fbdev@vger.kernel.org
    Cc: Richard Cochran
    Cc: netdev@vger.kernel.org
    Cc: Ben Hutchings
    Cc: "Keller, Jacob E"
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

26 May, 2013

1 commit


13 Apr, 2013

1 commit

  • As network adapters supporting PTP are becoming more common, machines with
    many NICs suddenly have many PHCs, too. The current limit of eight /dev/ptp*
    char devices (and thus, 8 network interfaces with PHC) is insufficient. Let
    the ptp driver allocate the char devices dynamically.

    Tested with 28 PHCs, removing and re-adding some of them.

    Thanks to Ben Hutchings for advice leading to simpler and cleaner patch.

    Signed-off-by: Jiri Benc
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Jiri Benc
     

28 Mar, 2013

1 commit

  • This fixes a number of sparse warnings like:
    warning: incorrect type in argument 2 (different address spaces)
    expected void volatile [noderef] *addr
    got unsigned int *

    warning: Using plain integer as NULL pointer

    Additionally this fixes a warning from checkpatch.pl like:
    WARNING: sizeof pch_param.station should be sizeof(pch_param.station)

    Signed-off-by: Sahara
    Signed-off-by: David S. Miller

    Sahara
     

27 Mar, 2013

1 commit


13 Dec, 2012

1 commit

  • Pull networking changes from David Miller:

    1) Allow to dump, monitor, and change the bridge multicast database
    using netlink. From Cong Wang.

    2) RFC 5961 TCP blind data injection attack mitigation, from Eric
    Dumazet.

    3) Networking user namespace support from Eric W. Biederman.

    4) tuntap/virtio-net multiqueue support by Jason Wang.

    5) Support for checksum offload of encapsulated packets (basically,
    tunneled traffic can still be checksummed by HW). From Joseph
    Gasparakis.

    6) Allow BPF filter access to VLAN tags, from Eric Dumazet and
    Daniel Borkmann.

    7) Bridge port parameters over netlink and BPDU blocking support
    from Stephen Hemminger.

    8) Improve data access patterns during inet socket demux by rearranging
    socket layout, from Eric Dumazet.

    9) TIPC protocol updates and cleanups from Ying Xue, Paul Gortmaker, and
    Jon Maloy.

    10) Update TCP socket hash sizing to be more in line with current day
    realities. The existing heurstics were choosen a decade ago.
    From Eric Dumazet.

    11) Fix races, queue bloat, and excessive wakeups in ATM and
    associated drivers, from Krzysztof Mazur and David Woodhouse.

    12) Support DOVE (Distributed Overlay Virtual Ethernet) extensions
    in VXLAN driver, from David Stevens.

    13) Add "oops_only" mode to netconsole, from Amerigo Wang.

    14) Support set and query of VEB/VEPA bridge mode via PF_BRIDGE, also
    allow DCB netlink to work on namespaces other than the initial
    namespace. From John Fastabend.

    15) Support PTP in the Tigon3 driver, from Matt Carlson.

    16) tun/vhost zero copy fixes and improvements, plus turn it on
    by default, from Michael S. Tsirkin.

    17) Support per-association statistics in SCTP, from Michele
    Baldessari.

    And many, many, driver updates, cleanups, and improvements. Too
    numerous to mention individually.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits)
    net/mlx4_en: Add support for destination MAC in steering rules
    net/mlx4_en: Use generic etherdevice.h functions.
    net: ethtool: Add destination MAC address to flow steering API
    bridge: add support of adding and deleting mdb entries
    bridge: notify mdb changes via netlink
    ndisc: Unexport ndisc_{build,send}_skb().
    uapi: add missing netconf.h to export list
    pkt_sched: avoid requeues if possible
    solos-pci: fix double-free of TX skb in DMA mode
    bnx2: Fix accidental reversions.
    bna: Driver Version Updated to 3.1.2.1
    bna: Firmware update
    bna: Add RX State
    bna: Rx Page Based Allocation
    bna: TX Intr Coalescing Fix
    bna: Tx and Rx Optimizations
    bna: Code Cleanup and Enhancements
    ath9k: check pdata variable before dereferencing it
    ath5k: RX timestamp is reported at end of frame
    ath9k_htc: RX timestamp is reported at end of frame
    ...

    Linus Torvalds
     

29 Nov, 2012

2 commits


27 Nov, 2012

2 commits


18 Nov, 2012

1 commit

  • In commit a24006ed12616bde1bbdb26868495906a212d8dc ('ptp: Enable clock
    drivers along with associated net/PHY drivers') I wrongly made
    PTP_1588_CLOCK_PCH depend on PCH_GBE. The dependency is really the
    other way around. Therefore make PCH_GBE select PTP_1588_CLOCK_PCH
    and remove the 'default y' from the latter.

    Reported-by: Randy Dunlap
    Signed-off-by: Ben Hutchings
    Acked-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Ben Hutchings
     

01 Nov, 2012

3 commits

  • This patch adds an ioctl for PTP Hardware Clock (PHC) devices that allows
    user space to measure the time offset between the PHC and the system
    clock. Rather than hard coding any kind of estimation algorithm into the
    kernel, this patch takes the more flexible approach of just delivering
    an array of raw clock readings. In that way, the user space clock servo
    may be adapted to new and different hardware clocks.

    Signed-off-by: Richard Cochran
    Acked-by: Jacob Keller
    Signed-off-by: David S. Miller

    Richard Cochran
     
  • Where a PTP clock driver is associated with a net or PHY driver, it
    should be enabled automatically whenever that driver is enabled.
    Therefore:

    - Make PTP clock drivers select rather than depending on PTP_1588_CLOCK
    - Remove separate boolean options for PTP clock drivers that are built
    as part of net driver modules. (This also fixes cases where the PTP
    subsystem is wrongly forced to be built-in.)
    - Set 'default y' for PTP clock drivers that depend on specific net
    drivers but are built separately

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     
  • PTP hardware clock drivers that select PTP_1588_CLOCK must currently
    also select PPS. For those drivers that don't, the user must enable
    PPS, then enable PTP_1588_CLOCK, then the driver. Simplify things for
    developers and users by putting this selection in one place.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings