About hot-plugging support in FreeBSD

John Baldwin jhb at freebsd.org
Mon Feb 1 14:49:53 UTC 2010


On Monday 01 February 2010 1:26:00 am Rajat Jain wrote:
> Hi,
> 
> I'm a newbie to the FreeBSD and have come from Linux background, hence
> please pardon me if this is not the right list for my questions, and
> please point me to the correct list: 
> 
> 1) Does FreeBSD support PCI-Express hot-plugging? I could not even find
> any instances in the source code that suggest that even PCI hot-plugging
> is supported. Is it supported? Can you please point me to appropriate
> references in the code?

No, not currently.
 
> 2) How and WHERE in the code is the "PCI Enumeration" and the "PCI
> resource allocation" done?:

Enumeration is done in 'pci_add_children()' in sys/dev/pci/pci.c.  Resource 
allocation is done in the same file in a few different places.

> 2a) Does FreeBSD does its own PCI resource allocation / PCI bus
> numbering, or does it simply use the one already done by the BIOS /
> bootloader?

It reuses the firmware allocations and can only handle simple cases to 
allocate resources for a BAR that the firmware did not initialize.

> 2b) In case it does its own PCI resource management, is the PCI
> Enumeration done only at the boot time, or devices can be detected and
> added later at run-time as well? [Please note that for adding at run
> time, we'll need certain PCI resource pre-reserved in anticipation of
> any new devices]

It shouldn't be too hard to support hot-plug.  Note that the cardbus(4) code 
already does a form of PCI hot-plug, so some of the infrastructure for PCI 
hot-plug is already in place.

-- 
John Baldwin


More information about the freebsd-ppc mailing list