1. 21 12月, 2006 1 次提交
    • R
      PCI legacy resource fix · fb0f2b40
      Ralf Baechle 提交于
      Since commit 368c73d4 the kernel will try
      to update the non-writeable BAR registers 0..3 of PIIX4 IDE adapters if
      pci_assign_unassigned_resources() is used to do full resource assignment of
      the bus.  This fails because in the PIIX4 these BAR registers have
      implicitly assumed values and read back as zero; it used to work because
      the kernel used to just write zero to that register the read back value did
      match what was written.
      
      The fix is a new resource flag IORESOURCE_PCI_FIXED used to mark a resource
      as non-movable.  This will also be useful to keep other import system
      resources from being moved around - for example system consoles on PCI
      busses.
      
      [akpm@osdl.org: cleanup]
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      fb0f2b40
  2. 08 12月, 2006 1 次提交
    • C
      [PATCH] add numa node information to struct device · 87348136
      Christoph Hellwig 提交于
      For node-aware skb allocations we need information about the node in struct
      net_device or struct device.  Davem suggested to put it into struct device
      which this patch does.
      
      In particular:
      
       - struct device gets a new int numa_node member if CONFIG_NUMA is set
       - there are two new helpers, dev_to_node and set_dev_node to
         transparently deal with the non-numa case
       - for pci devices the node-info is set to the value we get from
         pcibus_to_node.
      
      Note that for some architectures pcibus_to_node doesn't work yet at the time
      we call it currently.  This is harmless and will just mean skb allocations
      aren't node-local on this architectures until the implementation of
      pcibus_to_node on these architectures have been updated (There are patches for
      x86 and x86_64 floating around)
      
      [akpm@osdl.org: cleanup]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Christoph Lameter <clameter@engr.sgi.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      87348136
  3. 02 12月, 2006 1 次提交
    • A
      PCI: quirks: fix the festering mess that claims to handle IDE quirks · 368c73d4
      Alan Cox 提交于
      The number of permutations of crap we do is amazing and almost all of it
      has the wrong effect in 2.6.
      
      At the heart of this is the PCI SFF magic which says that compatibility
      mode PCI IDE controllers use ISA IRQ routing and hard coded addresses
      not the BAR values. The old quirks variously clears them, sets them,
      adjusts them and then IDE ignores the result.
      
      In order to drive all this garbage out and to do it portably we need to
      handle the SFF rules directly and properly. Because we know the device
      BAR 0-3 are not used in compatibility mode we load them with the values
      that are implied (and indeed which many controllers actually
      thoughtfully put there in this mode anyway).
      
      This removes special cases in the IDE layer and libata which now knows
      that bar 0/1/2/3 always contain the correct address. It means our
      resource allocation map is accurate from boot, not "mostly accurate"
      after ide is loaded, and it shoots lots of code. There is also lots more
      code and magic constant knowledge to shoot once this is in and settled.
      
      Been in my test tree for a while both with drivers/ide and with libata.
      Wants some -mm shakedown in case I've missed something dumb or there are
      corner cases lurking.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      368c73d4
  4. 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
  5. 27 9月, 2006 1 次提交
  6. 11 7月, 2006 1 次提交
    • L
      [PATCH] pci: initialize struct pci_dev.error_state · 82081797
      Linas Vepstas 提交于
      The pci channel state is currently uninitialized, thus there are two ways
      of indicating that "everything's OK": 0 and 1.  This is a bit of a burden.
      
      If a devce driver wants to check if the pci channel is in a working or a
      disconnected state, the driver writer must perform checks similar to
      
         if((pdev->error_state != 0) &&
            (pdev->error_state != pci_channel_io_normal)) {
               whatever();
         }
      
      which is rather akward.  The first check is needed because stuct pci_dev is
      inited to all-zeros.  The scond is needed because the error recovery will
      set the state to pci_channel_io_normal (which is not zero).
      
      This patch fixes this awkwardness.
      Signed-off-by: NLinas Vepstas <linas@austin.ibm.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      82081797
  7. 22 6月, 2006 3 次提交
  8. 24 3月, 2006 5 次提交
    • E
      [PATCH] PCI: kzalloc() conversion in drivers/pci · f5afe806
      Eric Sesterhenn 提交于
      this patch converts drivers/pci to kzalloc usage.
      Compile tested with allyes config.
      Signed-off-by: NEric Sesterhenn <snakebyte@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f5afe806
    • 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
    • M
      [PATCH] PCI: make MSI quirk inheritable from the pci bus · 6e325a62
      Michael S. Tsirkin 提交于
      It turns out AMD 8131 quirk only affects MSI for devices behind the 8131 bridge.
      Handle this by adding a flags field in pci_bus, inherited from parent to child.
      Signed-off-by: NMichael S. Tsirkin <mst@mellanox.co.il>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6e325a62
    • R
      [PATCH] PCI: Avoid leaving MASTER_ABORT disabled permanently when returning from pci_scan_bridge. · bbe8f9a3
      Ralf Baechle 提交于
      > On Mon, Feb 13, 2006 at 05:13:21PM -0800, David S. Miller wrote:
      > >
      > > In drivers/pci/probe.c:pci_scan_bridge(), if this is not the first
      > > pass (pass != 0) we don't restore the PCI_BRIDGE_CONTROL_REGISTER and
      > > thus leave PCI_BRIDGE_CTL_MASTER_ABORT off:
      > >
      > > int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass)
      > > {
      > >  ...
      > > 	/* Disable MasterAbortMode during probing to avoid reporting
      > > 	   of bus errors (in some architectures) */
      > > 	pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &bctl);
      > > 	pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
      > > 			      bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
      > >  ...
      > > 	if ((buses & 0xffff00) && !pcibios_assign_all_busses() && !is_cardbus) {
      > > 		unsigned int cmax, busnr;
      > > 		/*
      > > 		 * Bus already configured by firmware, process it in the first
      > > 		 * pass and just note the configuration.
      > > 		 */
      > > 		if (pass)
      > > 			return max;
      > >  ...
      > > 	}
      > >
      > > 	pci_write_config_word(dev, PCI_BRIDGE_CONTROL, bctl);
      > >  ...
      > >
      > > This doesn't seem intentional.
      
      Agreed, looks like an accident.  The patch [1] originally came from Kip
      Walker (Broadcom back then) between 2.6.0-test3 and 2.6.0-test4.  As I
      recall it was supposed to fix an issue with with PCI aborts being
      signalled by the PCI bridge of the Broadcom BCM1250 family of SOCs when
      probing behind pci_scan_bridge.  It is undeseriable to disable
      PCI_BRIDGE_CTL_MASTER_ABORT in pci_{read,write)_config_* and the
      behaviour wasn't considered a bug in need of a workaround, so this was
      put in probe.c.
      
      I don't have an affected system at hand, so can't really test but I
      propose something like the below patch.
      
      [1] http://www.linux-mips.org/git?p=linux.git;a=commit;h=599457e0cb702a31a3247ea6a5d9c6c99c4cf195
      
      [PCI] Avoid leaving MASTER_ABORT disabled permanently when returning from pci_scan_bridge.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bbe8f9a3
    • K
      [PATCH] PCI: really fix parent's subordinate busnr · e3ac86d8
      Kristen Accardi 提交于
      After you find the maximum value of the subordinate buses below the child
      bus, you must fix the parent's subordinate bus number again, otherwise
      it may be too small.
      Signed-off-by: NKristen Carlson Accardi <kristen.c.accardi@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e3ac86d8
  9. 10 1月, 2006 5 次提交
  10. 29 10月, 2005 1 次提交
  11. 23 9月, 2005 1 次提交
    • I
      [PATCH] pci: fixup parent subordinate busnr · 12f44f46
      Ivan Kokshaysky 提交于
      I believe the change that broke things is introduction of
      pci_fixup_parent_subordinate_busnr().
      
      The patch here does two things:
      - hunk #1 should fix the problems you've seen when you boot without
        additional "pci" kernel options;
      - hunk #2 supposedly fixes boot with "pci=assign-busses" option which
        otherwise hangs Acer TM81xx machines as reported.
      
      Please try this with and without "pci=assign-busses". If it boots,
      I'd like to see 'lspci -vvx' for both cases.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      12f44f46
  12. 22 9月, 2005 1 次提交
    • A
      [PATCH] fix drivers/pci/probe.c warning · 3c6de929
      Amos Waterland 提交于
      This function expects an unsigned 32-bit type as its third argument:
      
       static u32 pci_size(u32 base, u32 maxbase, u32 mask)
      
      However, given these definitions:
      
       #define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
       #define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
      
      these two calls in drivers/pci/probe.c are problematic for architectures
      for which a UL is not equivalent to a u32:
      
       sz = pci_size(l, sz, PCI_BASE_ADDRESS_MEM_MASK);
       sz = pci_size(l, sz, PCI_ROM_ADDRESS_MASK);
      
      Hence the below compile warning when building for ARCH=ppc64:
      
       drivers/pci/probe.c: In function `pci_read_bases':
       /.../probe.c:168: warning: large integer implicitly truncated to unsigned type
       /.../probe.c:218: warning: large integer implicitly truncated to unsigned type
      
      Here is a simple fix.
      Signed-off-by: NAmos Waterland <apw@us.ibm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3c6de929
  13. 11 9月, 2005 1 次提交
  14. 10 9月, 2005 1 次提交
  15. 09 9月, 2005 2 次提交
  16. 30 7月, 2005 1 次提交
  17. 02 7月, 2005 2 次提交
  18. 28 6月, 2005 4 次提交
  19. 14 6月, 2005 1 次提交
    • O
      [PATCH] Fix PCI BAR size interpretation on 64-bit arches · f797f9cc
      Olof Johansson 提交于
      On 64-bit machines, PCI_BASE_ADDRESS_MEM_MASK and other mask constants
      passed to pci_size() are 64-bit (for example ~0x0fUL).  However, pci_size
      does comparisons between the u32 arguments and the mask, which will fail
      even though any result from pci_size is still just 32-bit.
      
      Changing the mask argument to u32 seems the obvious thing to do, since all
      arithmetic in the function is 32-bit and having a larger mask makes no
      sense.
      
      This triggered on a PPC64 system here where an adapter (VGA, as it
      happened) had a memory region base of 0xfe000000 and a sz of the same,
      matching the if (max == maxbase ...) test at the bottom of pci_size but
      failing the mask comparison.  Quite a corner case which I guess explains
      why we haven't seen it until now.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Acked-by: NGreg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f797f9cc
  20. 04 5月, 2005 1 次提交
  21. 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