when is pci_dev->resource values are filled?
ckim at etri.re.kr
Sun May 22 22:32:33 EDT 2022
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.
> -----Original Message-----
> From: Chan Kim <ckim at etri.re.kr>
> Sent: Friday, May 20, 2022 10:50 AM
> To: kernelnewbies at kernelnewbies.org
> 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.
> Chan Kim
More information about the Kernelnewbies