1. 10 9月, 2009 29 次提交
  2. 30 8月, 2009 1 次提交
    • C
      PCI SR-IOV: correct broken resource alignment calculations · 6faf17f6
      Chris Wright 提交于
      An SR-IOV capable device includes an SR-IOV PCIe capability which
      describes the Virtual Function (VF) BAR requirements.  A typical SR-IOV
      device can support multiple VFs whose BARs must be in a contiguous region,
      effectively an array of VF BARs.  The BAR reports the size requirement
      for a single VF.  We calculate the full range needed by simply multiplying
      the VF BAR size with the number of possible VFs and create a resource
      spanning the full range.
      
      This all seems sane enough except it artificially inflates the alignment
      requirement for the VF BAR.  The VF BAR need only be aligned to the size
      of a single BAR not the contiguous range of VF BARs.  This can cause us
      to fail to allocate resources for the BAR despite the fact that we
      actually have enough space.
      
      This patch adds a thin PCI specific layer over the generic
      resource_alignment() function which is aware of the special nature of
      VF BARs and does sorting and allocation based on the smaller alignment
      requirement.
      
      I recognize that while resource_alignment is generic, it's basically a
      PCI helper.  An alternative to this patch is to add PCI VF BAR specific
      information to struct resource.  I opted for the extra layer rather than
      adding such PCI specific information to struct resource.  This does
      have the slight downside that we don't cache the BAR size and re-read
      for each alignment query (happens a small handful of times during boot
      for each VF BAR).
      Signed-off-by: NChris Wright <chrisw@sous-sol.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Yu Zhao <yu.zhao@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      6faf17f6
  3. 21 8月, 2009 1 次提交
  4. 08 8月, 2009 2 次提交
    • K
      PCI hotplug: SGI hotplug: do not use hotplug_slot_attr · 94f81a47
      Kenji Kaneshige 提交于
      By the pci slot changes, callbacks of attributes under slot directory
      (/sys/bus/pci/slots) had been changed to get the pointer to struct
      pci_slot instead of struct hotplug_slot. So the path_show() that
      assumes the parameter is a pointer to struct hotplug_slot seems
      broken.
      Tested-by: NMike Habeck <habeck@sgi.com>
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      94f81a47
    • K
      PCI hotplug: SGI hotplug: fix build failure · d25f1438
      Kenji Kaneshige 提交于
      The commit bd3d99c1 ("PCI: Remove
      untested Electromechanical Interlock (EMI) support in pciehp."), which
      removes the definition of "struct hotplug_slot_attr", broke SGI
      hotplug driver. By this commit, we get the following compile error.
      
      drivers/pci/hotplug/sgi_hotplug.c:106: error: variable 'sn_slot_path_attr' has initializer but incomplete type
      drivers/pci/hotplug/sgi_hotplug.c:106: error: unknown field 'attr' specified in initializer
      drivers/pci/hotplug/sgi_hotplug.c:106: error: extra brace group at end of initializer
      drivers/pci/hotplug/sgi_hotplug.c:106: error: (near initialization for 'sn_slot_path_attr')
      drivers/pci/hotplug/sgi_hotplug.c:106: warning: excess elements in struct initializer
      drivers/pci/hotplug/sgi_hotplug.c:106: warning: (near initialization for 'sn_slot_path_attr')
      drivers/pci/hotplug/sgi_hotplug.c:106: error: unknown field 'show' specified in initializer
      drivers/pci/hotplug/sgi_hotplug.c:106: warning: excess elements in struct initializer
      drivers/pci/hotplug/sgi_hotplug.c:106: warning: (near initialization for 'sn_slot_path_attr')
      drivers/pci/hotplug/sgi_hotplug.c: In function 'sn_hp_destroy':
      drivers/pci/hotplug/sgi_hotplug.c:203: error: invalid use of undefined type 'struct hotplug_slot_attribute'
      drivers/pci/hotplug/sgi_hotplug.c: In function 'sn_hotplug_slot_register':
      drivers/pci/hotplug/sgi_hotplug.c:655: error: invalid use of undefined type 'struct hotplug_slot_attribute'
      
      This patch fixes this regression by adding the definition of struct
      hotplug_slot_attr into sgi_hotplug.c.
      Tested-by: NMike Habeck <habeck@sgi.com>
      Signed-off-by: NKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      d25f1438
  5. 06 8月, 2009 1 次提交
  6. 05 8月, 2009 2 次提交
  7. 03 8月, 2009 1 次提交
    • L
      Make pci_claim_resource() use request_resource() rather than insert_resource() · 79896cf4
      Linus Torvalds 提交于
      This function has traditionally used "insert_resource()", because before
      commit cebd78a8 ("Fix pci_claim_resource") it used to just insert the
      resource into whatever root resource tree that was indicated by
      "pcibios_select_root()".
      
      So there Matthew fixed it to actually look up the proper parent
      resource, which means that now it's actively wrong to then traverse the
      resource tree any more: we already know exactly where the new resource
      should go.
      
      And when we then did commit a76117df ("x86: Use pci_claim_resource"),
      which changed the x86 PCI code from the open-coded
      
      	pr = pci_find_parent_resource(dev, r);
      	if (!pr || request_resource(pr, r) < 0) {
      
      to using
      
      	if (pci_claim_resource(dev, idx) < 0) {
      
      that "insert_resource()" now suddenly became a problem, and causes a
      regression covered by
      
      	http://bugzilla.kernel.org/show_bug.cgi?id=13891
      
      which this fixes.
      Reported-and-tested-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Andrew Patterson <andrew.patterson@hp.com>
      Cc: Linux PCI <linux-pci@vger.kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      79896cf4
  8. 13 7月, 2009 1 次提交
  9. 09 7月, 2009 1 次提交
  10. 05 7月, 2009 1 次提交
    • D
      intel-iommu: Don't use identity mapping for PCI devices behind bridges · 3dfc813d
      David Woodhouse 提交于
      Our current strategy for pass-through mode is to put all devices into
      the 1:1 domain at startup (which is before we know what their dma_mask
      will be), and only _later_ take them out of that domain, if it turns out
      that they really can't address all of memory.
      
      However, when there are a bunch of PCI devices behind a bridge, they all
      end up with the same source-id on their DMA transactions, and hence in
      the same IOMMU domain. This means that we _can't_ easily move them from
      the 1:1 domain into their own domain at runtime, because there might be DMA
      in-flight from their siblings.
      
      So we have to adjust our pass-through strategy: For PCI devices not on
      the root bus, and for the bridges which will take responsibility for
      their transactions, we have to start up _out_ of the 1:1 domain, just in
      case.
      
      This fixes the BUG() we see when we have 32-bit-capable devices behind a
      PCI-PCI bridge, and use the software identity mapping.
      
      It does mean that we might end up using 'normal' mapping mode for some
      devices which could actually live with the faster 1:1 mapping -- but
      this is only for PCI devices behind bridges, which presumably aren't the
      devices for which people are most concerned about performance.
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      3dfc813d