1. 15 Nov, 2019 2 commits
  2. 27 Sep, 2019 1 commit
    • Jacob Keller's avatar
      ptp: correctly disable flags on old ioctls · 2df4de16
      Jacob Keller authored
      Commit 41560658
      
       ("PTP: introduce new versions of IOCTLs",
      2019-09-13) introduced new versions of the PTP ioctls which actually
      validate that the flags are acceptable values.
      
      As part of this, it cleared the flags value using a bitwise
      and+negation, in an attempt to prevent the old ioctl from accidentally
      enabling new features.
      
      This is incorrect for a couple of reasons. First, it results in
      accidentally preventing previously working flags on the request ioctl.
      By clearing the "valid" flags, we now no longer allow setting the
      enable, rising edge, or falling edge flags.
      
      Second, if we add new additional flags in the future, they must not be
      set by the old ioctl. (Since the flag wasn't checked before, we could
      potentially break userspace programs which sent garbage flag data.
      
      The correct way to resolve this is to check for and clear all but the
      originally valid flags.
      
      Create defines indicating which flags are correctly checked and
      interpreted by the original ioctls. Use these to clear any bits which
      will not be correctly interpreted by the original ioctls.
      
      In the future, new flags must be added to the VALID_FLAGS macros, but
      *not* to the V1_VALID_FLAGS macros. In this way, new features may be
      exposed over the v2 ioctls, but without breaking previous userspace
      which happened to not clear the flags value properly. The old ioctl will
      continue to behave the same way, while the new ioctl gains the benefit
      of using the flags fields.
      
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Christopher Hall <christopher.s.hall@intel.com>
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2df4de16
  3. 13 Sep, 2019 2 commits
  4. 08 Jan, 2019 1 commit
  5. 10 Nov, 2018 1 commit
    • Miroslav Lichvar's avatar
      ptp: add PTP_SYS_OFFSET_EXTENDED ioctl · 36180087
      Miroslav Lichvar authored
      
      
      The PTP_SYS_OFFSET ioctl, which can be used to measure the offset
      between a PHC and the system clock, includes the total time that the
      driver needs to read the PHC timestamp.
      
      This typically involves reading of multiple PCI registers (sometimes in
      multiple iterations) and the register that contains the lowest bits of
      the timestamp is not read in the middle between the two readings of the
      system clock. This asymmetry causes the measured offset to have a
      significant error.
      
      Introduce a new ioctl, driver function, and helper functions, which
      allow the reading of the lowest register to be isolated from the other
      readings in order to reduce the asymmetry. The ioctl returns three
      timestamps for each measurement:
      - system time right before reading the lowest bits of the PHC timestamp
      - PHC time
      - system time immediately after reading the lowest bits of the PHC
        timestamp
      
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      36180087
  6. 02 Nov, 2017 1 commit
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX license identifier to uapi header files with a license · e2be04c7
      Greg Kroah-Hartman authored
      
      
      Many user space API headers have licensing information, which is either
      incomplete, badly formatted or just a shorthand for referring to the
      license under which the file is supposed to be.  This makes it hard for
      compliance tools to determine the correct license.
      
      Update these files with an SPDX license identifier.  The identifier was
      chosen based on the license information in the file.
      
      GPL/LGPL licensed headers get the matching GPL/LGPL SPDX license
      identifier with the added 'WITH Linux-syscall-note' exception, which is
      the officially assigned exception identifier for the kernel syscall
      exception:
      
         NOTE! This copyright does *not* cover user programs that use kernel
         services by normal system calls - this is merely considered normal use
         of the kernel, and does *not* fall under the heading of "derived work".
      
      This exception makes it possible to include GPL headers into non GPL
      code, without confusing license compliance tools.
      
      Headers which have either explicit dual licensing or are just licensed
      under a non GPL license are updated with the corresponding SPDX
      identifier and the GPLv2 with syscall exception identifier.  The format
      is:
              ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)
      
      SPDX license identifiers are a legally binding shorthand, which can be
      used instead of the full boiler plate text.  The update does not remove
      existing license information as this has to be done on a case by case
      basis and the copyright holders might have to be consulted. This will
      happen in a separate step.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.  See the previous patch in this series for the
      methodology of how this patch was researched.
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2be04c7
  7. 03 Mar, 2016 1 commit
    • Christopher S. Hall's avatar
      ptp: Add PTP_SYS_OFFSET_PRECISE for driver crosstimestamping · 719f1aa4
      Christopher S. Hall authored
      
      
      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 <prarit@redhat.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      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: default avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: default avatarChristopher S. Hall <christopher.s.hall@intel.com>
      [jstultz: Commit subject tweaks]
      Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
      719f1aa4
  8. 21 Mar, 2014 1 commit
  9. 01 Nov, 2012 1 commit
  10. 13 Oct, 2012 1 commit
  11. 23 May, 2011 1 commit