1. 06 11月, 2012 2 次提交
  2. 03 11月, 2012 2 次提交
    • H
      PCI/PM: Resume device before shutdown · 3ff2de9b
      Huang Ying 提交于
      Some actions during shutdown need device to be in D0 state, such as
      MSI shutdown etc, so resume device before shutdown.
      
      Without this patch, a device may not be enumerated after a kexec
      because the corresponding bridge is not in D0, so that
      configuration space of the device is not accessible.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      CC: stable@vger.kernel.org		# v3.6+
      3ff2de9b
    • H
      PCI/PM: Fix deadlock when unbinding device if parent in D3cold · 90b5c1d7
      Huang Ying 提交于
      If a PCI device and its parents are put into D3cold, unbinding the
      device will trigger deadlock as follow:
      
      - driver_unbind
        - device_release_driver
          - device_lock(dev)				<--- previous lock here
          - __device_release_driver
            - pm_runtime_get_sync
              ...
                - rpm_resume(dev)
                  - rpm_resume(dev->parent)
                    ...
                      - pci_pm_runtime_resume
                        ...
                        - pci_set_power_state
                          - __pci_start_power_transition
                            - pci_wakeup_bus(dev->parent->subordinate)
                              - pci_walk_bus
                                - device_lock(dev)	<--- deadlock here
      
      
      If we do not do device_lock in pci_walk_bus, we can avoid deadlock.
      Device_lock in pci_walk_bus is introduced in commit:
      d71374da, corresponding email thread
      is: https://lkml.org/lkml/2006/5/26/38.  The patch author Zhang Yanmin
      said device_lock is added to pci_walk_bus because:
      
        Some error handling functions call pci_walk_bus. For example, PCIe
        aer. Here we lock the device, so the driver wouldn't detach from the
        device, as the cb might call driver's callback function.
      
      So I fixed the deadlock as follows:
      
      - remove device_lock from pci_walk_bus
      - add device_lock into callback if callback will call driver's callback
      
      I checked pci_walk_bus users one by one, and found only PCIe aer needs
      device lock.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      CC: stable@vger.kernel.org		# v3.6+
      CC: Zhang Yanmin <yanmin.zhang@intel.com>
      90b5c1d7
  3. 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
  4. 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
  5. 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
  6. 19 9月, 2012 4 次提交
  7. 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
  8. 13 9月, 2012 3 次提交
  9. 12 9月, 2012 3 次提交
  10. 11 9月, 2012 3 次提交
  11. 08 9月, 2012 3 次提交
  12. 01 9月, 2012 1 次提交
  13. 25 8月, 2012 4 次提交
  14. 24 8月, 2012 7 次提交