opnsense-src/sys
Kenneth D. Merry 07aa4de131 Fix a problem with async notifications in the mpr(4) driver.
This problem only occurs on versions of FreeBSD prior to the recent CAM
locking changes.  (i.e. stable/9 and older versions of stable/10)  This
change should be a no-op for head and stable/10.

If a path isn't specified, xpt_register_async() will create a fully
wildcarded path and acquire a lock (the XPT lock in older versions,
and via xpt_path_lock() in newer versions) to call xpt_action() for the
XPT_SASYNC_CB CCB.  It will then drop the lock and if the requested event
includes AC_FOUND_DEVICE or AC_PATH_REGISTERED, it will get the caller up
to date with any device arrivals or path registrations.

The issue is that before the locking changes, each SIM lock would get
acquired in turn during the EDT tree traversal process.  If a path is
specified for xpt_register_async(), it won't acquire and drop its own lock,
but instead expects the caller to hold its own SIM lock.  That works for
the first part of xpt_register_async(), but causes a recursive lock
acquisition once the EDT traversal happens and it comes to the SIM in
question.  And it isn't possible to call xpt_action() without holding a SIM
lock.

The locking changes fix this by using the XPT topology lock for EDT
traversal, so it is no longer an issue to hold the SIM lock while calling
xpt_register_async().

The solution for FreeBSD versions before the locking changes is to request
notification of all device arrivals (so we pass a NULL path into
xpt_register_async()) and then filter out the arrivals that are not ours.

MFC After:	3 days
Sponsored by:	Spectra Logic Corporation
2014-05-06 06:18:43 +00:00
..
amd64 Virtual machine halt detection is turned on by default. Allow it to be 2014-05-05 16:19:24 +00:00
arm Fix the tinderbox armv6/arm build failure. 2014-05-03 03:40:36 +00:00
boot Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
bsm IFp4 @1192291: 2014-04-07 20:44:00 +00:00
cam Provide better descriptions for 'struct ctl_scsiio' fields; based mostly 2014-05-04 15:35:04 +00:00
cddl Use a zio flag to prevent recursion of vdev_queue_io_done which can 2014-05-04 14:05:14 +00:00
compat In freebsd32_sendmsg(), replace the call to sockargs() followed by a 2014-04-05 18:56:01 +00:00
conf Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
contrib Add Atheros AR1111 support to the HAL. 2014-05-05 07:58:05 +00:00
crypto NO_MAN= has been deprecated in favor of MAN= for some time, go ahead 2014-04-13 05:21:56 +00:00
ddb ddb: Minor style cleanups. 2014-03-31 16:37:41 +00:00
dev Fix a problem with async notifications in the mpr(4) driver. 2014-05-06 06:18:43 +00:00
fs After r254627, the deupdate() started writing the directory entries to 2014-05-03 16:11:55 +00:00
gdb
geom Make r242379 - the fix for UFS labels disappearing after resizing 2014-05-05 09:20:30 +00:00
gnu Symbolic bindings for the dts files... 2014-02-28 16:51:33 +00:00
i386 Disable ACPI and P4TCC throttling by default, following discussion on 2014-05-04 16:38:21 +00:00
ia64 Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. 2014-05-02 20:25:09 +00:00
isa Remove vestiges of knowing the ISA bus, which we gave up on around 20 2014-03-19 21:03:04 +00:00
kern Avoid unsigned integer overflow which can cause 2014-05-05 15:59:31 +00:00
kgssapi
libkern Fix typo 2013-11-29 20:14:26 +00:00
mips Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. 2014-05-02 20:25:09 +00:00
modules Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
net Fix sysctl_ifmalist() broken in r265019. 2014-05-03 17:57:06 +00:00
net80211 Use logical rather than bitwise OR in if() expression. 2014-04-26 23:22:49 +00:00
netgraph Remove AppleTalk support. 2014-03-14 06:29:43 +00:00
netinet - Remove net.inet.tcp.reass.overflows sysctl. It counts exactly 2014-05-06 00:00:07 +00:00
netinet6 Pass radix head ptr along with rte to rtexpunge(). 2014-05-03 16:28:54 +00:00
netipsec Remove _IP_VHL* macros and related ifdefs. 2014-04-16 05:31:54 +00:00
netnatm Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
netpfil Define startup order the same way as it is in dummynet. 2014-04-26 08:05:16 +00:00
netsmb Remove redundant unlock. 2014-04-17 12:22:08 +00:00
nfs - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
nfsclient For software builds, the NFS client does many small 2013-12-07 23:05:59 +00:00
nfsserver The PR reported that the old NFS server did not set uio_td == NULL 2014-04-24 20:47:58 +00:00
nlm Correct a typo in nlm_find_host_by_addr(): the intention of the 2014-03-11 00:25:55 +00:00
ofed Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
opencrypto allow the kern.cryptodevallowsoft sysctl to enable symetric/hashes too... 2014-03-11 01:45:46 +00:00
pc98 lindev(4): finish the partial commit in r265212 2014-05-02 07:14:22 +00:00
pci Increase the number of TX DMA segments from 32 to 35. It turned 2014-03-31 01:54:59 +00:00
powerpc Retire smp_active. It was racey and caused demonstrated problems with 2014-04-26 20:27:54 +00:00
rpc Properly free resources in case of error. 2014-05-02 20:45:55 +00:00
security audit: plug FILEDESC_LOCK leak in audit_canon_path. 2014-03-21 01:30:33 +00:00
sparc64 Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. 2014-05-02 20:25:09 +00:00
sys Garbage collect two more unused sysinit subsystems: SI_SUB_KVM_RSRC and 2014-05-05 21:46:10 +00:00
teken Fix typo. 2014-02-06 13:28:06 +00:00
tools Fix logic error. <blush> 2014-04-30 20:52:38 +00:00
ufs Update comment to explain search order reverted to historical order 2014-03-22 11:26:39 +00:00
vm Prior to r254304, a separate function, vm_pageout_page_stats(), was used to 2014-05-06 03:42:04 +00:00
x86 Make this compile with gcc. 2014-04-05 22:43:18 +00:00
xdr
xen Make this compile with gcc. 2014-04-05 22:43:18 +00:00
Makefile Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00