1. 19 10月, 2006 1 次提交
    • M
      PCI: optionally sort device lists breadth-first · 6b4b78fe
      Matt Domsch 提交于
      Problem:
      New Dell PowerEdge servers have 2 embedded ethernet ports, which are
      labeled NIC1 and NIC2 on the chassis, in the BIOS setup screens, and
      in the printed documentation.  Assuming no other add-in ethernet ports
      in the system, Linux 2.4 kernels name these eth0 and eth1
      respectively.  Many people have come to expect this naming.  Linux 2.6
      kernels name these eth1 and eth0 respectively (backwards from
      expectations).  I also have reports that various Sun and HP servers
      have similar behavior.
      
      
      Root cause:
      Linux 2.4 kernels walk the pci_devices list, which happens to be
      sorted in breadth-first order (or pcbios_find_device order on i386,
      which most often is breadth-first also).  2.6 kernels have both the
      pci_devices list and the pci_bus_type.klist_devices list, the latter
      is what is walked at driver load time to match the pci_id tables; this
      klist happens to be in depth-first order.
      
      On systems where, for physical routing reasons, NIC1 appears on a
      lower bus number than NIC2, but NIC2's bridge is discovered first in
      the depth-first ordering, NIC2 will be discovered before NIC1.  If the
      list were sorted breadth-first, NIC1 would be discovered before NIC2.
      
      A PowerEdge 1955 system has the following topology which easily
      exhibits the difference between depth-first and breadth-first device
      lists.
      
      -[0000:00]-+-00.0  Intel Corporation 5000P Chipset Memory Controller Hub
                 +-02.0-[0000:03-08]--+-00.0-[0000:04-07]--+-00.0-[0000:05-06]----00.0-[0000:06]----00.0  Broadcom Corporation NetXtreme II BCM5708S Gigabit Ethernet (labeled NIC2, 2.4 kernel name eth1, 2.6 kernel name eth0)
                 +-1c.0-[0000:01-02]----00.0-[0000:02]----00.0  Broadcom Corporation NetXtreme II BCM5708S Gigabit Ethernet (labeled NIC1, 2.4 kernel name eth0, 2.6 kernel name eth1)
      
      
      Other factors, such as device driver load order and the presence of
      PCI slots at various points in the bus hierarchy further complicate
      this problem; I'm not trying to solve those here, just restore the
      device order, and thus basic behavior, that 2.4 kernels had.
      
      
      Solution:
      
      The solution can come in multiple steps.
      
      Suggested fix #1: kernel
      Patch below optionally sorts the two device lists into breadth-first
      ordering to maintain compatibility with 2.4 kernels.  It adds two new
      command line options:
        pci=bfsort
        pci=nobfsort
      to force the sort order, or not, as you wish.  It also adds DMI checks
      for the specific Dell systems which exhibit "backwards" ordering, to
      make them "right".
      
      
      Suggested fix #2: udev rules from userland
      Many people also have the expectation that embedded NICs are always
      discovered before add-in NICs (which this patch does not try to do).
      Using the PCI IRQ Routing Table provided by system BIOS, it's easy to
      determine which PCI devices are embedded, or if add-in, which PCI slot
      they're in.  I'm working on a tool that would allow udev to name
      ethernet devices in ascending embedded, slot 1 .. slot N order,
      subsort by PCI bus/dev/fn breadth-first.  It'll be possible to use it
      independent of udev as well for those distributions that don't use
      udev in their installers.
      
      Suggested fix #3: system board routing rules
      One can constrain the system board layout to put NIC1 ahead of NIC2
      regardless of breadth-first or depth-first discovery order.  This adds
      a significant level of complexity to board routing, and may not be
      possible in all instances (witness the above systems from several
      major manufacturers).  I don't want to encourage this particular train
      of thought too far, at the expense of not doing #1 or #2 above.
      
      
      Feedback appreciated.  Patch tested on a Dell PowerEdge 1955 blade
      with 2.6.18.
      
      You'll also note I took some liberty and temporarily break the klist
      abstraction to simplify and speed up the sort algorithm.  I think
      that's both safe and appropriate in this instance.
      Signed-off-by: NMatt Domsch <Matt_Domsch@dell.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      6b4b78fe
  2. 26 9月, 2006 1 次提交
    • A
      [PATCH] x86: Allow disabling early pci scans with pci=noearly or disallowing conf1 · 0637a70a
      Andi Kleen 提交于
      Some buggy systems can machine check when config space accesses
      happen for some non existent devices.  i386/x86-64 do some early
      device scans that might trigger this. Allow pci=noearly to disable
      this. Also when type 1 is disabling also don't do any early
      accesses which are always type1.
      
      This moves the pci= configuration parsing to be a early parameter.
      I don't think this can break anything because it only changes
      a single global that is only used by PCI.
      
      Cc: gregkh@suse.de
      Cc: Trammell Hudson <hudson@osresearch.net>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      0637a70a
  3. 19 9月, 2006 1 次提交
    • L
      Revert mmiocfg heuristics and blacklist changes · 79e453d4
      Linus Torvalds 提交于
      This reverts commits 11012d41 and
      40dd2d20, which allowed us to use the
      MMIO accesses for PCI config cycles even without the area being marked
      reserved in the e820 memory tables.
      
      Those changes were needed for EFI-environment Intel macs, but broke some
      newer Intel 965 boards, so for now it's better to revert to our old
      2.6.17 behaviour and at least avoid introducing any new breakage.
      
      Andi Kleen has a set of patches that work with both EFI and the broken
      Intel 965 boards, which will be applied once they get wider testing.
      
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Edgar Hucek <hostmaster@ed-soft.at>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      79e453d4
  4. 31 8月, 2006 1 次提交
  5. 13 7月, 2006 1 次提交
  6. 22 6月, 2006 1 次提交
    • R
      [PATCH] PCI: i386/x86_84: disable PCI resource decode on device disable · 53e4d30d
      Rajesh Shah 提交于
      When a PCI device is disabled via pci_disable_device(), it's still
      left decoding its BAR resource ranges even though its driver
      will have likely released those regions (and may even have
      unloaded). pci_enable_device() already explicitly enables
      BAR resource decode for the device being enabled. This patch
      disables resource decode for the PCI device being disabled,
      making it symmetric with the enable call.
      
      I saw this while doing something else, not because of a
      problem report. Still, seems to be the correct thing to do.
      Signed-off-by: NRajesh Shah <rajesh.shah@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      53e4d30d
  7. 24 3月, 2006 1 次提交
    • B
      [PATCH] PCI: PCI/Cardbus cards hidden, needs pci=assign-busses to fix · 8c4b2cf9
      Bernhard Kaindl 提交于
      "In some cases, especially on modern laptops with a lot of PCI and cardbus
      bridges, we're unable to assign correct secondary/subordinate bus numbers
      to all cardbus bridges due to BIOS limitations unless we are using
      "pci=assign-busses" boot option." -- Ivan Kokshaysky (from a patch comment)
      
      Without it, Cardbus cards inserted are never seen by PCI because the parent
      PCI-PCI Bridge of the Cardbus bridge will not pass and translate Type 1 PCI
      configuration cycles correctly and the system will fail to find and
      initialise the PCI devices in the system.
      
      Reference: PCI-PCI Bridges: PCI Configuration Cycles and PCI Bus Numbering:
      http://www.science.unitn.it/~fiorella/guidelinux/tlk/node72.html
      
      The reason for this is that:
       ``All PCI busses located behind a PCI-PCI bridge must reside between the
      secondary bus number and the subordinate bus number (inclusive).''
      
      "pci=assign-busses" makes pcibios_assign_all_busses return 1 and this
      turns on PCI renumbering during PCI probing.
      
      Alan suggested to use DMI automatically set assign-busses on problem systems.
      
      The only question for me was where to put it.  I put it directly before
      scanning PCI bus into pcibios_scan_root() because it's called from legacy,
      acpi and numa and so it can be one place for all systems and configurations
      which may need it.
      
      AMD64 Laptops are also affected and fixed by assign-busses, and the code is
      also incuded from arch/x86_64/pci/ that place will also work for x86_64
      kernels, I only ifdef'-ed the x86-only Laptop in this example.
      
      Affected and known or assumed to be fixed with it are (found by googling):
      
      * ASUS Z71V and L3s
      * Samsung X20
      * Compaq R3140us and all Compaq R3000 series laptops with TI1620 Controller,
        also Compaq R4000 series (from a kernel.org bugreport)
      * HP zv5000z (AMD64 3700+, known that fixup_parent_subordinate_busnr fixes it)
      * HP zv5200z
      * IBM ThinkPad 240
      * An IBM ThinkPad (1.8 GHz Pentium M) debugged by Pavel Machek
        gives the correspondig message which detects the possible problem.
      * MSI S260 / Medion SIM 2100 MD 95600
      
      The patch also expands the "try pci=assign-busses" warning so testers will
      help us to update the DMI table.
      
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8c4b2cf9
  8. 24 11月, 2005 1 次提交
  9. 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
  10. 30 7月, 2005 1 次提交
  11. 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
  12. 28 6月, 2005 2 次提交
    • R
      [PATCH] acpi bridge hotadd: ACPI based root bridge hot-add · c431ada4
      Rajesh Shah 提交于
      When you hot-plug a (root) bridge hierarchy, it may have p2p bridges and
      devices attached to it that have not been configured by firmware.  In this
      case, we need to configure the devices before starting them.  This patch
      separates device start from device scan so that we can introduce the
      configuration step in the middle.
      
      I kept the existing semantics for pci_scan_bus() since there are a huge number
      of callers to that function.
      
      Also, I have no way of testing the changes I made to the parisc files, so this
      needs review by those folks.  Sorry for the massive cross-post, this touches
      files in many different places.
      Signed-off-by: NRajesh Shah <rajesh.shah@intel.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c431ada4
    • J
      [PATCH] PCI Allow OutOfRange PIRQ table address · 120bb424
      jayalk@intworks.biz 提交于
      I updated this to remove unnecessary variable initialization, make
      check_routing be inline only and not __init, switch to strtoul, and
      formatting fixes as per Randy Dunlap's recommendations.
      
      I updated this to change pirq_table_addr to a long, and to add a warning
      msg if the PIRQ table wasn't found at the specified address, as per thread
      with Matthew Wilcox.
      
      In our hardware situation, the BIOS is unable to store or generate it's PIRQ
      table in the F0000h-100000h standard range. This patch adds a pci kernel
      parameter, pirqaddr to allow the bootloader (or BIOS based loader) to inform
      the kernel where the PIRQ table got stored. A beneficial side-effect is that,
      if one's BIOS uses a static address each time for it's PIRQ table, then
      pirqaddr can be used to avoid the $pirq search through that address block each
      time at boot for normal PIRQ BIOSes.
      Signed-off-by: NJaya Kumar <jayalk@intworks.biz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      120bb424
  13. 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