]> git.hungrycats.org Git - linux/commit
[PATCH] Only add devices to bus->devices while scanning...
authorRussell King <rmk@arm.linux.org.uk>
Thu, 6 Mar 2003 09:49:22 +0000 (01:49 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 6 Mar 2003 09:49:22 +0000 (01:49 -0800)
commit64964f5b6ccb1ff7df457a0082f17cf08b7393ec
treecfb7f3a7f8d18d69f4e8a54313aad6e56244ccd3
parent7c3db3a879b4287393fd2b526b0b14b6883ae65c
[PATCH] Only add devices to bus->devices while scanning...

  The pci_find* functions search using the following lists:
        bus->children   (for subordinate buses)
        pci_root_buses  (for all root buses)
        pci_devices     (for devices)

  This leaves one list which we can add devices to without any drivers
  finding the new devices before we've finished with them.

- initialise bus->node list head.

- pci_scan_slot will scan the specified slot, and add the discovered
  devices to the bus->devices list only.  These devices will not
  appear on the global device list, and do not show in sysfs, procfs.
  pci_scan_slot returns the number of functions found.  If you want
  to find the devices, you have to scan bus->devices and look for
  devices where list_empty(&dev->global_list) is true.

- new function "pci_bus_add_devices" adds newly discovered devices
  to the global device lists, and handles the sysfs and procfs
  stuff, making the devices available to drivers.  All our buses
  which have an empty list head are treated as "new" (since they
  are not attached to the parent buses list of children) and are
  also added.  Currently, no buses will be in this state when this
  function is called.

- new function "pci_scan_child_bus" scans a complete bus, building
  a list of devices on bus->devices only, performing bus fixups
  via pcibios_fixup_bus() and scanning behind bridges.  It does
  make devices externally visible.

- pci_do_scan_bus retains its original behaviour - ie, it scans
  and makes devices available immediately.
drivers/pci/bus.c
drivers/pci/probe.c
include/linux/pci.h