1. 06 Mar, 2020 6 commits
    • Jacob Keller's avatar
      ice: Use pci_get_dsn() · ceb2f007
      Jacob Keller authored
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      The pci_get_dsn() function will perform two pci_read_config_dword calls
      to read the lower and upper config dwords. It bitwise ORs them into
      a u64 value. Instead of using put_unaligned_le32 to convert the value to
      LE32 format, just use the %016llX printf specifier. This will print the
      u64 correct, putting the most significant byte of the value first. Since
      pci_get_dsn() correctly orders the two dwords into a u64, this should
      produce equivalent results in less code.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ceb2f007
    • Jacob Keller's avatar
      scsi: qedf: Use pci_get_dsn() · dbce64cb
      Jacob Keller authored
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      The original code used a for-loop that looped over each of the 8 bytes
      and copied them into a temporary buffer. pci_get_dsn() uses two calls to
      pci_read_config_dword, and correctly bitwise ORs them into a u64. Thus,
      we can simplify the snprintf significantly using %016llX on a u64 value.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dbce64cb
    • Jacob Keller's avatar
      bnxt_en: Use pci_get_dsn() · 8d85b75b
      Jacob Keller authored
      Replace the open-coded implementation for reading the PCIe DSN with
      pci_get_dsn().
      
      Use of put_unaligned_le64 should be correct. pci_get_dsn() will perform
      two pci_read_config_dword calls. The first dword will be placed in the
      first 32 bits of the u64, while the second dword will be placed in the
      upper 32 bits of the u64.
      
      On Little Endian systems, the least significant byte comes first, which
      will be the least significant byte of the first dword, followed by the
      least significant byte of the second dword. Since the _le32 variations
      do not perform byte swapping, we will correctly copy the dwords into the
      dsn[] array in the same order as before.
      
      On Big Endian systems, the most significant byte of the second dword
      will come first. put_unaligned_le64 will perform a CPU_TO_LE64, which
      will swap things correctly before copying. This should also end up with
      the correct bytes in the dsn[] array.
      
      While at it, fix a small typo in the netdev_info error message when the
      DSN cannot be read.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8d85b75b
    • Jacob Keller's avatar
      PCI: Introduce pci_get_dsn · 70c0923b
      Jacob Keller authored
      Several device drivers read their Device Serial Number from the PCIe
      extended config space.
      
      Introduce a new helper function, pci_get_dsn(). This function reads the
      eight bytes of the DSN and returns them as a u64. If the capability does not
      exist for the device, the function returns 0.
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Cc: Michael Chan <michael.chan@broadcom.com>
      Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70c0923b
    • Matthew Wilcox (Oracle)'s avatar
      ibmveth: Remove unused page_offset macro · 367ab29e
      Matthew Wilcox (Oracle) authored
      We already have a function called page_offset(), and this macro
      is unused, so just delete it.
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      367ab29e
    • Vivek Thampi's avatar
      ptp: add VMware virtual PTP clock driver · 7d10001e
      Vivek Thampi authored
      Add a PTP clock driver called ptp_vmw, for guests running on VMware ESXi
      hypervisor. The driver attaches to a VMware virtual device called
      "precision clock" that provides a mechanism for querying host system time.
      Similar to existing virtual PTP clock drivers (e.g. ptp_kvm), ptp_vmw
      utilizes the kernel's PTP hardware clock API to implement a clock device
      that can be used as a reference in Chrony for synchronizing guest time with
      host.
      
      The driver is only applicable to x86 guests running in VMware virtual
      machines with precision clock virtual device present. It uses a VMware
      specific hypercall mechanism to read time from the device.
      Reviewed-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
      Signed-off-by: default avatarVivek Thampi <vithampi@vmware.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d10001e
  2. 05 Mar, 2020 27 commits
  3. 04 Mar, 2020 7 commits