Page MenuHomeFreeBSD

pci_pci: Support growing bus ranges in bus_adjust_resource for NEW_PCIB
ClosedPublic

Authored by jrtc27 on Sep 17 2021, 10:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:20 PM
Unknown Object (File)
Wed, Apr 3, 2:47 PM
Unknown Object (File)
Dec 20 2023, 12:12 AM
Unknown Object (File)
Dec 18 2023, 10:04 PM
Unknown Object (File)
Dec 12 2023, 2:34 AM
Unknown Object (File)
Nov 29 2023, 3:56 PM
Unknown Object (File)
Nov 11 2023, 9:05 PM
Unknown Object (File)
Nov 10 2023, 6:26 PM
Subscribers

Details

Summary

This is the same underlying problem as 262459806433, just for bus ranges
rather than windows. SiFive's HiFive Unmatched has the following
topology:

Root Port <---> Bridge <---> Bridge <-+-> Bridge <---> (Unused)
 (pcib0)        (pcib1)      (pcib2)  |   (pcib3)
                                      +-> Bridge <---> xHCI
                                      |   (pcib4)
                                      +-> Bridge <---> M.2 E-key
                                      |   (pcib5)
                                      +-> Bridge <---> M.2 M-key
                                      |   (pcib6)
                                      +-> Bridge <---> x16 slot
                                          (pcib7)

If a device is plugged into the x16 slot that itself has a bridge, such
as many graphics cards, we currently fail to allocate a bus number for
its child bus (and so pcib_attach_child skips adding a child bus for
further enumeration) as, when the new child bridge attaches, it attempts
to allocate a bus number from its parent (pcib7) which in turn attempts
to grow its own bus range by calling bus_adjust_resource on its own
parent (pcib2) whose bus rman cannot accommodate the request and needs
to itself be extended by calling its own parent (pcib1). Note that
pcib3-7 do not face the same issue when they attach since pcib1 ends up
managing bus numbers 1-255 from the beginning and so never needs to grow
its own range.

MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable