Hi Jianmin, On Fri, Jun 02, 2023 at 03:36:18PM +0800, Jianmin Lv wrote: > On 2023/6/2 下午3:21, Liu Peibao wrote: > > Hi all, > > > > It seems that modification for current PCI enumeration framework is > > needed to solve the problem. If the effect of this modification is not > > easy to evaluate, for the requirement of Loongson, it should be OK that > > do the things in Loongson PCI controller driver like discussed > > before[1]. > > > > Br, > > Peibao > > > > [1] https://lore.kernel.org/all/20221114074346.23008-1-liupeibao@xxxxxxxxxxx/ > > > > Agree. For current pci core code, all functions of the device will be > skipped if function 0 is not found, even without the patch 6fffbc7ae137 > (e.g. the func 0 is disabled in bios by setting pci header to 0xffffffff). > So it seems that there are two ways for the issue: > > 1. Adjust the pci scan core code to allow separate function to be > enumerated, which will affect widely the pci core code. > 2. Only Adjust loongson pci controller driver as Peibao said, and any > function of the device should use platform device in DT if function 0 is > disabled, which is acceptable for loongson. > > Thanks, > Jianmin How about 3. handle of_device_is_available() in the probe function of the "loongson, pci-gmac" driver? Would that not work?