1. 20 4月, 2017 1 次提交
  2. 04 2月, 2017 1 次提交
    • E
      PCI: Lock each enable/disable num_vfs operation in sysfs · 5b0948df
      Emil Tantilov 提交于
      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: NEmil Tantilov <emil.s.tantilov@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      CC: Alexander Duyck <alexander.h.duyck@intel.com>
      5b0948df
  3. 30 11月, 2016 3 次提交
  4. 24 11月, 2016 1 次提交
    • G
      PCI: Do any VF BAR updates before enabling the BARs · f40ec3c7
      Gavin Shan 提交于
      Previously we enabled VFs and enable their memory space before calling
      pcibios_sriov_enable().  But pcibios_sriov_enable() may update the VF BARs:
      for example, on PPC PowerNV we may change them to manage the association of
      VFs to PEs.
      
      Because 64-bit BARs cannot be updated atomically, it's unsafe to update
      them while they're enabled.  The half-updated state may conflict with other
      devices in the system.
      
      Call pcibios_sriov_enable() before enabling the VFs so any BAR updates
      happen while the VF BARs are disabled.
      
      [bhelgaas: changelog]
      Tested-by: NCarol Soto <clsoto@us.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      f40ec3c7
  5. 13 9月, 2016 1 次提交
  6. 09 3月, 2016 1 次提交
  7. 01 3月, 2016 1 次提交
  8. 31 10月, 2015 4 次提交
  9. 30 10月, 2015 4 次提交
  10. 31 3月, 2015 9 次提交
  11. 20 11月, 2014 1 次提交
  12. 17 9月, 2014 1 次提交
  13. 30 5月, 2014 1 次提交
  14. 20 2月, 2014 1 次提交
  15. 11 1月, 2014 1 次提交
  16. 23 11月, 2013 1 次提交
    • E
      PCI: Clear NumVFs when disabling SR-IOV in sriov_init() · 045cc22e
      ethan.zhao 提交于
      When SR-IOV is disabled (VF Enable is cleared), NumVFs is not very useful,
      so this patch clears it out to prevent confusing lspci output like that
      below.  We already clear NumVFs in sriov_disable(), and this does the same
      when we disable SR-IOV as part of parsing the SR-IOV capability.
      
        $ lspci -vvv -s 13:00.0
        13:00.0 Ethernet controller: Intel Corporation 82599EB 10-Gigabit SFI/SFP+ Network Connection (rev 01)
            Capabilities: [160 v1] Single Root I/O Virtualization (SR-IOV)
                IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy+
                Initial VFs: 64, Total VFs: 64, Number of VFs: 64, ...
      
      [bhelgaas: changelog]
      Signed-off-by: Nethan.zhao <ethan.kernel@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      045cc22e
  17. 15 11月, 2013 1 次提交
  18. 01 8月, 2013 1 次提交
  19. 31 7月, 2013 1 次提交
  20. 26 7月, 2013 1 次提交
  21. 15 6月, 2013 2 次提交
  22. 06 6月, 2013 1 次提交
    • G
      PCI: Convert alloc_pci_dev(void) to pci_alloc_dev(bus) · 8b1fce04
      Gu Zheng 提交于
      Use the new pci_alloc_dev(bus) to replace the existing using of
      alloc_pci_dev(void).
      
      [bhelgaas: drop pci_bus ref later in pci_release_dev()]
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      8b1fce04
  23. 01 6月, 2013 1 次提交
    • X
      PCI: Finish SR-IOV VF setup before adding the device · fbf33f51
      Xudong Hao 提交于
      Commit 4f535093 "PCI: Put pci_dev in device tree as early as possible"
      moves device registering from pci_bus_add_devices() to pci_device_add().
      That causes problems for virtual functions because device_add(&virtfn->dev)
      is called before setting the virtfn->is_virtfn flag, which then causes Xen
      to report PCI virtual functions as PCI physical functions.
      
      Fix it by setting virtfn->is_virtfn before calling pci_device_add().
      
      [Jiang Liu]: Move the setting of virtfn->is_virtfn ahead further for better
      readability and modify changelog.
      Signed-off-by: NXudong Hao <xudong.hao@intel.com>
      Signed-off-by: NJiang Liu <jiang.liu@huawei.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org	# v3.9+
      fbf33f51