Commit Graph

218005 Commits

Author SHA1 Message Date
Konstantin Belousov
435da98564 Restructure the code to handle reporting of non-exited processes from
wait(2).
- Do not acquire the process spinlock if neither WTRAPPED nor WUNTRACED
  options were passed [1].
- Extract the code to report alive process into a new helper
  report_alive_proc() and use it for trapped, stopped and continued
  childrens.

Note that the process spinlock is required around the WTRAPPED and
WUNTRACED tests, because P_STOPPED_TRACE and P_STOPPED_SIG flags are
set before other threads are stopped at the suspension point, and that
threads increment p_suspcount while owning only the process spinlock,
the process lock is dropped by them.  If the spinlock is not taken for
tests, the syscall thread might miss both p_suspcount increment and
wakeup in wakeup in thread_suspend_switch().

Based on the submission by:	mjg [1]
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-12-04 20:44:58 +00:00
Michal Meloun
6f1eb3052e Fixes for NVIDIA Tegra124 clocks:
- EMC clock have standard peripheral clock block. Use it.
 - Implement full frequency set method for PLLD2. This PLL
   is used as HDMI pixel clock so we must be able to set it
   to wide range of frequencies, within 5% tolerance allowed
   by HDMI specification. Due to this, full state space search
   (over m, n, p fields) is necessary.

MFC after: 3 weeks
2016-12-04 16:04:22 +00:00
Michal Meloun
3b29466b94 Clock framework fixes:
- The clk_test_freq() (aka CLK_SET_DRYRUN) doesn't change frequency,
   don't cache it result.
 - Fix busy condition for clk_set_freq().

MFC after: 3 weeks
2016-12-04 16:02:59 +00:00
Andriy Voskoboinyk
7d3a36a88e Do not try to recreate wlan(4) interface if it already exists.
This should fix error messages caused by devd(8) during startup:

Starting Network: lo0 wlan0.
...
Starting devd.
ifconfig: SIOCS80211: Device busy
wpa_supplicant already running?  (pid=323).

MFC after:	2 weeks
2016-12-04 15:58:34 +00:00
Michal Meloun
bea8daa364 Add IDs for HDA codecs found on Nvidia Tegra SoCs.
MFC after: 2 weeks
2016-12-04 15:28:30 +00:00
Michal Meloun
bdbc1b764d Implement fake pmap_mapdev_attr() for ARMv6.
This function is referenced, but never called from DRM2 code. Also,
real behavior of pmap_mapdev_attr() in ARM world is unclear as we don't
have any additional attribute for a device memory type.

MFC after: 2 weeks
2016-12-04 15:27:39 +00:00
Pyun YongHyeon
6861837c7a Fix too low volume on MSI H170 GAMING M3 board by poking vendor
specific COEF.
2016-12-04 05:55:18 +00:00
Pyun YongHyeon
b899778526 Recognize RealTek ALC1150 7.1 channel HD audio codec. 2016-12-04 05:46:30 +00:00
Conrad Meyer
e2a65c0031 ioat(4): Compile on i386
Truncate BUS_SPACE_MAXADDR_40BIT to essentially BUS_SPACE_MAXADDR_32BIT on
platforms with 32-bit bus_addr_t (i.e., i386).

PR:		215034
Reported by:	ngie@
Sponsored by:	Dell EMC Isilon
2016-12-04 04:04:57 +00:00
Conrad Meyer
695349e306 coredump_phnum_test: Make expected pheader count more flexible
Note: this test still requires binutils readelf (from ports) to pass, until a
few issues are resolved in elftoolchain.

PR:		215019
Reported by:	ngie@
Sponsored by:	Dell EMC Isilon
2016-12-04 03:50:57 +00:00
Pedro F. Giffuni
bde60d7544 indent(1): remove unneeded comma.
It is not a good practice to start a newline with a comma anyways.

Discussed with:	 bjk
Differential Revision:	https://reviews.freebsd.org/D8690
2016-12-04 03:10:25 +00:00
Martin Matuska
43d91c021f Relax sanity check of number fields in tar header even more.
This fixes reading tar archives created by older versions of
plexus-archiver (used by maven-assembly-plugin) that fill uid and gid
fields with spaces (PLXCOMP-233).

Vendor issue:
https://github.com/libarchive/libarchive/issues/832

Reported by:	Antoine Brodin <antoine@freebsd.org>
MFC after:	1 week
2016-12-04 02:58:13 +00:00
Justin Hibbits
aa38c69b74 Fix a typo (move parenthesis to correct location in the line).
Before this, it would cause the one consumer of this API in powerpc usage
(dev/dpaa) to set the PTE WIMG flags to empty instead of --M-, making the
cache-enabled buffer portals non-coherent.
2016-12-04 02:15:46 +00:00
Enji Cooper
006aa95c01 Unbreak "make depend" with sys/modules/ioat by adding opt_ddb.h to SRCS
MFC after: 2 weeks
2016-12-04 02:08:40 +00:00
Adrian Chadd
a1fa23910c [camcontrol] init ts=0 to quieten gcc.
It "looks" like ts is set to something on success, and not modified on
error.

Checked on IRC with: cem
2016-12-03 20:35:39 +00:00
Devin Teske
4f38967037 Fix bug preventing limits(1) from being applied
PR:		misc/212493
Differential Revision:	https://reviews.freebsd.org/D8232
Submitted by:	girgen
Reviewed by:	adrian
MFC after:	3 days
X-MFC-to:	stable/11
2016-12-03 19:03:40 +00:00
Ravi Pokala
4d12189b6c Build smbios.ko as a module for amd64 and i386
For whatever reason, smapi, smbios, vpd are all under the "bios" directory.
smapi is only for i386, so the entire "bios" directory is only built for
i386. Break smapi out, and make only it i386-specific. Then, build the
"bios" directory for both amd64 and i386.

Reviewed by:	imp
MFC after:	1 week
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D8609
2016-12-03 17:54:08 +00:00
Pedro F. Giffuni
69718b786d Revert r253678, r253661:
Fix a segfault in ctfmerge(1) due to a bug in GCC.

The change was correct and the bug real, but upstream didn't adopt it
and we want to remain in sync. When/if upstream does something about it
we can bring their version.

The bug in question was fixed in GCC 4.9 which is now the default in
FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2
platforms also has a workaround so no end-user should be harmed by the
revert.
2016-12-03 17:44:43 +00:00
Andriy Voskoboinyk
4786190d2f rtwn: fix bitmap size calculation.
Tested with RTL8188CE, STA mode.
2016-12-03 17:27:10 +00:00
Andriy Voskoboinyk
6127805391 rsu: fix frame processing in the Rx path (similar to r292207).
- Fill in Rx radiotap header correctly (for every packet in a chain;
not once per chain).
- Fix rate / flags fields in Rx radiotap.
- Add debug messages for discarded frames.
- Pass received control (< sizeof(struct ieee80211_frame)) frames
to net80211 (if allowed by device filter; cannot happen yet).

Tested with Asus USB-N10.

Differential Revision:	https://reviews.freebsd.org/D5723
2016-12-03 16:02:53 +00:00
Kevin Lo
3094a376e4 Fix logic error so the R92C_TDECTRL register value is updated correctly.
Reviewed by:	avos
2016-12-03 14:41:53 +00:00
Andriy Voskoboinyk
bcb071810a rsu: remove unused structures / variables. 2016-12-03 14:26:58 +00:00
Bryan Drewery
eba4cc152e DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie.
This is reworking the change in r296585 but to still properly install
the files.  This limits the change to only the DIRDEPS_BUILD logic
for what it considers the name of the staging set, which is what the
cookie name is based off of.

Sponsored by:	Dell EMC Isilon
MFC after:	1 week
2016-12-03 05:29:35 +00:00
Bryan Drewery
d7d0effe49 Revert r296585.
This broke installing dtrace test files.  It was poorly tested.

Reported by:	markj
Pointyhat to:	bdrewery
MFC after:	1 week
2016-12-03 05:29:31 +00:00
Bryan Drewery
34ecf41885 Create the /usr/lib/include symlink as relative.
This ugly code is done to avoid assuming LIBDIR is 2 components
deep.

Reported by:	jhb
2016-12-03 05:29:12 +00:00
Enji Cooper
72a02000d9 Don't build :strvis_locale if VIS_NOLOCALE is undefined
The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features
in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower
in conditionally running the test instead of backporting the newer version of
libc-vis

MFC after:	now
2016-12-03 03:56:20 +00:00
Enji Cooper
612a96b4a8 Restore pathing for factor(1), which unnecessarily diverged in r278616
factor lives in /usr/games/, not /usr/bin, in NetBSD.

The correct way to handle this is do on-the-fly manipulation of the test
script via ATF_TESTS_SH_SED_<foo>, not by modify the pathing directly in
the test script.

This is being done to resolve an unnecessary conflict made when pulling
back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10.

No functional change

MFC after:	now
2016-12-03 03:13:32 +00:00
Adrian Chadd
707210ff0e [ath] use the correct AMPDU frame limit for the given node, rather than the global config.
This is important in hostap, ibss, (11s at some magical future date, etc)
where different nodes may have smaller limits.

Oops!

MFC after:	1 week
Relnotes:	Yes
2016-12-03 02:47:41 +00:00
Adrian Chadd
4774b99992 [net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre frequencies.
* ic_freq is the centre of the primary channel, not the centre of the
  HT40/HT80/etc channel.  Add a method to access that.
* Add a method to access the centre of the primary channel, including
  knowing the centre of the 5/10/20/40/80, versus the primary channel.
  Ie, it's the centre of the 40, 80, 160MHz channel.
* Add a method to access the centre frequency of the secondary 80MHz
  channel - we don't support VHT yet, but when we do.
* Add methods to access the current channel and the per-dev desired
  channel.  Ideally drivers that do full offload with a per-vap channel
  configuration should use the vap channel, NOT ic_curchan.
  Non-offload drivers that require net80211 to change the channel should
  be accessing ic_curchan.
2016-12-03 02:45:18 +00:00
Enji Cooper
3d77b88dff Expect 01:main to fail
Changes were made to ZFS in the past year with respect to how ACLs
are handled, causing failures in this test. Mark it TODO so (hopefully)
someone more knowledgeable (like mav or trasz) will fix the code or the
test.

PR:	212323
2016-12-03 02:24:15 +00:00
Enji Cooper
c68f00edd6 Expect :coredump_phnum to fail
The number of program headers on my system (GENERIC-NODEBUG) don't match the
expected (hardcoded) number in the test

PR:	215019
2016-12-03 02:17:50 +00:00
Enji Cooper
cebf0ec58a Fix test coredump_phnum_test:coredump_phnum require.config specification
The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"',
not `atf_set "require.config" "allow_sysctl_side_effects"'

X-MFC with: r308177
Pointyhat to: cmeyer
2016-12-03 02:09:23 +00:00
Luiz Otavio O Souza
3c27ea76f0 Allow simultaneous access to switch device, there is no reason to prevent
it.

Remove bogus wrappers and use the kernel defaults.

While here, use DEVMETHOD_END.

Obtained from:	pfSense
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-12-03 01:55:38 +00:00
Eric van Gyzen
ff07dd913e thr_set_name(): silently truncate the given name as needed
Instead of failing with ENAMETOOLONG, which is swallowed by
pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1
bytes.  This is more likely what the user wants, and saves the
caller from truncating it before the call (which was the only
recourse).

Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2)
so the user might find the documentation for this behavior.

Reviewed by:	jilles
MFC after:	3 days
Sponsored by:	Dell EMC
2016-12-03 01:14:21 +00:00
Pedro F. Giffuni
86bd08e9ee Document undocumented indent(1) options badp/nbadp, bs/nbs, and lc.
Submitted by:	 Piotr Stefaniak
Differential Revision:	https://reviews.freebsd.org/D8690
2016-12-03 00:24:34 +00:00
Pedro F. Giffuni
fca15474a0 ext2fs: renumber the license clauses to avoid skipping #3.
This is to keep consistency with other files, and help license-checking
utilities determine the number of clauses that apply.

No functional change.
2016-12-02 19:47:23 +00:00
Mateusz Guzik
a2d3554542 vfs: provide fake locking primitives for the crossmp vnode
Since the vnode is only expected to be shared locked, we can save a
little overhead by only pretending we are locking in the first place.

Reviewed by:	kib
Tested by:	pho
2016-12-02 18:03:15 +00:00
Pedro F. Giffuni
488f148604 indent(1): Avoid out-of-bound accesses of array ps.p_stack.
Submitted by:	 Piotr Stefaniak
2016-12-02 16:42:45 +00:00
Pedro F. Giffuni
0bae80a336 indent(1): Avoid out-of-bound accesses of arrays.
ps.paren_indents:
When ps.paren_level was 0, this was accessing paren_indents[-1].

in_buffer:
This fragment checks if "*/" was read, but there's no guarantee that there
is more than one byte in the array (actually, this happens frequently for
the "{" in things like "int main(void) {").

Submitted by:	 Piotr Stefaniak
2016-12-02 16:41:08 +00:00
Pedro F. Giffuni
df54a266d3 indent(1): Remove an extra newline added in a previous commit.
It doesn't math the remaining of the case statement.
2016-12-02 16:32:14 +00:00
Alan Cox
8804a2b030 Eliminate a stale comment; vm_radix_prealloc() was replaced in r254141.
MFC after:	3 days
2016-12-02 16:29:30 +00:00
Pedro F. Giffuni
b30bb755da indent(1): Optimize parser stack usage.
When special else-if processing is enabled (-ei), we can assume "else if"
and "if" to be equivalent for indentation purposes.
This reduction saves a lot of stack space in case of a long "if-else-if
... else-if" sequence;  with this change,
Postgres/src/bin/psql/tab-complete.c as of 9.6beta3
requires minimum of the stack length to be 31 instead of 444.

Submitted by:	 Piotr Sephaniak
2016-12-02 16:28:18 +00:00
Ryan Stone
669f39b29c Revert r309372
The bug intended to be fixed by r309372 was already addressed by r296178,
so revert my change.

Reported by:	seph
2016-12-02 15:38:34 +00:00
Warner Losh
5619c99fb3 Flag the vendor specific pages as such. This allows different decoding
for the same page number as different vendors encode vendor specific
pages differently.
2016-12-02 14:44:45 +00:00
Warner Losh
158c18ffb4 dd is currently a bootstrap tool. It really doesn't have any business
being a bootstrap tool. However, for reproducible build output,
FreeBSD added dd status=none because it was otherwise difficult to
suppress the status information, but retain any errors that might
happen. There's no real reason that dd has to be a build tool, other
than we use status=none unconditional. Remove dd from a bootstrap tool
entirely by only using status=none when available. This may also help
efforts to build the system on non-FreeBSD hosts as well.

Differential Revision: https://reviews.freebsd.org/D8605
2016-12-02 14:44:38 +00:00
Ed Maste
eeef183376 Retire long-broken/unused static rtld support
rtld-elf has some vestigial support for building as a static executable.
r45501 introduced a partial implementation with a prescient note that it
"might never be enabled." r153515 introduced ELF symbol versioning
support, and removed part of the unused build infrastructure for static
rtld.

GNU ld populates rela relocation addends and GOT entries with the same
values, and rtld's run-time dynamic executable check relied on this.
Alternate toolchains may not populate the GOT entries, which caused
RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the
unused check.

If we want to restore static rtld support later on we ought to introduce
a build-time #ifdef flag.

PR:		214972
Reviewed by:	kan
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8687
2016-12-02 14:23:26 +00:00
Nick Hibma
8e349925f4 Fix man page:
- It should say 'read' in the I2CREAD section.
- last in the struct indicates the last command in a sequence, not the
  reverse.

Reviewed by:	imp
MFC after:	3 days
2016-12-02 11:32:11 +00:00
Nick Hibma
a96032e552 More typos in strings.
Submitted by:	bde
MFC after:	3 days
2016-12-02 11:30:21 +00:00
Julian Elischer
426b3d047a Changes to allow the patching of packets with an offset (and other changes.. see man page)
PR:	206185
Submitted by:	Dmitry Vagin <daemon-hammer@ya.ru>
MFC after:	 1 week
Relnotes:	yes (also ng_checksum node)
2016-12-02 10:47:10 +00:00
Julian Elischer
4e0973df9c A little light wordsmithing only.
Sponsored by:	FreeBSD
2016-12-02 09:51:12 +00:00