PCI: Log bridge info when first enumerating bridge
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 22 Nov 2023 16:34:07 +0000 (10:34 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 15 Dec 2023 23:28:43 +0000 (17:28 -0600)
commit95140c2fbfdf3b6ca98578e5bdbc82d9922f08b9
tree994750851b8eb10c0d061e78cfc5bb50523823eb
parent63c6ebb294b7c708cc987d621e59499686650683
PCI: Log bridge info when first enumerating bridge

Log bridge secondary/subordinate bus and window information at the same
time we log the bridge BARs, just after discovering the bridge and before
scanning the bridge's secondary bus.  This logs the bridge and downstream
devices in a more logical order:

  - pci 0000:00:01.0: [8086:1901] type 01 class 0x060400
  - pci 0000:01:00.0: [10de:13b6] type 00 class 0x030200
  - pci 0000:01:00.0: reg 0x10: [mem 0xec000000-0xecffffff]
  - pci 0000:00:01.0: PCI bridge to [bus 01]
  - pci 0000:00:01.0:   bridge window [io  0xe000-0xefff]

  + pci 0000:00:01.0: [8086:1901] type 01 class 0x060400
  + pci 0000:00:01.0: PCI bridge to [bus 01]
  + pci 0000:00:01.0:   bridge window [io  0xe000-0xefff]
  + pci 0000:01:00.0: [10de:13b6] type 00 class 0x030200
  + pci 0000:01:00.0: reg 0x10: [mem 0xec000000-0xecffffff]

Note that we read the windows into a temporary struct resource that is
thrown away, not into the resources in the struct pci_bus.

The windows may be adjusted after we know what downstream devices require,
and those adjustments are logged as they are made.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c