Skip to contentSkip to conversation

when is pci_dev->resource values are filled?

DISCUSSION Chan Kim 1 participant 1 message May 23, 2022

lore
Share & tools
lore

Chan Kim

author
#0 lore raw

It looks like these values in pci_dev.resources are filled in pci_read_bases function which is called in pci_setup_device function.
So linux is reading the values set by the BIOS and setting them in its pci_dev struct. And the devices's driver is called after that.

Chan Kim

Quoted 17 lines

-----Original Message-----
From: Chan Kim <[email protected]>
Sent: Friday, May 20, 2022 10:50 AM
To: [email protected]
Subject: when is pci_dev->resource values are filled?

Hi, all

When initializing a PCI device, during the pci_driver's probe function, pci_request_region is called.
Inside the pci_request_region, it is just calling request_region with the values in pci_dev->resource[bar].start and end.
But when is this pci->dev->resource values filled? Is it done by the BIOS(or UEFI) before linux boots?
Probably not because this pci_dev struct is from linux and should be filled by linux code and I couldn't find where it's done.

Quoted 1 line

Chan Kim

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies