1. 15 Feb, 2017 11 commits
  2. 14 Feb, 2017 5 commits
  3. 10 Feb, 2017 10 commits
  4. 09 Feb, 2017 2 commits
  5. 03 Feb, 2017 2 commits
    • Emil Tantilov's avatar
      PCI: Lock each enable/disable num_vfs operation in sysfs · 5b0948df
      Emil Tantilov authored
      Enabling/disabling SRIOV via sysfs by echo-ing multiple values
      simultaneously:
      
        # echo 63 > /sys/class/net/ethX/device/sriov_numvfs&
        # echo 63 > /sys/class/net/ethX/device/sriov_numvfs
      
        # sleep 5
      
        # echo 0 > /sys/class/net/ethX/device/sriov_numvfs&
        # echo 0 > /sys/class/net/ethX/device/sriov_numvfs
      
      results in the following bug:
      
        kernel BUG at drivers/pci/iov.c:495!
        invalid opcode: 0000 [#1] SMP
        CPU: 1 PID: 8050 Comm: bash Tainted: G   W   4.9.0-rc7-net-next #2092
        RIP: 0010:[<ffffffff813b1647>]
      	    [<ffffffff813b1647>] pci_iov_release+0x57/0x60
      
        Call Trace:
         [<ffffffff81391726>] pci_release_dev+0x26/0x70
         [<ffffffff8155be6e>] device_release+0x3e/0xb0
         [<ffffffff81365ee7>] kobject_cleanup+0x67/0x180
         [<ffffffff81365d9d>] kobject_put+0x2d/0x60
         [<ffffffff8155bc27>] put_device+0x17/0x20
         [<ffffffff8139c08a>] pci_dev_put+0x1a/0x20
         [<ffffffff8139cb6b>] pci_get_dev_by_id+0x5b/0x90
         [<ffffffff8139cca5>] pci_get_subsys+0x35/0x40
         [<ffffffff8139ccc8>] pci_get_device+0x18/0x20
         [<ffffffff8139ccfb>] pci_get_domain_bus_and_slot+0x2b/0x60
         [<ffffffff813b09e7>] pci_iov_remove_virtfn+0x57/0x180
         [<ffffffff813b0b95>] pci_disable_sriov+0x65/0x140
         [<ffffffffa00a1af7>] ixgbe_disable_sriov+0xc7/0x1d0 [ixgbe]
         [<ffffffffa00a1e9d>] ixgbe_pci_sriov_configure+0x3d/0x170 [ixgbe]
         [<ffffffff8139d28c>] sriov_numvfs_store+0xdc/0x130
        ...
        RIP  [<ffffffff813b1647>] pci_iov_release+0x57/0x60
      
      Use the existing mutex lock to protect each enable/disable operation.
      Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      CC: Alexander Duyck <alexander.h.duyck@intel.com>
      5b0948df
    • Matthew R. Ochs's avatar
      PCI: Increase VPD access timeout to 125ms · 4f69bd16
      Matthew R. Ochs authored
      The PCI core uses a fixed 50ms timeout when waiting for VPD accesses to
      complete.  When an access does not complete within this period, a warning
      is logged and an error returned to the caller.
      
      While this default timeout is valid for most hardware, some devices can
      experience longer access delays under certain circumstances.  For example,
      one of the IBM CXL Flash devices can take up to ~120ms in a worst-case
      scenario.  These types of devices can benefit from an extended timeout.
      
      To support devices with a longer access delay, increase the timeout in
      pci_vpd_wait() to 125ms.  The PCI specification is silent with respect to
      VPD delays, therefore there is no concern for violating a threshold.
      Tested-by: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      4f69bd16
  6. 30 Jan, 2017 1 commit
    • Bjorn Helgaas's avatar
      PCI: Avoid possible deadlock on pci_lock and p->pi_lock · cdcb33f9
      Bjorn Helgaas authored
      pci_lock is an IRQ-safe spinlock that protects all accesses to PCI
      configuration space (see PCI_OP_READ() and PCI_OP_WRITE() in pci/access.c).
      
      The pci_cfg_access_unlock() path acquires pci_lock, then p->pi_lock (inside
      wake_up_all()).  According to lockdep, there is a possible path involving
      snbep_uncore_pci_read_counter() that could acquire them in the reverse
      order: acquiring p->pi_lock, then pci_lock, which could result in a
      deadlock.  Lockdep details are in the bugzilla below.
      
      Avoid the possible deadlock by dropping pci_lock before waking up any
      config access waiters.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=192901Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      cdcb33f9
  7. 28 Jan, 2017 1 commit
  8. 13 Jan, 2017 3 commits
  9. 12 Jan, 2017 1 commit
  10. 11 Jan, 2017 3 commits
  11. 02 Jan, 2017 1 commit
    • Bjorn Helgaas's avatar
      PCI: Apply _HPX settings only to relevant devices · 977509f7
      Bjorn Helgaas authored
      Previously we didn't check the type of device before trying to apply Type 1
      (PCI-X) or Type 2 (PCIe) Setting Records from _HPX.
      
      We don't support PCI-X Setting Records, so this was harmless, but the
      warning was useless.
      
      We do support PCIe Setting Records, and we didn't check whether a device
      was PCIe before applying settings.  I don't think anything bad happened on
      non-PCIe devices because pcie_capability_clear_and_set_word(),
      pcie_cap_has_lnkctl(), etc., would fail before doing any harm.  But it's
      ugly to depend on those internals.
      
      Check the device type before attempting to apply Type 1 and Type 2 Setting
      Records (Type 0 records are applicable to PCI, PCI-X, and PCIe devices).
      
      A side benefit is that this prevents useless "not supported" warnings when
      a BIOS supplies a Type 1 (PCI-X) Setting Record and we try to apply it to
      every single device:
      
        pci 0000:00:00.0: PCI-X settings not supported
      
      After this patch, we'll get the warning only when a BIOS supplies a Type 1
      record and we have a PCI-X device to which it should be applied.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=187731Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      977509f7