1. 10 11月, 2012 4 次提交
    • D
      PCI: Provide method to reduce the number of total VFs supported · bff73156
      Donald Dutile 提交于
      Some implementations of SRIOV provide a capability structure
      value of TotalVFs that is greater than what the software can support.
      Provide a method to reduce the capability structure reported value
      to the value the driver can support.
      This ensures sysfs reports the current capability of the system,
      hardware and software.
      Example for its use: igb & ixgbe -- report 8 & 64 as TotalVFs,
      but drivers only support 7 & 63 maximum.
      Signed-off-by: NDonald Dutile <ddutile@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      bff73156
    • D
      PCI: SRIOV control and status via sysfs · 1789382a
      Donald Dutile 提交于
      Provide files under sysfs to determine the maximum number of VFs
      an SR-IOV-capable PCIe device supports, and methods to enable and
      disable the VFs on a per-device basis.
      
      Currently, VF enablement by SR-IOV-capable PCIe devices is done
      via driver-specific module parameters.  If not setup in modprobe files,
      it requires admin to unload & reload PF drivers with number of desired
      VFs to enable.  Additionally, the enablement is system wide: all
      devices controlled by the same driver have the same number of VFs
      enabled.  Although the latter is probably desired, there are PCI
      configurations setup by system BIOS that may not enable that to occur.
      
      Two files are created for the PF of PCIe devices with SR-IOV support:
      
          sriov_totalvfs	Contains the maximum number of VFs the device
      			could support as reported by the TotalVFs register
      			in the SR-IOV extended capability.
      
          sriov_numvfs	Contains the number of VFs currently enabled on
      			this device as reported by the NumVFs register in
      			the SR-IOV extended capability.
      
      			Writing zero to this file disables all VFs.
      
      			Writing a positive number to this file enables that
      			number of VFs.
      
      These files are readable for all SR-IOV PF devices.  Writes to the
      sriov_numvfs file are effective only if a driver that supports the
      sriov_configure() method is attached.
      Signed-off-by: NDonald Dutile <ddutile@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      1789382a
    • Y
      PCI: Use is_visible() with boot_vga attribute for pci_dev · 625e1d59
      Yinghai Lu 提交于
      Should make pci_create_sysfs_dev_files() simpler.  Also fix possible
      memleak in remove path.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      625e1d59
    • Y
      PCI: Add pci_device_type to pdev's device struct · 4e15c46b
      Yinghai Lu 提交于
      Need type filled in device structure so it can be used for visible
      attribute control in sysfs for pci_dev.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4e15c46b
  2. 25 9月, 2012 2 次提交
    • J
      PCI: acpiphp: Handle PCIe ports without native hotplug capability · 5ba113f7
      Jiang Liu 提交于
      Commit 0d52f54e (PCI / ACPI: Make acpiphp
      ignore root bridges using PCIe native hotplug) added code that made the
      acpiphp driver completely ignore PCIe root complexes for which the kernel
      had been granted control of the native PCIe hotplug feature by the BIOS
      through _OSC. Later commit 619a5182
      "PCI hotplug: Always allow acpiphp to handle non-PCIe bridges" relaxed
      the constraints to allow acpiphp driver handle non-PCIe bridges under
      such a complex.  The constraint needs to be relaxed further to allow
      acpiphp driver to handle PCIe ports without native PCIe hotplug capability.
      
      Some MR-IOV switch chipsets, such PLX8696, support multiple virtual PCIe
      switches and may migrate downstream ports among virtual switches.  To
      migrate a downstream port from the source virtual switch to the target, the
      port needs to be hot-removed from the source and hot-added into the target.
      The pciehp driver can't be used here because there are no slots within the
      virtual PCIe switch.  So acpiphp driver is used to support downstream port
      migration.  A typical configuration is as below:
      
          [Root without native PCIe HP]
              [Upstream port of vswitch without native PCIe HP]
                  [Downstream port of vswitch with native PCIe HP]
                      [PCIe endpoint]
      
      Here acpiphp driver will be used to handle root ports and upstream port
      in the virtual switch, and pciehp driver will be used to handle downstream
      ports in the virtual switch.
      Signed-off-by: NJiang Liu <liuj97@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
      5ba113f7
    • T
      PCI/ACPI: Pass acpi_pci_root to acpi_pci_drivers' add/remove interface · 55bfe3c0
      Taku Izumi 提交于
      This patch changes .add/.remove interfaces of acpi_pci_driver.
      In the current implementation acpi_handle is passed as a parameter
      of .add/.remove interface.  However, the acpi_pci_root structure
      contains more useful information than just the acpi_handle.  This
      enables us to avoid some useless lookups in each acpi_pci_driver.
      
      Note: This changes interfaces used by acpi_pci_register_driver(), an
      exported symbol.  This patch updates all the in-kernel users, but any
      out-of-kernel acpi_pci_register_driver() users will need updates.
      
      [bhelgaas: changelog]
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      55bfe3c0
  3. 21 9月, 2012 2 次提交
    • Y
      PCI: Stop all children first, before removing all children · 3891b6ac
      Yinghai Lu 提交于
      This restores the previous behavior of stopping all child devices before
      removing any of them.  The current SR-IOV design, where removing the PF
      also drops references on all the VFs, depends on having the VFs continue
      to exist after having been stopped.
      
      [bhelgaas: changelog]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      3891b6ac
    • B
      Revert "PCI: Use hotplug-safe pci_get_domain_bus_and_slot()" · 94bb3464
      Bjorn Helgaas 提交于
      This reverts commit 433efd22.
      
      When we remove an SR-IOV device, we have this call chain:
      
          driver .remove() method
              pci_disable_sriov()
                  sriov_disable()
                      virtfn_remove()
                          pci_get_domain_bus_and_slot()
      
      sriov_disable() is only called for PFs, not for VFs.  When it's called
      for a PF, it loops through all the VFs and calls virtfn_remove() for
      each.  But we stop and remove VFs before PFs, so by the time we get
      to virtfn_remove(), the VFs have already been stopped and deleted
      from the device list.  Now pci_get_domain_bus_and_slot(), which uses
      bus_find_device() and relies on that device list, doesn't find the
      VFs, so the VF references aren't released correctly.
      Reported-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      94bb3464
  4. 20 9月, 2012 1 次提交
    • A
      PM: Prevent runtime suspend during system resume · 88d26136
      Alan Stern 提交于
      This patch (as1591) moves the pm_runtime_get_noresume() and
      pm_runtime_put_sync() calls from __device_suspend() and
      device_resume() to device_prepare() and device_complete() in the PM
      core.
      
      The reason for doing this is to make sure that parent devices remain
      at full power (i.e., don't go into runtime suspend) while their
      children are being resumed from a system sleep.
      
      The PCI core already contained equivalent code to serve the same
      purpose.  The patch removes the duplicated code, since it is no longer
      needed.  One of the comments from the PCI core gets moved into the PM
      core, and a second comment is added to explain whe the _get_noresume
      and _put_sync calls are present.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      88d26136
  5. 19 9月, 2012 4 次提交
  6. 18 9月, 2012 3 次提交
    • G
      powerpc/eeh: Remove EEH PE for normal PCI hotplug · 20ee6a97
      Gavin Shan 提交于
      Function eeh_rmv_from_parent_pe() could be called by the path of
      either normal PCI hotplug, or EEH recovery. For the former case,
      we need purge the corresponding PE on removal of the associated
      PE bus.
      
      The patch tries to cover that by passing more information to function
      pcibios_remove_pci_devices() so that we know if the corresponding PE
      needs to be purged or be marked as "invalid".
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      20ee6a97
    • K
      PCI: Convert "new_id"/"remove_id" into generic pci_bus driver attributes · bfb09a86
      Konstantin Khlebnikov 提交于
      This patch removes hardcoded sysfs attributes manipulation and
      converts them into generic pci_bus->drv_attrs. This saves several bytes.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@openvz.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      bfb09a86
    • K
      xen/pcifront: Use Xen-SWIOTLB when initting if required. · 3d925320
      Konrad Rzeszutek Wilk 提交于
      We piggyback on "xen/swiotlb: Use the swiotlb_late_init_with_tbl to init
      Xen-SWIOTLB late when PV PCI is used." functionality to start up
      the Xen-SWIOTLB if we are hot-plugged. This allows us to bypass
      the need to supply 'iommu=soft' on the Linux command line (mostly).
      With this patch, if a user forgot 'iommu=soft' on the command line,
      and hotplug a PCI device they will get:
      
      pcifront pci-0: Installing PCI frontend
      Warning: only able to allocate 4 MB for software IO TLB
      software IO TLB [mem 0x2a000000-0x2a3fffff] (4MB) mapped at [ffff88002a000000-ffff88002a3fffff]
      pcifront pci-0: Creating PCI Frontend Bus 0000:00
      pcifront pci-0: PCI host bridge to bus 0000:00
      pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
      pci_bus 0000:00: root bus resource [mem 0x00000000-0xfffffffff]
      pci 0000:00:00.0: [8086:10d3] type 00 class 0x020000
      pci 0000:00:00.0: reg 10: [mem 0xfe5c0000-0xfe5dffff]
      pci 0000:00:00.0: reg 14: [mem 0xfe500000-0xfe57ffff]
      pci 0000:00:00.0: reg 18: [io  0xe000-0xe01f]
      pci 0000:00:00.0: reg 1c: [mem 0xfe5e0000-0xfe5e3fff]
      pcifront pci-0: claiming resource 0000:00:00.0/0
      pcifront pci-0: claiming resource 0000:00:00.0/1
      pcifront pci-0: claiming resource 0000:00:00.0/2
      pcifront pci-0: claiming resource 0000:00:00.0/3
      e1000e: Intel(R) PRO/1000 Network Driver - 2.0.0-k
      e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
      e1000e 0000:00:00.0: Disabling ASPM L0s L1
      e1000e 0000:00:00.0: enabling device (0000 -> 0002)
      e1000e 0000:00:00.0: Xen PCI mapped GSI16 to IRQ34
      e1000e 0000:00:00.0: (unregistered net_device): Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
      e1000e 0000:00:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:1b:21:ab:c6:13
      e1000e 0000:00:00.0: eth0: Intel(R) PRO/1000 Network Connection
      e1000e 0000:00:00.0: eth0: MAC: 3, PHY: 8, PBA No: E46981-005
      
      The "Warning only" will go away if one supplies 'iommu=soft' instead
      as we have a higher chance of being able to allocate large swaths of
      memory.
      Acked-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      3d925320
  7. 13 9月, 2012 3 次提交
  8. 12 9月, 2012 3 次提交
  9. 11 9月, 2012 3 次提交
  10. 08 9月, 2012 3 次提交
  11. 01 9月, 2012 1 次提交
  12. 25 8月, 2012 4 次提交
  13. 24 8月, 2012 7 次提交