Skip to content
  • Koen Vandeputte's avatar
    PCI: dwc: Fix enumeration end when reaching root subordinate · fc110ebd
    Koen Vandeputte authored
    The subordinate value indicates the highest bus number which can be
    reached downstream though a certain device.
    
    Commit a20c7f36 ("PCI: Do not allocate more buses than available in
    parent") ensures that downstream devices cannot assign busnumbers higher
    than the upstream device subordinate number, which was indeed illogical.
    
    By default, dw_pcie_setup_rc() inits the Root Complex subordinate to a
    value of 0x01.
    
    Due to this combined with above commit, enumeration stops digging deeper
    downstream as soon as bus num 0x01 has been assigned, which is always the
    case for a bridge device.
    
    This results in all devices behind a bridge bus remaining undetected, as
    these would be connected to bus 0x02 or higher.
    
    Fix this by initializing the RC to a subordinate value of 0xff, which is
    not altering hardware behaviour in any way, but informs probing function
    pci_scan_bridge() later on which reads this value back from register.
    
    The following nasty errors ...
    fc110ebd