freebsd-dev/sys/compat
Sepherosa Ziehau 6faefea03b linuxkpi: Fix PCI BAR lazy allocation support.
FreeBSD supports lazy allocation of PCI BAR, that is, when a device
driver's attach method is invoked, even if the device's PCI BAR
address wasn't initialized, the invocation of bus_alloc_resource_any()
(the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() ->
pci_reserve_map() -> pci_write_bar()) would allocate a proper address
for the PCI BAR and write this 'lazy allocated' address into the PCI
BAR.

This model works fine for native FreeBSD device drivers, but _not_ for
device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c
and ofed/drivers/net/mlx4/main.c.  Both of them use
pci_request_regions(), which doesn't work properly with the PCI BAR
lazy allocation, because pci_resource_type() -> _pci_get_rle() always
returns NULL, so pci_request_regions() doesn't have the opportunity to
invoke bus_alloc_resource_any().  We now use pci_find_bar() in
pci_resource_type(), which is able to locate all available PCI BARs
even if some of them will be lazy allocated.

Submitted by:	Dexuan Cui <decui microsoft com>
Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D8071
2016-09-30 05:51:11 +00:00
..
cloudabi cloudabi: use fget_cap instead of hand-rolling capability read 2016-09-23 23:08:23 +00:00
cloudabi32 Regenerate syscall provider argument strings. 2016-09-22 04:50:03 +00:00
cloudabi64 Regenerate syscall provider argument strings. 2016-09-22 04:50:03 +00:00
freebsd32 Regenerate syscall provider argument strings. 2016-09-22 04:50:03 +00:00
ia32 Add missing header dependency. 2016-08-24 09:57:19 +00:00
linprocfs linprocfs: garbage collect meminfo fields not present in linux 2016-09-16 03:36:43 +00:00
linsysfs Add support to the jail framework to be able to mount linsysfs(5) and 2015-07-19 08:52:35 +00:00
linux capsicum: propagate rights on accept(2) 2016-09-22 09:58:46 +00:00
linuxkpi/common linuxkpi: Fix PCI BAR lazy allocation support. 2016-09-30 05:51:11 +00:00
ndis ndis(4): Undo unneeded workarounds in ndis' rand(). 2016-05-22 14:13:20 +00:00
netbsd
svr4 Don't create pointless backups of generated files in "make sysent". 2016-07-28 21:29:04 +00:00
x86bios x86bios: spelling fix in a comment. 2016-04-30 00:34:04 +00:00