Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Feb 2010 09:35:38 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-ia32@freebsd.org
Cc:        freebsd-ppc@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: About hot-plugging support in FreeBSD
Message-ID:  <201002010935.38861.jhb@freebsd.org>
In-Reply-To: <8506939B503B404A84BBB12293FC45F60681AA1B@emailbng3.jnpr.net>
References:  <8506939B503B404A84BBB12293FC45F60681AA1B@emailbng3.jnpr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002010935.38861.jhb>