[U-Boot] [PATCH 1/3] dm: pci: Assign correct driver data when binding a driver

Bin Meng bmeng.cn at gmail.com
Fri Jul 27 03:51:54 UTC 2018


Hi Simon,

On Fri, Jul 27, 2018 at 8:35 AM, Simon Glass <sjg at chromium.org> wrote:
> On 25 July 2018 at 03:39, Bin Meng <bmeng.cn at gmail.com> wrote:
>> The correct driver data comes from the matching 'id' instead of
>> 'find_id' in pci_find_and_bind_driver().
>>
>> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>> ---
>>
>>  drivers/pci/pci-uclass.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> Perhaps the pci test should be updated to check this.

I looked at this and found out that the test to
pci_bind_bus_devices(), the API that calls pci_find_and_bind_driver(),
cannot be done due to a chicken and egg issue.
pci_find_and_bind_driver() will only get called if no PCI device is
explicitly declared in the device tree, however:

- without a emulation device (eg: "sandbox,swap-case") in the device
tree, the emulation device won't be probed, hence pci_config_read() to
the emulation device returns nothing
- without a vendor id & device id from pci_config_read() results,
pci_find_and_bind_driver() won't work.

Do you have better ideas?

Regards,
Bin


More information about the U-Boot mailing list