misc questions about the device&driver arch

M. Warner Losh imp at bsdimp.com
Sun May 7 02:59:27 UTC 2006

In message: <3a60de0b0605060046l134240det7a900d556a74527f at mail.gmail.com>
            "Wallace William" <avalonwallace at gmail.com> writes:
: I have seen this in the freebsd 5 road map,have the hotplug of pci already
: merged into the RELENG_5 branch?

Not as such, no.  CardBus cards can be hot plugged, but no other hot
plug bridge technology has been implemented.

: PCI resource allocation: PC2003 compliance requires that x86 systems no
: longer configure PCI devices from the system BIOS, leaving this task solely
: to the OS. FreeBSD must gain the ability to manage and allocate PCI memory
: resources on its own. Implementing this should take into account cardbus,
: PCI-HotPlug, and laptop dock station requirements. This feature will become
: increasingly critical through the lifetime of RELENG_5, and therefore is a
: requirement for the RELENG_5 branch.

FreeBSD already has the ability to assign resources for those BARs not
assigned by the BIOS.  RELENG_5 has this ability as well as RELENG_6
and current.  In RELENG_5, and to a lessor extent RELENG_6, the
resource allocation code is a little weak in picking the resource to
assign sometimes, but manual knobs exist to cope.

What FreeBSD doesn't do is dynamically reassign resources between
bridges and busses while the system is up.  In practice, this has
proven to not be a problem.  We also do not try to 'estimate' the
downstream resource requirements for devices connected to a bridge and
force open the windows on the bridges.  On of the big problem areas
here is that there's no standardized host bridge interface, so finding
what the top of the tree decodes can be hard.  Heuristics that work
well on 1 PCI bus (tree) systems fail badly at multiple pci bus

: On Thursday 10 November 2005 05:48 am, kylin wrote:
: > Sir ,i am still puzzled by the windows and freebsd arch similar.
: > 1
: > the window TPS say that windwo allocate the resource window in default
: > size of 1M or 2M,so there may be hole ,does that happen in freebsd 5
: > or 6?
: No.

We automatically allocate the entire resource for all the BARs that
probe as 'alive' in the configuration phase.  We don't have the fixed
allocation size for bridges, however.

: > 2
: > in my view i believe that freebsd us the "just enough "tactics,so
: > the nexus level of resource view is ===continuous====with NO hole in
: > a boot up system, IF hot remove do not happen .am i right?
: Sorta. We actually will use whatever the BIOS uses by default. We only try
: to alloc resources if the BIOS doesn't, and I'm not sure how we handle a
: bridge running out of resources. I think we might just fail the allocation.

We do fail the allocation, since we never grow the resources that a
bridge can decode.  I've not had reports of this happening in the
field yet, but there's always a first.


More information about the freebsd-hackers mailing list