Li-Ta Lo ollie@lanl.gov writes:
Eric,
I am reading the device tree/resource allocation code and trying to add more doxygen stuff. One thing I am not queit sure is the pci_scan_get_dev() in pci_scan_bus().
for (devfn = min_devfn; devfn <= max_devfn; devfn++) { uint32_t id, class; uint8_t hdr_type;
/* First thing setup the device structure */ dev = pci_scan_get_dev(&old_devices, devfn);
My understanding is some pci devices are static devices too and are already "enumerated" befor the pci_scan_bus() (actually, the dev_enumerate()) is called and they are on the device tree (or list) by the time pci_scan_bus() is called. The pci_scan_get_dev() try to find the device under enumeration on that list. Am I correct ?
Yes.
Eric
On Tue, 2004-03-02 at 16:34, Eric W. Biederman wrote:
Li-Ta Lo ollie@lanl.gov writes:
Eric,
I am reading the device tree/resource allocation code and trying to add more doxygen stuff. One thing I am not queit sure is the pci_scan_get_dev() in pci_scan_bus().
for (devfn = min_devfn; devfn <= max_devfn; devfn++) { uint32_t id, class; uint8_t hdr_type;
/* First thing setup the device structure */ dev = pci_scan_get_dev(&old_devices, devfn);
My understanding is some pci devices are static devices too and are already "enumerated" befor the pci_scan_bus() (actually, the dev_enumerate()) is called and they are on the device tree (or list) by the time pci_scan_bus() is called. The pci_scan_get_dev() try to find the device under enumeration on that list. Am I correct ?
Yes.
What happen if a device is listed as a static device in the config file but does not actually exist in the physical system ?
Ollie
Li-Ta Lo ollie@lanl.gov writes:
What happen if a device is listed as a static device in the config file but does not actually exist in the physical system ?
The device won't go away. But it can legitimately show up as a disabled device in the device tree.
I'm not certain when you would want to report a device statically that may or may not be there.
Regardless showing up as disabled is effectively gone so it should not be a real limitation.
Eric
On Fri, 2004-03-05 at 16:52, Eric W. Biederman wrote:
Li-Ta Lo ollie@lanl.gov writes:
What happen if a device is listed as a static device in the config file but does not actually exist in the physical system ?
The device won't go away. But it can legitimately show up as a disabled device in the device tree.
I'm not certain when you would want to report a device statically that may or may not be there.
That happens for the processor. We list two cpus in current k8 mainboard config files. But if there is only one cpu install, we will have a lot of "absent" devices.
Ollie
Regardless showing up as disabled is effectively gone so it should not be a real limitation.
Eric
Li-Ta Lo ollie@lanl.gov writes:
On Fri, 2004-03-05 at 16:52, Eric W. Biederman wrote:
Li-Ta Lo ollie@lanl.gov writes:
What happen if a device is listed as a static device in the config file but does not actually exist in the physical system ?
The device won't go away. But it can legitimately show up as a disabled device in the device tree.
I'm not certain when you would want to report a device statically that may or may not be there.
That happens for the processor. We list two cpus in current k8 mainboard config files. But if there is only one cpu install, we will have a lot of "absent" devices.
Well we will have an absent bus. But everything should work properly. It would not hurt to test it and make certain though. It works in principle, and should be easy to fix if the practice does not match.
Eric
On Mon, 2004-03-08 at 21:45, Eric W. Biederman wrote:
Li-Ta Lo ollie@lanl.gov writes:
On Fri, 2004-03-05 at 16:52, Eric W. Biederman wrote:
Li-Ta Lo ollie@lanl.gov writes:
What happen if a device is listed as a static device in the config file but does not actually exist in the physical system ?
The device won't go away. But it can legitimately show up as a disabled device in the device tree.
I'm not certain when you would want to report a device statically that may or may not be there.
That happens for the processor. We list two cpus in current k8 mainboard config files. But if there is only one cpu install, we will have a lot of "absent" devices.
Well we will have an absent bus. But everything should work properly. It would not hurt to test it and make certain though. It works in principle, and should be easy to fix if the practice does not match.
On thing I am worry about is there are some code calling the "device driver" no matter if the device really exist. One example is the pci_scan_bus() which calls the enable_dev() when it found the device on the list of "static->dynamic" devices. What if the enable_dev() does something nasty and lock the machine ?
Ollie