1. 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
  2. 21 3月, 2009 1 次提交
  3. 20 3月, 2009 1 次提交
  4. 08 1月, 2009 2 次提交
  5. 21 10月, 2008 2 次提交
  6. 14 9月, 2008 1 次提交
  7. 10 9月, 2008 1 次提交
  8. 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
  9. 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
  10. 24 6月, 2008 1 次提交
  11. 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
  12. 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
  13. 27 3月, 2008 1 次提交
  14. 22 2月, 2008 1 次提交
  15. 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
  16. 02 2月, 2008 1 次提交
  17. 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
  18. 12 7月, 2007 1 次提交
  19. 03 5月, 2007 1 次提交
    • S
      pci: do not mark exported functions as __devinit · 96bde06a
      Sam Ravnborg 提交于
      Functions marked __devinit will be removed after kernel init.  But being
      exported they are potentially called by a module much later.
      
      So the safer choice seems to be to keep the function even in the non
      CONFIG_HOTPLUG case.
      
      This silence the follwoing section mismatch warnings:
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_device from __ksymtab_gpl between '__ksymtab_pci_bus_add_device' (at offset 0x20) and '__ksymtab_pci_walk_bus'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_create_bus from __ksymtab_gpl between '__ksymtab_pci_create_bus' (at offset 0x40) and '__ksymtab_pci_stop_bus_device'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_max_busnr from __ksymtab_gpl between '__ksymtab_pci_bus_max_busnr' (at offset 0xc0) and '__ksymtab_pci_assign_resource_fixed'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_claim_resource from __ksymtab_gpl between '__ksymtab_pci_claim_resource' (at offset 0xe0) and '__ksymtab_pcie_port_bus_type'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_add_devices from __ksymtab between '__ksymtab_pci_bus_add_devices' (at offset 0x70) and '__ksymtab_pci_bus_alloc_resource'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_scan_bus_parented from __ksymtab between '__ksymtab_pci_scan_bus_parented' (at offset 0x90) and '__ksymtab_pci_root_buses'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_assign_resources from __ksymtab between '__ksymtab_pci_bus_assign_resources' (at offset 0x4d0) and '__ksymtab_pci_bus_size_bridges'
      WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:pci_bus_size_bridges from __ksymtab between '__ksymtab_pci_bus_size_bridges' (at offset 0x4e0) and '__ksymtab_pci_setup_cardbus'
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      96bde06a
  20. 17 2月, 2007 1 次提交
  21. 23 12月, 2006 1 次提交
    • A
      [PATCH] increase CARDBUS_MEM_SIZE · fe0e5c4d
      Andrew Morton 提交于
      Linus sayeth:
      
      Google knows everything, and finds, on MS own site no less:
      
        "Windows 2000 default resources:
      
         One 4K memory window
      
         One 2 MB memory window
      
         Two 256-byte I/O windows"
      
      which is clearly utterly bogus and insufficient. But Microsoft apparently
      realized this, and:
      
        "Windows XP default resources:
      
         Because one memory window of 4K and one window of 2 MB are not
         sufficient for CardBus controllers in many configurations, Windows XP
         allocates larger memory windows to CardBus controllers where possible.
         However, resource windows are static (that is, the operating system
         does not dynamically allocate larger memory windows if new devices
         appear.) Under Windows XP, CardBus controllers will be assigned the
         following resources:
      
         One 4K memory window, as in Windows 2000
      
         64 MB memory, if that amount of memory is available. If 64 MB is not
         available the controller will receive 32 MB; if 32 MB is not available,
         the controller will receive 16 MB; if 16 MB is not available, the
         bridge will receive 8 MB; and so on down to a minimum assignment of 1
         MB in configurations where memory is too constrained for the operating
         system to provide a larger window.
      
         Two 256-byte I/O windows"
      
      So I think we have our answer. Windows uses one 4k window, and one 64MB
      window. And they are no more dynamic than we are (we _could_ try to do it
      dynamically, but let's face it, it's fairly painful to dynamically expand
      PCI bus resources - you may need to reprogram everything up to the root,
      so it would be absolutely crazy to do that unless you have some serious
      masochistic tendencies).
      
      So let's just increase our default value to 64M too.
      
      Cc: Markus Rechberger <mrechberger@gmail.com>
      Cc: Daniel Ritz <daniel.ritz@gmx.ch>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fe0e5c4d
  22. 04 10月, 2006 1 次提交
    • K
      [PATCH] fix "PCI: assign ioapic resource at hotplug" · 9bded00b
      Kenji Kaneshige 提交于
      Roland Dreier wrote:
      > The change "PCI: assign ioapic resource at hotplug" (commit
      > 23186279 in Linus's tree) makes
      > networking stop working on my system (SuperMicro H8QC8 with four
      > dual-core Opteron 885 CPUs).  In particular, the on-board NIC stops
      > working, probably because it gets assigned the wrong IRQ (225 in the
      > non-working case, 217 in the working case)
      >
      > With that patch applied, e1000 doesn't work.  Reverting just that
      > patch (shown below) from Linus's latest tree fixes things for me.
      >
      
      The cause of this problem might be an wrong assumption that the 'start'
      member of resource structure for ioapic device has non-zero value if the
      resources are assigned by firmware.  The 'start' member of ioapic device
      seems not to be set even though the resources were actually assigned to
      ioapic devices by firmware.
      
      Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Cc: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
      Cc: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
      Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Roland Dreier <rdreier@cisco.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      9bded00b
  23. 27 9月, 2006 1 次提交
  24. 28 6月, 2006 1 次提交
  25. 22 6月, 2006 1 次提交
    • K
      [PATCH] PCI: don't move ioapics below PCI bridge · c0da3ba0
      Kimball Murray 提交于
      A recent Stratus x86_64 platform uses a system ioapic that is a PCI device
      located below a PCI bridge.  Other platforms like this may exist.
      
      This patch fixes a problem wherein the kernel's PCI setup code moves
      the ioapic to an address other than that assigned by the BIOS.  It simply
      adds another exclusion (which already includes classless devices and host
      bridges) to the function pbus_assign_resources_sorted so that it will not
      move the ioapic.
      
      If the ioapic is moved, the fixmap mapping to it is broken, so the OS should
      leave it alone.
      
      From: Kimball Murray <kimball.murray@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c0da3ba0
  26. 24 10月, 2005 1 次提交
    • L
      cardbus: limit IO windows to 256 bytes · 4196c3af
      Linus Torvalds 提交于
      That's what we've always historically done, and bigger windows seem to
      confuse some cardbus bridges. Or something.
      
      Alan reports that this makes the ThinkPad 600x series work properly
      again: the 4kB IO window for some reason made IDE DMA not work, which
      makes IDE painfully slow even if it works after DMA timeouts.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4196c3af
  27. 10 9月, 2005 1 次提交
  28. 31 8月, 2005 1 次提交
    • I
      [PATCH] x86: pci_assign_unassigned_resources() update · 81d4af13
      Ivan Kokshaysky 提交于
      I had some time to think about PCI assign issues in 2.6.13-rc series.
      
      The major problem here is that we call pci_assign_unassigned_resources()
      way too early - at subsys_initcall level. Therefore we give no chances
      to ACPI and PnP routines (called at fs_initcall level) to reserve their
      respective resources properly, as the comments in drivers/pnp/system.c
      and drivers/acpi/motherboard.c suggest:
      
       /**
        * Reserve motherboard resources after PCI claim BARs,
        * but before PCI assign resources for uninitialized PCI devices
        */
      
      So I moved the pci_assign_unassigned_resources() call to
      pcibios_assign_resources() (fs_initcall), which should hopefully fix a
      lot of problems and make PCIBIOS_MIN_IO tweaks unnecessary.
      
      Other changes:
      - remove resource assignment code from pcibios_assign_resources(), since
        it duplicates pci_assign_unassigned_resources() functionality and
        actually does nothing in 2.6.13;
      - modify ROM assignment code as per Ben's suggestion: try to use firmware
        settings by default (if PCI_ASSIGN_ROMS is not set);
      - set CARDBUS_IO_SIZE back to 4K as it's a wonderful stress test for
        various setups.
      
      Confirmed by Tero Roponen <teanropo@cc.jyu.fi> (who had problems with
      the 4kB CardBus IO size previously).
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      81d4af13
  29. 27 8月, 2005 1 次提交
  30. 30 7月, 2005 1 次提交
  31. 07 7月, 2005 1 次提交
    • I
      [PATCH] yet another fix for setup-bus.c/x86 merge · 960b8466
      Ivan Kokshaysky 提交于
      There is a slight disagreement between setup-bus.c code and traditional
      x86 PCI setup wrt which recourses are invalid vs resources that are free
      for further allocations.
      
      In particular, in the setup-bus.c, if we failed to allocate some resource,
      we nullify "start" and "flags" fields, but *not* the "end" one.
      
      But x86 pcibios_enable_resources() does the following check:
      
      	if (!r->start && r->end) {
      		printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
      		return -EINVAL;
      
      which means that the device owning the offending resource cannot be
      enabled.
      
      In particular, this breaks cardbus behind the normal decode p2p bridge -
      the cardbus code from setup-bus.c requests rather large IO and MEM
      windows, and if it fails, the socket is completely unavailable.  Which
      is wrong, as the yenta code is capable to allocate smaller windows.
      Signed-off-by: NIvan Kokshaysky <ink@jurassic.park.msu.ru>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      960b8466
  32. 02 7月, 2005 1 次提交
    • I
      [PATCH] PCI: pci_assign_unassigned_resources() on x86 · 299de034
      Ivan Kokshaysky 提交于
      - Add sanity check for io[port,mem]_resource in setup-bus.c. These
        resources look like "free" as they have no parents, but obviously
        we must not touch them.
      - In i386.c:pci_allocate_bus_resources(), if a bridge resource cannot be
        allocated for some reason, then clear its flags. This prevents any child
        allocations in this range, so the setup-bus code will work with a clean
        resource sub-tree.
      - i386.c:pcibios_enable_resources() doesn't enable bridges, as it checks
        only resources 0-5, which looks like a clear bug to me. I suspect it
        might break hotplug as well in some cases.
      
      From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      299de034
  33. 28 6月, 2005 1 次提交
  34. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4