1. 23 2月, 2010 8 次提交
  2. 05 12月, 2009 1 次提交
  3. 05 11月, 2009 3 次提交
  4. 28 10月, 2009 1 次提交
  5. 08 10月, 2009 1 次提交
    • Y
      PCI: get larger bridge ranges when space is available · 308cf8e1
      Yinghai Lu 提交于
      Found one system:
      [   71.120590] pci 0000:40:05.0: scanning behind bridge, config 4f4a40, pass 0
      [   71.138283] PCI: Scanning bus 0000:4a
      [   71.140341] pci 0000:4a:00.0: found [15b3:6278] class 000c06 header type 00
      [   71.157173] pci 0000:4a:00.0: reg 10 64bit mmio: [0x000000-0x0fffff]
      [   71.161697] pci 0000:4a:00.0: reg 18 64bit mmio pref: [0x000000-0x7fffff]
      [   71.179403] pci 0000:4a:00.0: reg 20 64bit mmio pref: [0x000000-0xfffffff]
      [   71.185366] pci 0000:4a:00.0: calling quirk_resource_alignment+0x0/0x1dd
      [   71.200846] pci 0000:4a:00.0: disabling ASPM on pre-1.1 PCIe device.  You can enable it with 'pcie_aspm=force'
      [   71.219623] PCI: Fixups for bus 0000:4a
      [   71.222194] pci 0000:40:05.0: bridge 32bit mmio: [0xcf000000-0xcf0fffff]
      [   71.238662] pci 0000:40:05.0: bridge 64bit mmio pref: [0xcd800000-0xcdffffff]
      [   71.255793] PCI: Bus scan for 0000:4a returning with max=4a
      
      Device needs a big pref mmio, but BIOS doesn't allocate mmio to it aside
      from a small MMIO range.  Later, the kernel will not allocate resources to
      that to the device:
      [   99.574030] pci 0000:4a:00.0: BAR 4: can't allocate mem resource [0xd0000000-0xcdffffff]
      [   99.580102] pci 0000:4a:00.0: BAR 2: got res [0xcd800000-0xcdffffff] bus [0xcd800000-0xcdffffff] flags 0x12120c
      [   99.602307] pci 0000:4a:00.0: BAR 2: moved to bus [0xcd800000-0xcdffffff] flags 0x12120c
      [   99.615991] pci 0000:4a:00.0: BAR 0: got res [0xcf000000-0xcf0fffff] bus [0xcf000000-0xcf0fffff] flags 0x120204
      [   99.634499] pci 0000:4a:00.0: BAR 0: moved to bus [0xcf000000-0xcf0fffff] flags 0x120204
      [   99.654318] pci 0000:40:05.0: PCI bridge, secondary bus 0000:4a
      [   99.658766] pci 0000:40:05.0:   IO window: disabled
      [   99.675478] pci 0000:40:05.0:   MEM window: 0xcf000000-0xcf0fffff
      [   99.681663] pci 0000:40:05.0:   PREFETCH window: 0x000000cd800000-0x000000cdffffff
      
      So try to get a big range in the pci bridge if there is no child using
      that range.  With the patch we get:
      [   99.104525] pci 0000:4a:00.0: BAR 4: got res [0xfc080000000-0xfc08fffffff] bus [0xfc080000000-0xfc08fffffff] flags 0x12120c
      [   99.123624] pci 0000:4a:00.0: BAR 4: moved to bus [0xfc080000000-0xfc08fffffff] flags 0x12120c
      [   99.131977] pci 0000:4a:00.0: BAR 2: got res [0xfc090000000-0xfc0907fffff] bus [0xfc090000000-0xfc0907fffff] flags 0x12120c
      [   99.149788] pci 0000:4a:00.0: BAR 2: moved to bus [0xfc090000000-0xfc0907fffff] flags 0x12120c
      [   99.169248] pci 0000:4a:00.0: BAR 0: got res [0xc0200000-0xc02fffff] bus [0xc0200000-0xc02fffff] flags 0x120204
      [   99.189508] pci 0000:4a:00.0: BAR 0: moved to bus [0xc0200000-0xc02fffff] flags 0x120204
      [   99.206402] pci 0000:40:05.0: PCI bridge, secondary bus 0000:4a
      [   99.210637] pci 0000:40:05.0:   IO window: disabled
      [   99.224856] pci 0000:40:05.0:   MEM window: 0xc0200000-0xc03fffff
      [   99.230019] pci 0000:40:05.0:   PREFETCH window: 0x000fc080000000-0x000fc097ffffff
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      308cf8e1
  6. 10 9月, 2009 1 次提交
  7. 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
  8. 12 6月, 2009 2 次提交
  9. 23 4月, 2009 1 次提交
  10. 07 4月, 2009 1 次提交
    • Y
      PCI: Setup disabled bridges even if buses are added · 296ccb08
      Yuji Shimada 提交于
      This patch sets up disabled bridges even if buses have already been
      added.
      
      pci_assign_unassigned_resources is called after buses are added.
      pci_assign_unassigned_resources calls pci_bus_assign_resources.
      pci_bus_assign_resources calls pci_setup_bridge to configure BARs of
      bridges.
      
      Currently pci_setup_bridge returns immediately if the bus have already
      been added. So pci_assign_unassigned_resources can't configure BARs of
      bridges that were added in a disabled state; this patch fixes the issue.
      
      On logical hot-add, we need to prevent the kernel from re-initializing
      bridges that have already been initialized. To achieve this,
      pci_setup_bridge returns immediately if the bridge have already been
      enabled.
      
      We don't need to check whether the specified bus is a root bus or not.
      pci_setup_bridge is not called on a root bus, because a root bus does
      not have a bridge.
      
      The patch adds a new helper function, pci_is_enabled. I made the
      function name similar to pci_is_managed. The codes which use
      enable_cnt directly are changed to use pci_is_enabled.
      Acked-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NYuji Shimada <shimada-yxb@necst.nec.co.jp>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      296ccb08
  11. 21 3月, 2009 1 次提交
  12. 20 3月, 2009 1 次提交
  13. 08 1月, 2009 2 次提交
  14. 21 10月, 2008 2 次提交
  15. 14 9月, 2008 1 次提交
  16. 10 9月, 2008 1 次提交
  17. 04 9月, 2008 1 次提交
    • L
      PCI: fix pbus_size_mem() resource alignment for CardBus controllers · 5f17cfce
      Linus Torvalds 提交于
      Commit 88452565 ("PCI: clean up resource
      alignment management") changed the resource handling to mark how a
      resource was aligned on a per-resource basis.
      
      Thus, instead of looking at the resource number to determine whether it
      was a bridge resource or a regular resource (they have different
      alignment rules), we should just ask the resource for its alignment
      directly.
      
      The reason this broke only cardbus resources was that for the other
      types of resources, the old way of deciding alignment actually still
      happened to work.  But CardBus bridge resources had been changed by
      commit 934b7024 ("Fix cardbus resource
      allocation") to look more like regular resources than PCI bridge
      resources from an alignment handling standpoint.
      Reported-and-tested-by: NAndrew Morton <akpm@linux-foundation.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5f17cfce
  18. 26 6月, 2008 1 次提交
    • B
      PCI: use dev_printk when possible · 80ccba11
      Bjorn Helgaas 提交于
      Convert printks to use dev_printk().
      
      I converted pr_debug() to dev_dbg().  Both use KERN_DEBUG and are enabled
      only when DEBUG is defined.
      
      I converted printk(KERN_DEBUG) to dev_printk(KERN_DEBUG), not to dev_dbg(),
      because dev_dbg() is only enabled when DEBUG is defined.
      
      I converted DBG(KERN_INFO) (only in setup-bus.c) to dev_info().  The DBG()
      name makes it sound like debug, but it's been enabled forever, so dev_info()
      preserves the previous behavior.
      
      I tried to make the resource assignment formats more consistent, e.g.,
        "BAR %d: got res [%#llx-%#llx] bus [%#llx-%#llx] flags %#lx\n"
      instead of sometimes using "start-end" and sometimes using "size@start".
      I'm not attached to one or the other; I'd just like them consistent.
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      80ccba11
  19. 24 6月, 2008 1 次提交
  20. 23 4月, 2008 1 次提交
    • L
      Fix cardbus resource allocation · 934b7024
      Linus Torvalds 提交于
      Commit 88452565 ("PCI: clean up resource
      alignment management") didn't set the alignment information for the
      cardbus window resources, causing their subsequent allocations to fail
      miserably with a message like
      
        yenta_cardbus 0000:15:00.0: device not available because of BAR 7 [100:1ff] collisions
        yenta_cardbus: probe of 0000:15:00.0 failed with error -16
      
      or similar.
      
      This fixes it and clarifies the code a bit too (we used to have to use
      the insane PCI bridge alignment logic that put the alignment in the
      "start" field, this makes it use the slightly easier-to-understand
      size-based alignment, and allows us to set the resource start to zero
      until it gets allocated).
      Reported-and-tested-by: NJeff Chua <jeff.chua.linux@gmail.com>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      934b7024
  21. 21 4月, 2008 3 次提交
    • A
      PCI: pci_setup_bridge() mustn't be __devinit · a391f197
      Adrian Bunk 提交于
      WARNING: drivers/pci/built-in.o(.text+0x28ee9): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a391f197
    • A
      PCI: pci_bus_size_cardbus() mustn't be __devinit · 5468ae61
      Adrian Bunk 提交于
      WARNING: drivers/pci/built-in.o(.text+0x28e1f): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()
      Signed-off-by: NAdrian Bunk <bunk@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      5468ae61
    • I
      PCI: clean up resource alignment management · 88452565
      Ivan Kokshaysky 提交于
      Done per Linus' request and suggestions. Linus has explained that
      better than I'll be able to explain:
      
      On Thu, Mar 27, 2008 at 10:12:10AM -0700, Linus Torvalds wrote:
      > Actually, before we go any further, there might be a less intrusive
      > alternative: add just a couple of flags to the resource flags field (we
      > still have something like 8 unused bits on 32-bit), and use those to
      > implement a generic "resource_alignment()" routine.
      >
      > Two flags would do it:
      >
      >  - IORESOURCE_SIZEALIGN: size indicates alignment (regular PCI device
      >    resources)
      >
      >  - IORESOURCE_STARTALIGN: start field is alignment (PCI bus resources
      >    during probing)
      >
      > and then the case of both flags zero (or both bits set) would actually be
      > "invalid", and we would also clear the IORESOURCE_STARTALIGN flag when we
      > actually allocate the resource (so that we don't use the "start" field as
      > alignment incorrectly when it no longer indicates alignment).
      >
      > That wouldn't be totally generic, but it would have the nice property of
      > automatically at least add sanity checking for that whole "res->start has
      > the odd meaning of 'alignment' during probing" and remove the need for a
      > new field, and it would allow us to have a generic "resource_alignment()"
      > routine that just gets a resource pointer.
      
      Besides, I removed IORESOURCE_BUS_HAS_VGA flag which was unused for ages.
      Signed-off-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Gary Hade <garyhade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      88452565
  22. 27 3月, 2008 1 次提交
  23. 22 2月, 2008 1 次提交
  24. 03 2月, 2008 1 次提交
    • S
      PCI: fix 4x section mismatch warnings · 451124a7
      Sam Ravnborg 提交于
      The following warnings were issued during build of
      drivers/pci with an allyesconfig build:
      WARNING: o-x86_64/drivers/pci/built-in.o(.text+0xdaf): Section mismatch in reference from the function pci_add_new_bus() to the function .devinit.text:pci_alloc_child_bus()
      WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x15e2): Section mismatch in reference from the function pci_scan_single_device() to the function .devinit.text:pci_scan_device()
      WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b0c5): Section mismatch in reference from the function pci_bus_assign_resources() to the function .devinit.text:pci_setup_bridge()
      WARNING: o-x86_64/drivers/pci/built-in.o(.text+0x1b32d): Section mismatch in reference from the function pci_bus_size_bridges() to the function .devinit.text:pci_bus_size_cardbus()
      
      Investigating each case closer it looked like all
      referred functions are only used in the init phase
      or during hotplug.
      So to avoid wasting too much memory in the non-hotplug
      case the simpler fix was to allow the fuctions to
      use code/data from the __devinit sections.
      This was done in all four case by adding the __ref
      annotation.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Adrian Bunk <bunk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      451124a7
  25. 02 2月, 2008 1 次提交
  26. 13 10月, 2007 1 次提交
    • G
      PCI: remove transparent bridge sizing · 8fa5913d
      Gary Hade 提交于
      Remove transparent bridge sizing.
      
      Due to code in pci_read_bridge_bases() [drivers/pci/probe.c] the child
      bus of a transparent bridge already has access to the parent bus
      resources so transparent bridge sizing appears unnecessary.  The bridge
      sizing includes alignment and granularity adjustments that can cause
      significantly more memory to be reserved from the parant bus than
      required by devices on the child bus and allotted by _CRS.
      Signed-off-by: NGary Hade <gary.hade@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8fa5913d