1. 07 1月, 2012 6 次提交
    • B
      PCI: add helpers for building PCI bus resource lists · 45ca9e97
      Bjorn Helgaas 提交于
      We'd like to supply a list of resources when we create a new PCI bus,
      e.g., the root bus under a PCI host bridge.  These are helpers for
      constructing that list.
      
      These are exported because the plan is to replace this exported interface:
          pci_scan_bus_parented()
      with this one:
          pci_add_resource(resources, ...)
          pci_scan_root_bus(..., resources)
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      45ca9e97
    • M
      PCI: Pull PCI 'latency timer' setup up into the core · 96c55900
      Myron Stowe 提交于
      The 'latency timer' of PCI devices, both Type 0 and Type 1,
      is setup in architecture-specific code [see: 'pcibios_set_master()'].
      There are two approaches being taken by all the architectures - check
      if the 'latency timer' is currently set between 16 and 255 and if not
      bring it within bounds, or, do nothing (and then there is the
      gratuitously different PA-RISC implementation).
      
      There is nothing architecture-specific about PCI's 'latency timer' so
      this patch pulls its setup functionality up into the PCI core by
      creating a generic 'pcibios_set_master()' function using the '__weak'
      attribute which can be used by all architectures as a default which,
      if necessary, can then be over-ridden by architecture-specific code.
      
      No functional change.
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      96c55900
    • M
      PCI: add declaration for pcibios_set_master() to pci core · cfce9fb8
      Myron Stowe 提交于
      Currently, pcibios_set_master() is implemented in architecture-
      specific code.  There is nothing architecture-specific about PCI's
      'latency timer'.
      
      This patch adds a declaration for pcibios_set_master() to PCI's core
      in preperation for pulling the function itself up into the core.
      Without the addition of this declaration, subsequent patches that
      remove inline definitions of pcibios_set_master() would be removing
      the only declaration of such.
      
      No functional change.
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      cfce9fb8
    • J
      PCI: Introduce INTx check & mask API · a2e27787
      Jan Kiszka 提交于
      These new PCI services allow to probe for 2.3-compliant INTx masking
      support and then use the feature from PCI interrupt handlers. The
      services are properly synchronized with concurrent config space access
      via sysfs or on device reset.
      
      This enables generic PCI device drivers like uio_pci_generic or KVM's
      device assignment to implement the necessary kernel-side IRQ handling
      without any knowledge about device-specific interrupt status and control
      registers.
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a2e27787
    • J
      PCI: Rework config space blocking services · fb51ccbf
      Jan Kiszka 提交于
      pci_block_user_cfg_access was designed for the use case that a single
      context, the IPR driver, temporarily delays user space accesses to the
      config space via sysfs. This assumption became invalid by the time
      pci_dev_reset was added as locking instance. Today, if you run two loops
      in parallel that reset the same device via sysfs, you end up with a
      kernel BUG as pci_block_user_cfg_access detect the broken assumption.
      
      This reworks the pci_block_user_cfg_access to a sleeping service
      pci_cfg_access_lock and an atomic-compatible variant called
      pci_cfg_access_trylock. The former not only blocks user space access as
      before but also waits if access was already locked. The latter service
      just returns false in this case, allowing the caller to resolve the
      conflict instead of raising a BUG.
      
      Adaptions of the ipr driver were originally written by Brian King.
      Acked-by: NBrian King <brking@linux.vnet.ibm.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      fb51ccbf
    • N
      PCI/sysfs: add per pci device msi[x] irq listing (v5) · da8d1c8b
      Neil Horman 提交于
      This patch adds a per-pci-device subdirectory in sysfs called:
      /sys/bus/pci/devices/<device>/msi_irqs
      
      This sub-directory exports the set of msi vectors allocated by a given
      pci device, by creating a numbered sub-directory for each vector beneath
      msi_irqs.  For each vector various attributes can be exported.
      Currently the only attribute is called mode, which tracks the
      operational mode of that vector (msi vs. msix)
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      da8d1c8b
  2. 01 11月, 2011 1 次提交
  3. 15 10月, 2011 2 次提交
    • R
      PCI / PM: Extend PME polling to all PCI devices · 379021d5
      Rafael J. Wysocki 提交于
      The land of PCI power management is a land of sorrow and ugliness,
      especially in the area of signaling events by devices.  There are
      devices that set their PME Status bits, but don't really bother
      to send a PME message or assert PME#.  There are hardware vendors
      who don't connect PME# lines to the system core logic (they know
      who they are).  There are PCI Express Root Ports that don't bother
      to trigger interrupts when they receive PME messages from the devices
      below.  There are ACPI BIOSes that forget to provide _PRW methods for
      devices capable of signaling wakeup.  Finally, there are BIOSes that
      do provide _PRW methods for such devices, but then don't bother to
      call Notify() for those devices from the corresponding _Lxx/_Exx
      GPE-handling methods.  In all of these cases the kernel doesn't have
      a chance to receive a proper notification that it should wake up a
      device, so devices stay in low-power states forever.  Worse yet, in
      some cases they continuously send PME Messages that are silently
      ignored, because the kernel simply doesn't know that it should clear
      the device's PME Status bit.
      
      This problem was first observed for "parallel" (non-Express) PCI
      devices on add-on cards and Matthew Garrett addressed it by adding
      code that polls PME Status bits of such devices, if they are enabled
      to signal PME, to the kernel.  Recently, however, it has turned out
      that PCI Express devices are also affected by this issue and that it
      is not limited to add-on devices, so it seems necessary to extend
      the PME polling to all PCI devices, including PCI Express and planar
      ones.  Still, it would be wasteful to poll the PME Status bits of
      devices that are known to receive proper PME notifications, so make
      the kernel (1) poll the PME Status bits of all PCI and PCIe devices
      enabled to signal PME and (2) disable the PME Status polling for
      devices for which correct PME notifications are received.
      Tested-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      379021d5
    • B
      PCI: Make pci_setup_bridge() non-static for use by arch code · e2444273
      Benjamin Herrenschmidt 提交于
      The "powernv" platform of the powerpc architecture needs to assign PCI
      resources using a specific algorithm to fit some HW constraints of
      the IBM "IODA" architecture (related to the ability to create error
      handling domains that encompass specific segments of MMIO space).
      
      For doing so, it wants to call pci_setup_bridge() from architecture
      specific resource management in order to configure bridges after all
      resources have been assigned. So make it non-static.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      e2444273
  4. 05 10月, 2011 1 次提交
  5. 24 9月, 2011 1 次提交
  6. 02 8月, 2011 2 次提交
    • R
      PCI : ability to relocate assigned pci-resources · 2bbc6942
      Ram Pai 提交于
      Currently pci-bridges are allocated enough resources to satisfy their immediate
      requirements.  Any additional resource-requests fail if additional free space,
      contiguous to the one already allocated, is not available. This behavior is not
      reasonable since sufficient contiguous resources, that can satisfy the request,
      are available at a different location.
      
      This patch provides the ability to expand and relocate a allocated resource.
      
      	v2: Changelog: Fixed size calculation in pci_reassign_resource()
      	v3: Changelog : Split this patch. The resource.c changes are already
      			upstream. All the pci driver changes are in here.
      Signed-off-by: NRam Pai <linuxram@us.ibm.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      2bbc6942
    • J
      PCI: Set PCI-E Max Payload Size on fabric · b03e7495
      Jon Mason 提交于
      On a given PCI-E fabric, each device, bridge, and root port can have a
      different PCI-E maximum payload size.  There is a sizable performance
      boost for having the largest possible maximum payload size on each PCI-E
      device.  However, if improperly configured, fatal bus errors can occur.
      Thus, it is important to ensure that PCI-E payloads sends by a device
      are never larger than the MPS setting of all devices on the way to the
      destination.
      
      This can be achieved two ways:
      
      - A conservative approach is to use the smallest common denominator of
        the entire tree below a root complex for every device on that fabric.
      
      This means for example that having a 128 bytes MPS USB controller on one
      leg of a switch will dramatically reduce performances of a video card or
      10GE adapter on another leg of that same switch.
      
      It also means that any hierarchy supporting hotplug slots (including
      expresscard or thunderbolt I suppose, dbl check that) will have to be
      entirely clamped to 128 bytes since we cannot predict what will be
      plugged into those slots, and we cannot change the MPS on a "live"
      system.
      
      - A more optimal way is possible, if it falls within a couple of
        constraints:
      * The top-level host bridge will never generate packets larger than the
        smallest TLP (or if it can be controlled independently from its MPS at
        least)
      * The device will never generate packets larger than MPS (which can be
        configured via MRRS)
      * No support of direct PCI-E <-> PCI-E transfers between devices without
        some additional code to specifically deal with that case
      
      Then we can use an approach that basically ignores downstream requests
      and focuses exclusively on upstream requests. In that case, all we need
      to care about is that a device MPS is no larger than its parent MPS,
      which allows us to keep all switches/bridges to the max MPS supported by
      their parent and eventually the PHB.
      
      In this case, your USB controller would no longer "starve" your 10GE
      Ethernet and your hotplug slots won't affect your global MPS.
      Additionally, the hotplugged devices themselves can be configured to a
      larger MPS up to the value configured in the hotplug bridge.
      
      To choose between the two available options, two PCI kernel boot args
      have been added to the PCI calls.  "pcie_bus_safe" will provide the
      former behavior, while "pcie_bus_perf" will perform the latter behavior.
      By default, the latter behavior is used.
      
      NOTE: due to the location of the enablement, each arch will need to add
      calls to this function.  This patch only enables x86.
      
      This patch includes a number of changes recommended by Benjamin
      Herrenschmidt.
      
      Tested-by: Jordan_Hargrave@dell.com
      Signed-off-by: NJon Mason <mason@myri.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      b03e7495
  7. 27 7月, 2011 1 次提交
  8. 22 7月, 2011 2 次提交
    • R
      PCI: Make the struct pci_dev * argument of pci_fixup_irqs const. · d5341942
      Ralf Baechle 提交于
      Aside of the usual motivation for constification,  this function has a
      history of being abused a hook for interrupt and other fixups so I turned
      this function const ages ago in the MIPS code but it should be done
      treewide.
      
      Due to function pointer passing in varous places a few other functions
      had to be constified as well.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      To: Anton Vorontsov <avorontsov@mvista.com>
      To: Chris Metcalf <cmetcalf@tilera.com>
      To: Colin Cross <ccross@android.com>
      Acked-by: N"David S. Miller" <davem@davemloft.net>
      To: Eric Miao <eric.y.miao@gmail.com>
      To: Erik Gilling <konkers@android.com>
      Acked-by: NGuan Xuetao <gxt@mprc.pku.edu.cn>
      To: "H. Peter Anvin" <hpa@zytor.com>
      To: Imre Kaloz <kaloz@openwrt.org>
      To: Ingo Molnar <mingo@redhat.com>
      To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      To: Jesse Barnes <jbarnes@virtuousgeek.org>
      To: Krzysztof Halasa <khc@pm.waw.pl>
      To: Lennert Buytenhek <kernel@wantstofly.org>
      To: Matt Turner <mattst88@gmail.com>
      To: Nicolas Pitre <nico@fluxnic.net>
      To: Olof Johansson <olof@lixom.net>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      To: Richard Henderson <rth@twiddle.net>
      To: Russell King <linux@arm.linux.org.uk>
      To: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: linux-pci@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: linux-tegra@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Cc: x86@kernel.org
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      d5341942
    • M
      PCI: Assign values to 'pci_obff_signal_type' enumeration constants · 688398bb
      Myron Stowe 提交于
      'pci_obff_signal_type' is passed between drivers and the kernel API.
      This patch explicitly assigns values to the enumeration type's constants
      which aids in detecting any future changes or additions that would break
      the kernel's ABI.
      
      No functional change.
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      688398bb
  9. 21 6月, 2011 1 次提交
    • O
      x86/ia64: intel-iommu: move to drivers/iommu/ · 166e9278
      Ohad Ben-Cohen 提交于
      This should ease finding similarities with different platforms,
      with the intention of solving problems once in a generic framework
      which everyone can use.
      
      Note: to move intel-iommu.c, the declaration of pci_find_upstream_pcie_bridge()
      has to move from drivers/pci/pci.h to include/linux/pci.h. This is handled
      in this patch, too.
      
      As suggested, also drop DMAR's EXPERIMENTAL tag while we're at it.
      
      Compile-tested on x86_64.
      Signed-off-by: NOhad Ben-Cohen <ohad@wizery.com>
      Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
      166e9278
  10. 08 6月, 2011 3 次提交
  11. 22 5月, 2011 2 次提交
  12. 12 5月, 2011 3 次提交
  13. 04 5月, 2011 1 次提交
    • D
      vgaarb: use bridges to control VGA routing where possible. · 3448a19d
      Dave Airlie 提交于
      So in a lot of modern systems, a GPU will always be below a parent bridge that won't share with any other GPUs. This means VGA arbitration on those GPUs can be controlled by using the bridge routing instead of io/mem decodes.
      
      The problem is locating which GPUs share which upstream bridges. This patch attempts to identify all the GPUs which can be controlled via bridges, and ones that can't. This patch endeavours to work out the bridge sharing semantics.
      
      When disabling GPUs via a bridge, it doesn't do irq callbacks or touch the io/mem decodes for the gpu.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3448a19d
  14. 22 3月, 2011 1 次提交
  15. 10 3月, 2011 1 次提交
  16. 17 2月, 2011 1 次提交
  17. 15 1月, 2011 3 次提交
  18. 24 12月, 2010 1 次提交
  19. 18 10月, 2010 1 次提交
  20. 16 10月, 2010 1 次提交
  21. 14 8月, 2010 1 次提交
  22. 31 7月, 2010 1 次提交
  23. 17 7月, 2010 1 次提交
    • B
      PCI: fall back to original BIOS BAR addresses · 58c84eda
      Bjorn Helgaas 提交于
      If we fail to assign resources to a PCI BAR, this patch makes us try the
      original address from BIOS rather than leaving it disabled.
      
      Linux tries to make sure all PCI device BARs are inside the upstream
      PCI host bridge or P2P bridge apertures, reassigning BARs if necessary.
      Windows does similar reassignment.
      
      Before this patch, if we could not move a BAR into an aperture, we left
      the resource unassigned, i.e., at address zero.  Windows leaves such BARs
      at the original BIOS addresses, and this patch makes Linux do the same.
      
      This is a bit ugly because we disable the resource long before we try to
      reassign it, so we have to keep track of the BIOS BAR address somewhere.
      For lack of a better place, I put it in the struct pci_dev.
      
      I think it would be cleaner to attempt the assignment immediately when the
      claim fails, so we could easily remember the original address.  But we
      currently claim motherboard resources in the middle, after attempting to
      claim PCI resources and before assigning new PCI resources, and changing
      that is a fairly big job.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16263Reported-by: NAndrew <nitr0@seti.kr.ua>
      Tested-by: NAndrew <nitr0@seti.kr.ua>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      58c84eda
  24. 20 5月, 2010 1 次提交
  25. 10 5月, 2010 1 次提交
    • M
      i7core_edac: Add a code to probe Xeon 55xx bus · d1fd4fb6
      Mauro Carvalho Chehab 提交于
      This code changes the detection procedure of i7core_edac. Instead of
      directly probing for MC registers, it probes for another register found
      on Nehalem. If found, it tries to pick the first MC PCI BUS. This should
      work fine with Xeon 35xx, but, on Xeon 55xx, this is at bus 254 and 255
      that are not properly detected by the non-legacy PCI methods.
      
      The new detection code scans specifically at buses 254 and 255 for the
      Xeon 55xx devices.
      
      This code has not tested yet. After working, a change at the code will
      be needed, since the i7core is not yet ready for working with 2 sets of
      MC.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      d1fd4fb6