1. 09 9月, 2005 7 次提交
    • P
      [PATCH] PCI: Add pci_walk_bus function to PCI core (nonrecursive) · cecf4864
      Paul Mackerras 提交于
      The PCI error recovery infrastructure needs to be able to contact all
      the drivers affected by a PCI error event, which may mean traversing
      all the devices under a given PCI-PCI bridge.  This patch adds a
      function to the PCI core that traverses all the PCI devices on a PCI
      bus and under any PCI-PCI bridges on that bus (and so on), calling a
      given function for each device.  This provides a way for the error
      recovery code to iterate through all devices that are affected by an
      error event.
      
      This version is not implemented as a recursive function.  Instead,
      when we reach a PCI-PCI bridge, we set the pointers to start doing the
      devices on the bus under the bridge, and when we reach the end of a
      bus's devices, we use the bus->self pointer to go back up to the next
      higher bus and continue doing its devices.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      cecf4864
    • D
      [PATCH] Make sparc64 use setup-res.c · 085ae41f
      David S. Miller 提交于
      There were three changes necessary in order to allow
      sparc64 to use setup-res.c:
      
      1) Sparc64 roots the PCI I/O and MEM address space using
         parent resources contained in the PCI controller structure.
         I'm actually surprised no other platforms do this, especially
         ones like Alpha and PPC{,64}.  These resources get linked into the
         iomem/ioport tree when PCI controllers are probed.
      
         So the hierarchy looks like this:
      
         iomem --|
      	   PCI controller 1 MEM space --|
      				        device 1
      					device 2
      					etc.
      	   PCI controller 2 MEM space --|
      				        ...
         ioport --|
                  PCI controller 1 IO space --|
      					...
                  PCI controller 2 IO space --|
      					...
      
         You get the idea.  The drivers/pci/setup-res.c code allocates
         using plain iomem_space and ioport_space as the root, so that
         wouldn't work with the above setup.
      
         So I added a pcibios_select_root() that is used to handle this.
         It uses the PCI controller struct's io_space and mem_space on
         sparc64, and io{port,mem}_resource on every other platform to
         keep current behavior.
      
      2) quirk_io_region() is buggy.  It takes in raw BUS view addresses
         and tries to use them as a PCI resource.
      
         pci_claim_resource() expects the resource to be fully formed when
         it gets called.  The sparc64 implementation would do the translation
         but that's absolutely wrong, because if the same resource gets
         released then re-claimed we'll adjust things twice.
      
         So I fixed up quirk_io_region() to do the proper pcibios_bus_to_resource()
         conversion before passing it on to pci_claim_resource().
      
      3) I was mistakedly __init'ing the function methods the PCI controller
         drivers provide on sparc64 to implement some parts of these
         routines.  This was, of course, easy to fix.
      
      So we end up with the following, and that nasty SPARC64 makefile
      ifdef in drivers/pci/Makefile is finally zapped.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      085ae41f
    • J
      [PATCH] PCI: restore BAR values after D3hot->D0 for devices that need it · 064b53db
      John W. Linville 提交于
      Some PCI devices (e.g. 3c905B, 3c556B) lose all configuration
      (including BARs) when transitioning from D3hot->D0.  This leaves such
      a device in an inaccessible state.  The patch below causes the BARs
      to be restored when enabling such a device, so that its driver will
      be able to access it.
      
      The patch also adds pci_restore_bars as a new global symbol, and adds a
      correpsonding EXPORT_SYMBOL_GPL for that.
      
      Some firmware (e.g. Thinkpad T21) leaves devices in D3hot after a
      (re)boot.  Most drivers call pci_enable_device very early, so devices
      left in D3hot that lose configuration during the D3hot->D0 transition
      will be inaccessible to their drivers.
      
      Drivers could be modified to account for this, but it would
      be difficult to know which drivers need modification.  This is
      especially true since often many devices are covered by the same
      driver.  It likely would be necessary to replicate code across dozens
      of drivers.
      
      The patch below should trigger only when transitioning from D3hot->D0
      (or at boot), and only for devices that have the "no soft reset" bit
      cleared in the PM control register.  I believe it is safe to include
      this patch as part of the PCI infrastructure.
      
      The cleanest implementation of pci_restore_bars was to call
      pci_update_resource.  Unfortunately, that does not currently exist
      for the sparc64 architecture.  The patch below includes a null
      implemenation of pci_update_resource for sparc64.
      
      Some have expressed interest in making general use of the the
      pci_restore_bars function, so that has been exported to GPL licensed
      modules.
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      064b53db
    • G
      [PATCH] PCI: clean up pci.h and split pci register info to separate header file. · 4352dfd5
      Greg Kroah-Hartman 提交于
      This cleans up some of the #ifdef CONFIG_PCI stuff up, and moves the pci register
      info out to a separate file, where it belongs.  Eventually we can stop including
      this file from within pci.h, but lots of code needs to be audited first.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4352dfd5
    • A
      [PATCH] PCI: remove CONFIG_PCI_NAMES · 982245f0
      Adrian Bunk 提交于
      This patch removes CONFIG_PCI_NAMES.
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      982245f0
    • A
      [PATCH] PCI: Move PCI fixup data into r/o section · 74d863ee
      akpm@osdl.org 提交于
      Make PCI fixup data const, so it'll end up in a r/o section.
      
      This also fixes the conversion into ECOFF which gets broken by too many
      changes between r/w and r/o sections.  Call it a hack but it's a change
      that's correct by itself.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      74d863ee
    • A
      [PATCH] PCI: Run PCI driver initialization on local node · d42c6997
      Andi Kleen 提交于
      Run PCI driver initialization on local node
      
      Instead of adding messy kmalloc_node()s everywhere run the
      PCI driver probe on the node local to the device.
      
      This would not have helped for IDE, but should for
      other more clean drivers that do more initialization in probe().
      It won't help for drivers that do most of the work
      on first open (like many network drivers)
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d42c6997
  2. 08 9月, 2005 33 次提交