Call ath_tx_tid_unsched() after the node has been flushed, so the
state can be printed correctly.


git-svn-id: svn://svn.freebsd.org/base/head@240914 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Reduce delays in several wait loops from 10ms to 10us, same is it is done
in Linux. This substantially increases graphics performance on Ivy Bridge.

Submitted by:	avg@
Reviewed by:	kib@


git-svn-id: svn://svn.freebsd.org/base/head@240917 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix panic introduced by me in r240835, when zero weight
was passed to wtab_alloc().

Reported by:	Kim Culhan <w8hdkim gmail.com>


git-svn-id: svn://svn.freebsd.org/base/head@240918 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add optional entropy harvesting for software interrupts in swi_sched()
as controlled by kern.random.sys.harvest.swi.  SWI harvesting feeds into
the interrupt FIFO and each event is estimated as providing a single bit of
entropy.

Reviewed by:	markm, obrien
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240921 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Some aac(4) adapters will always report that a direct access device is
offline in response to a INQUIRY command that does not retreive vital
product data(I personally have observed the behaviour on an Adaptec 2405
and a 5805).  Force the peripheral qualifier to "connected" so that upper
layers correctly recognize that a disk is present.

This bug was uncovered by r216236.  Prior to that fix, aac(4) was
accidentally clearing the peripheral qualifier for all inquiry commands.

This fixes an issue where passthrough devices were not created for
disks behind aac(4) controllers suffering from the bug.  I have
verified that if a disk is not present that we still properly detect
that and not create the passthrough device.

Sponsored by:	Sandvine Incorporated
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@240923 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Change the module name for the I/O provider to "kernel" from
"genunix"  This will requires us to modify externally created
DTrace scripts but makes logical sense for FreeBSD.

Requested by: rpaulo
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240924 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Oops - don't do the clrdmask check in ath_tx_xmit_normal() - the wrong
lock may be held.

Kim reported that the TID lock wasn't held when ath_tx_update_clrdmask()
was called. Well, the underlying hardware TXQ for that TID.

I'm betting it's the cabq stuff. ath_tx_xmit_normal() can be called
for both real and software cabq.  For software cabq, the real destination
txq is different to the txq. So, the lock check will fail.

Reported by:	Kim Culhan <w8hdkim@gmail.com>


git-svn-id: svn://svn.freebsd.org/base/head@240926 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
O_EXEC flag is not part of the O_ACCMODE mask, check it separately.
If O_EXEC is provided don't require CAP_READ/CAP_WRITE, as O_EXEC
is mutually exclusive to O_RDONLY/O_WRONLY/O_RDWR.

Without this change CAP_FEXECVE capability right is not enforced.

Sponsored by:	FreeBSD Foundation
MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@240927 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Require CAP_CREATE on directory descriptor for linkat(2).

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240928 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Require CAP_CREATE on directory descriptor for symlinkat(2).

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240929 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Require CAP_DELETE on directory descriptor for unlinkat(2).

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240930 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
We cannot open file for reading and executing (O_RDONLY | O_EXEC).
Well, in theory we can pass those two flags, because O_RDONLY is 0,
but we won't be able to read from a descriptor opened with O_EXEC.

Update the comment.

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240931 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove an incorrect comment


git-svn-id: svn://svn.freebsd.org/base/head@240932 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
vn_write() always expects FOF_OFFSET flag, which is asserted at the begining,
so there is no need to check for it.

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240936 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Avoid INVARIANTS panic destroying an in-use tap(4)

The requirement (implied by the KASSERT in tap_destroy) that the tap is
closed isn't valid; destroy_dev will block in devdrn while other threads
are in d_* functions.

Note: if_tun had the same issue, addressed in SVN revisions r186391,
r186483 and r186497.  The use of the condvar there appears to be
redundant with the functionality provided by destroy_dev.

Sponsored by:	ADARA Networks
Reviewed by:	dwhite
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240938 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add more SPI flash IDs.

Submitted by:	Luiz Otavio O Souza.
Submitted by:	ZRouter.org project.
Approved by:	adrian (menthor)


git-svn-id: svn://svn.freebsd.org/base/head@240939 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix freebsd32_kmq_timedreceive() and freebsd32_kmq_timedsend() to use
getmq_read() and getmq_write() respectively, just like sys_kmq_timedreceive()
and sys_kmq_timedsend().

Sponsored by:	FreeBSD Foundation
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@240940 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert part of an earlier patch attempt that snuck in with r240938.


git-svn-id: svn://svn.freebsd.org/base/head@240942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add regression test for kern/172075.

Sponsored by:	ADARA Networks
PR:		kern/172075


git-svn-id: svn://svn.freebsd.org/base/head@240944 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct misspelling in debug output.


git-svn-id: svn://svn.freebsd.org/base/head@240945 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f