]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoDocument the formatting requirements of location and pnpinfo strings.
jhb [Tue, 17 May 2016 19:34:07 +0000 (19:34 +0000)]
Document the formatting requirements of location and pnpinfo strings.

devd requires location and pnpinfo strings generated by bus drivers
to be formatted as a list of name=value keypairs.  Non-conforming
bus drivers cause devd to mis-parse device events for these buses.

Note that this documents the desired requirements.  devctl_safe_quote()
doesn't yet escape backslash characters, and devd doesn't handle escaped
characters in quoted values.

Differential Revision: https://reviews.freebsd.org/D6252

8 years agoFix NULL-dereference panic if VESA reports zero modes.
mav [Tue, 17 May 2016 19:00:09 +0000 (19:00 +0000)]
Fix NULL-dereference panic if VESA reports zero modes.

MFC after: 1 week

8 years agoRemove the reiserfs(5) manpage and an example of loading the kernel module.
jhb [Tue, 17 May 2016 18:42:38 +0000 (18:42 +0000)]
Remove the reiserfs(5) manpage and an example of loading the kernel module.

8 years agomakefs(1): use all the random(3) range.
pfg [Tue, 17 May 2016 18:20:33 +0000 (18:20 +0000)]
makefs(1): use all the random(3) range.

The generation number is uint32_t so we can fit the complete range
of random(3). We could have used arc4random() but the result would
be unpredictable and it would prohibit reproducible builds.

While here add a comment where seeding is done: this affects
reproducible builds and might have to be re-visited to use a
release dependent value.

MFC after: 2 weeks

8 years agoAdd driver for "generic-ohci" as defined by FDT.
manu [Tue, 17 May 2016 17:46:12 +0000 (17:46 +0000)]
Add driver for "generic-ohci" as defined by FDT.
If platform support EXT_RESOURCES, clocks and resets are handled out of
the box.
If not driver can be subclassed using the generic_usb interface.
generic_usb name was choosed because at one point I'll add generic-ehci
FDT driver.

Reviewed by: jmcneill, hselasky
Approved by: andrew (mentor)
Differential Revision: https://reviews.freebsd.org/D5481

8 years agoFinal nit in ReiserFS removal.
gnn [Tue, 17 May 2016 17:09:45 +0000 (17:09 +0000)]
Final nit in ReiserFS removal.

8 years agoPer Ravi Pokala's suggestion, rewrite the g_reset_bio description to
imp [Tue, 17 May 2016 17:08:13 +0000 (17:08 +0000)]
Per Ravi Pokala's suggestion, rewrite the g_reset_bio description to
be clearer. It also describes it with more nuance. Add missing MLINKS
noticed by trasz@. Bump the date.

8 years agoFinish cleaning up after killing ReiserFS.
gnn [Tue, 17 May 2016 16:59:53 +0000 (16:59 +0000)]
Finish cleaning up after killing ReiserFS.

Remove LINT/NOTES option and file linkages.

8 years agomakefs(8): use NULL instead of zero for pointers.
pfg [Tue, 17 May 2016 16:58:39 +0000 (16:58 +0000)]
makefs(8): use NULL instead of zero for pointers.

8 years agonet80211: unbreak 'show all vaps(/a)' ddb command
avos [Tue, 17 May 2016 16:38:18 +0000 (16:38 +0000)]
net80211: unbreak 'show all vaps(/a)' ddb command

Replace ifnet list lookup (which is broken since r287197, because
IFT_IEEE80211 type is not used anymore) with iteration on
ieee80211com list.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6419

8 years agoKill off ReiserFS as it is no longer supported, for obvious reasons.
gnn [Tue, 17 May 2016 15:36:40 +0000 (15:36 +0000)]
Kill off ReiserFS as it is no longer supported, for obvious reasons.

8 years agoRename icl_proxy.c to icl_soft_proxy.c, to make it clear it's a part
trasz [Tue, 17 May 2016 15:21:17 +0000 (15:21 +0000)]
Rename icl_proxy.c to icl_soft_proxy.c, to make it clear it's a part
of software ICL backend.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoSpeed up vdev_geom_open_by_guids
asomers [Tue, 17 May 2016 15:17:23 +0000 (15:17 +0000)]
Speed up vdev_geom_open_by_guids

Speedup is hard to measure because the only time vdev_geom_open_by_guids
gets called on many drives at the same time is during boot. But with
vdev_geom_open hacked to always call vdev_geom_open_by_guids, operations
like "zpool create" speed up by 65%.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c

* Read all of a vdev's labels in parallel instead of sequentially.
* In vdev_geom_read_config, don't read the entire label, including
  the uberblock.  That's a waste of RAM.  Just read the vdev config
  nvlist.  Reduces the IO and RAM involved with tasting from 1MB to
  448KB.

Reviewed by: avg
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6153

8 years agoMake RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable.
mav [Tue, 17 May 2016 15:12:57 +0000 (15:12 +0000)]
Make RQCS_PORT_LOGGED_OUT for ZOMBIE ports retriable.

It is normal for ZOMBIE ports to be logged out.  This status is not really
an error until Gone Device Timeout expires, so make CAM retry after delay.

MFC after: 1 week

8 years agoIt sure would be nice to use printf with wide strings. Implement %S to
imp [Tue, 17 May 2016 14:10:45 +0000 (14:10 +0000)]
It sure would be nice to use printf with wide strings. Implement %S to
do that. The C_WIDEOUT flag indicates that the console supports
it. Mark the EFI console as supporting this.

MFC After: 3 days

8 years agoMinor space tweak to make things consistent.
imp [Tue, 17 May 2016 14:10:44 +0000 (14:10 +0000)]
Minor space tweak to make things consistent.

MFC After: 3 days

8 years agoCall RO_RTFREE() when we have detected the change of destination
ae [Tue, 17 May 2016 14:06:55 +0000 (14:06 +0000)]
Call RO_RTFREE() when we have detected the change of destination
address, otherwise the old route will be used with new destination.

MFC after: 1 week

8 years agoCompletely remove broken now autologin port flag.
mav [Tue, 17 May 2016 13:18:57 +0000 (13:18 +0000)]
Completely remove broken now autologin port flag.

Firmware automatically logs in only to local loop ports, and those ports
can be easily identified without extra flag by zero domain and area IDs.

MFC after: 1 week

8 years agoThe GIC (v2 at least) has a bit in the TYPER register to indicate whether the GIC
bz [Tue, 17 May 2016 13:12:26 +0000 (13:12 +0000)]
The GIC (v2 at least) has a bit in the TYPER register to indicate whether the GIC
supports the Security Extensions or not. This bit is not the same as the CPU one.
Currently we are not checking for either before trying to write to the special
registers.  This can lead to problems on hardware or simulators that do not
provide the security extensions.  Add the missing checks. Their interactions with
the CPU flag is not entirely clear to me but using a macro will make it easier
to quickly adjust the condition once the CPU bits are sorted as well.

Reviewed by: br
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D6397

8 years agoDon't repeat the the word 'the'
eadler [Tue, 17 May 2016 12:52:31 +0000 (12:52 +0000)]
Don't repeat the the word 'the'

(one manual change to fix grammar)

Confirmed With: db
Approved by: secteam (not really, but this is a comment typo fix)

8 years agoAdd an arm64 kernel config to help testing intrng. It is expected this
andrew [Tue, 17 May 2016 12:48:30 +0000 (12:48 +0000)]
Add an arm64 kernel config to help testing intrng. It is expected this
config will only last a few weeks until we switch to this interrupt
framework.

Obtained from:  ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoClean up the GICv3 intrng code:
andrew [Tue, 17 May 2016 12:46:50 +0000 (12:46 +0000)]
Clean up the GICv3 intrng code:
 * In gic_v3_attach free the correct data on failure.
 * Implement gic_v3_teardown_intr.
 * Update the panic string when enabling/disabling an invalid interrupt.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoSilence down the "insmntque() failed" autofs error; it happens
trasz [Tue, 17 May 2016 12:04:39 +0000 (12:04 +0000)]
Silence down the "insmntque() failed" autofs error; it happens
on shutdown and is perfectly normal.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMake iscsi_ioctl_daemon_send() actually work by adding missing locking.
trasz [Tue, 17 May 2016 11:59:38 +0000 (11:59 +0000)]
Make iscsi_ioctl_daemon_send() actually work by adding missing locking.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMake `ipfw internal olist` output more user friendly.
ae [Tue, 17 May 2016 11:22:08 +0000 (11:22 +0000)]
Make `ipfw internal olist` output more user friendly.
Print object type as string for known types.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years agoAdd icl_conn_connect() ICL method, required for iSER.
trasz [Tue, 17 May 2016 11:10:44 +0000 (11:10 +0000)]
Add icl_conn_connect() ICL method, required for iSER.

Obtained from: Mellanox Technologies (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd implementation of robust mutexes, hopefully close enough to the
kib [Tue, 17 May 2016 09:56:22 +0000 (09:56 +0000)]
Add implementation of robust mutexes, hopefully close enough to the
intention of the POSIX IEEE Std 1003.1TM-2008/Cor 1-2013.

A robust mutex is guaranteed to be cleared by the system upon either
thread or process owner termination while the mutex is held.  The next
mutex locker is then notified about inconsistent mutex state and can
execute (or abandon) corrective actions.

The patch mostly consists of small changes here and there, adding
neccessary checks for the inconsistent and abandoned conditions into
existing paths.  Additionally, the thread exit handler was extended to
iterate over the userspace-maintained list of owned robust mutexes,
unlocking and marking as terminated each of them.

The list of owned robust mutexes cannot be maintained atomically
synchronous with the mutex lock state (it is possible in kernel, but
is too expensive).  Instead, for the duration of lock or unlock
operation, the current mutex is remembered in a special slot that is
also checked by the kernel at thread termination.

Kernel must be aware about the per-thread location of the heads of
robust mutex lists and the current active mutex slot.  When a thread
touches a robust mutex for the first time, a new umtx op syscall is
issued which informs about location of lists heads.

The umtx sleep queues for PP and PI mutexes are split between
non-robust and robust.

Somewhat unrelated changes in the patch:
1. Style.
2. The fix for proper tdfind() call use in umtxq_sleep_pi() for shared
   pi mutexes.
3. Removal of the userspace struct pthread_mutex m_owner field.
4. The sysctl kern.ipc.umtx_vnode_persistent is added, which controls
   the lifetime of the shared mutex associated with a vnode' page.

Reviewed by: jilles (previous version, supposedly the objection was fixed)
Discussed with: brooks, Martin Simmons <martin@lispworks.com> (some aspects)
Tested by: pho
Sponsored by: The FreeBSD Foundation

8 years agoThis small change adopts the excellent suggestion for using named
rrs [Tue, 17 May 2016 09:53:22 +0000 (09:53 +0000)]
This small change adopts the excellent suggestion for using named
structures in the add of a new tcp-stack that came in late to me
via email after the last commit. It also makes it so that a new
stack may optionally get a callback during a retransmit
timeout. This allows the new stack to clear specific state (think
sack scoreboards or other such structures).

Sponsored by: Netflix Inc.
Differential Revision: http://reviews.freebsd.org/D6303

8 years agoAdd SUSv4 reference macro to our groff mdoc. mdocml already supports it.
kib [Tue, 17 May 2016 09:24:54 +0000 (09:24 +0000)]
Add SUSv4 reference macro to our groff mdoc.  mdocml already supports it.

Sponsored by: The FreeBSD Foundation

8 years agoExtend the ICL interface to include the PDU pointer in the task_setup
trasz [Tue, 17 May 2016 08:55:21 +0000 (08:55 +0000)]
Extend the ICL interface to include the PDU pointer in the task_setup
method.  This is required for upcoming iSER support.

Obtained from: Mellanox Technologies (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoFix comments.
kib [Tue, 17 May 2016 08:24:27 +0000 (08:24 +0000)]
Fix comments.

Submitted by: bde
MFC after: 1 week

8 years agoFix typo in the message.
kib [Tue, 17 May 2016 08:19:20 +0000 (08:19 +0000)]
Fix typo in the message.

Submitted by: bde
MFC after: 1 week

8 years agoMake ICL_KERNEL_PROXY compilable.
trasz [Tue, 17 May 2016 07:56:45 +0000 (07:56 +0000)]
Make ICL_KERNEL_PROXY compilable.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agozfs_ioc_rename: fix a reversed condition
avg [Tue, 17 May 2016 07:56:05 +0000 (07:56 +0000)]
zfs_ioc_rename: fix a reversed condition

FreeBSD zfs_ioc_rename() has an option, not present upstream, that
allows to rename snapshots without unmounting them first.  I am not sure
what is a rationale for that option, but its actual behavior was the
opposite of the intended behavior.  That is, by default the snapshots
were not unmounted.
The option was introduced as part of a large update from upstream in
r248498.

One of the consequences was a havoc under .zfs/snapshot after the rename.
The snapshots got new names but were mounted on top of directories with
old names, so readdir would list the new names, but lookup would still
find the old mounts.

PR: 209093
Reported by: Frédéric VANNIÈRE <f.vanniere@planet-work.com>
MFC after: 5 days

8 years agoAdd initial support for negotiating iSER parameters to iscsid(8). Some
trasz [Tue, 17 May 2016 07:54:53 +0000 (07:54 +0000)]
Add initial support for negotiating iSER parameters to iscsid(8).  Some
rework might be needed to support asymetrical limits, but this should be
ok for now.

Obtained from: Mellanox Technologies (earlier version)
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoMake named objects set-aware. Now it is possible to create named
ae [Tue, 17 May 2016 07:47:23 +0000 (07:47 +0000)]
Make named objects set-aware. Now it is possible to create named
objects with the same name in different sets.

Add optional manage_sets() callback to objects rewriting framework.
It is intended to implement handler for moving and swapping named
object's sets. Add ipfw_obj_manage_sets() function that implements
generic sets handler. Use new callback to implement sets support for
lookup tables.
External actions objects are global and they don't support sets.
Modify eaction_findbyname() to reflect this.
ipfw(8) now may fail to move rules or sets, because some named objects
in target set may have conflicting names.
Note that ipfw_obj_ntlv type was changed, but since lookup tables
actually didn't support sets, this change is harmless.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years ago[bwn] add in bwn n-phy linking.
adrian [Tue, 17 May 2016 07:15:25 +0000 (07:15 +0000)]
[bwn] add in bwn n-phy linking.

* The default kernel and options won't build the GPL PHY bits;
* bwn(4) defaults to building as a module anyway!;
* If BWN_GPL_PHY is specified in the config file, and you uncomment
  the GPL PHY bits in the module Makefile, you'll get a working
  N-PHY.

This is specifically designed to be obtuse for now, as I don't want
to flip it on by default.  It's easy enough for people to flip on
and build, and it's a module so the default GENERIC kernel won't be
GPL tainted.

I'll have to add an actual HAL layer that allows the GPL PHY to be loaded
before if_bwn so it can be "magic", but that'll come later.

Tested:

* BCM4321 11abg NIC, STA mode

8 years ago[bwn] Add PHY-N call hooks.
adrian [Tue, 17 May 2016 07:12:00 +0000 (07:12 +0000)]
[bwn] Add PHY-N call hooks.

8 years ago[bwn] add PHY-N glue.
adrian [Tue, 17 May 2016 07:11:12 +0000 (07:11 +0000)]
[bwn] add PHY-N glue.

It defaults to stubbing out PHY-N bindings, but it can be flipped to
call into the b43 PHY-N port.

8 years ago[bwn] add the BWN_GPL_PHY option.
adrian [Tue, 17 May 2016 07:10:30 +0000 (07:10 +0000)]
[bwn] add the BWN_GPL_PHY option.

This will eventually enable building the GPL PHY hooks needed for
running b43 based PHYs.  For now it'll just build PHY-N.

8 years ago[bwn] add initial bwn(4) N-PHY code, ported from Linux b43.
adrian [Tue, 17 May 2016 07:09:24 +0000 (07:09 +0000)]
[bwn] add initial bwn(4) N-PHY code, ported from Linux b43.

This is a GPLv2 PHY-N implementation based on the Linux b43 driver,
ported over to work in bwn(4).

I've tested this on the BCM4321 11abgn device, in 11bg and 11a modes.
The b43 PHY code only supports 11abg, no 11n, and 20MHz only wide
channels.

Yes, this is a GPLv2 driver, so it won't be included in the
default builds.

Tested:

* BCM4321 11abgn device (Apple!), 11bg and 11a STA mode.

Obtained from: Linux b43

8 years ago[bhnd] Finish bhnd(4) PCI/PCIe-G1 hostb support.
adrian [Tue, 17 May 2016 06:52:53 +0000 (06:52 +0000)]
[bhnd] Finish bhnd(4) PCI/PCIe-G1 hostb support.

Now that we've got access to SPROM and can access board identification,
this implements all known remaining hardware work-arounds for the bhnd(4)
PCI and PCIe-G1 cores operating endpoint mode.

Additionally, this adds an initial set of skeleton PCIe-G2 hostb and pcib
drivers, required by fullmac and newer softmac devices.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6377

8 years agoAdd proper PCIe init for MT7628/MT7688 SoCs
sgalabov [Tue, 17 May 2016 06:45:25 +0000 (06:45 +0000)]
Add proper PCIe init for MT7628/MT7688 SoCs

PCIe PHY needs different initialization on MT7628/MT7688 SoCs than it does
on MT7620.
However, LEDE (and OpenWRT) dts files have the PCIe node for MT7628/MT7688
as compatible with mt7620-pci.
We already can handle this properly in our driver, so we just need to add
compat strings to fbsd-mt7628an.dtsi and the PCIe driver.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6395

8 years agoImport LEDE dts files for Ralink/Mediatek
sgalabov [Tue, 17 May 2016 06:42:24 +0000 (06:42 +0000)]
Import LEDE dts files for Ralink/Mediatek

This is an import of the reworked LEDE dts files. Besides other things
they make it easier for us to reuse.

The only diffs left are for the following SoCs:
MT7620A (fbsd-mt7620a.dtsi)
MT7621 (fbsd-mt7621.dtsi)
MT7628 (fbsd-mt7628an.dtsi)
RT3883 (fbsd-rt3883.dtsi)

So we include the fbsd-*.dtsi files at the end of the original LEDE dtsi
files, using '#include "fbsd-xxxx.dtsi"'.
For example, for MT7621, the LEDE dtsi file is mt7621.dtsi. At the end of
it we add:
#include "fbsd-mt7621.dtsi"

Approved by: adrian (mentor)
Obtained from: LEDE project
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6394

8 years agoFix issues with mt762x etherswitch driver
sgalabov [Tue, 17 May 2016 06:30:46 +0000 (06:30 +0000)]
Fix issues with mt762x etherswitch driver

Fix issues that crept in with initial import.

Approved by: adrian (mentor)
Sponsored by: Smartcom - Bulgaria AD
Differential Revision: https://reviews.freebsd.org/D6393

8 years agosfxge(4): only raise an exception after MC assert or reboot in the common code
arybchik [Tue, 17 May 2016 06:28:03 +0000 (06:28 +0000)]
sfxge(4): only raise an exception after MC assert or reboot in the common code

Fix efx_mcdi_request_poll so it only raises an exception if EIO is
reported from a detected MC assert or reboot. This prevents
an unnecessary exception being raised if an MCDI response error code
is trandlated to EIO.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6392

8 years agosfxge(4): restore clearing of MCDI new epoch flag in common code
arybchik [Tue, 17 May 2016 06:27:19 +0000 (06:27 +0000)]
sfxge(4): restore clearing of MCDI new epoch flag in common code

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6390

8 years agosfxge(4): fix Medford timer quantum calculation in common code
arybchik [Tue, 17 May 2016 06:26:02 +0000 (06:26 +0000)]
sfxge(4): fix Medford timer quantum calculation in common code

The event/timer block used sysclk in Huntington, but has been
moved to the dpcpu clock domain for Medford. Fix the computed
timer quantum to use the right clock.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6389

8 years agosfxge(4): query and use current MTU if setting the MTU fails
arybchik [Tue, 17 May 2016 06:25:00 +0000 (06:25 +0000)]
sfxge(4): query and use current MTU if setting the MTU fails

This allows the driver to fall back to the largest usable MTU if a
user attempts to configure an unprivileged function with an MTU higher
than that of the attached port.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6387

8 years agosfxge(4): store licensing state in efx_lic
arybchik [Tue, 17 May 2016 06:23:50 +0000 (06:23 +0000)]
sfxge(4): store licensing state in efx_lic

Check licensing support at NIC startup to avoid multiple checks later.
As state is stored, licensing initialisation is moved later in start
procedure.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D6385

8 years agoThe EEPROM is lying about antennas. Don't hardcode things based on the chip
kevlo [Tue, 17 May 2016 06:04:33 +0000 (06:04 +0000)]
The EEPROM is lying about antennas.  Don't hardcode things based on the chip
version which is not what the vendor driver happens to do.

8 years agoswprintf() and apparently wcsftime() want the their output buffer size
truckman [Tue, 17 May 2016 05:05:30 +0000 (05:05 +0000)]
swprintf() and apparently wcsftime() want the their output buffer size
specified in terms of the the number of wide characters and not
sizeof(buffer).

Reported by: Coverity
CID: 10076051007606
MFC after: 1 week

8 years agoCorrect use of incorrect grammar.
grog [Tue, 17 May 2016 04:40:00 +0000 (04:40 +0000)]
Correct use of incorrect grammar.

8 years agoWhen clearing rtmsg, pass &rtmsg to bzero() instead of the address of
truckman [Tue, 17 May 2016 04:03:45 +0000 (04:03 +0000)]
When clearing rtmsg, pass &rtmsg to bzero() instead of the address of
just the header

Reported by: Coverity
CID: 10075681194256
MFC after: 1 week

8 years agoMark the unused arguments of various SYSINIT functions __unused.
bz [Tue, 17 May 2016 00:32:36 +0000 (00:32 +0000)]
Mark the unused arguments of various SYSINIT functions __unused.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years ago[mips] also add otus/urtwn USB modules.
adrian [Tue, 17 May 2016 00:31:37 +0000 (00:31 +0000)]
[mips] also add otus/urtwn USB modules.

I'm using both AR933x (because the boards fit in small boxes) as well
as AR934x for doing USB wifi testing on MIPS.

So far so good, for both of them.

8 years ago[mips] add urtwn and otus NIC modules.
adrian [Tue, 17 May 2016 00:30:34 +0000 (00:30 +0000)]
[mips] add urtwn and otus NIC modules.

I'm using this platform for testing USB wifi on MIPS.

8 years agoUse != 0 to be clear
sjg [Tue, 17 May 2016 00:27:18 +0000 (00:27 +0000)]
Use != 0 to be clear

8 years agoAttempt to fix r299660:
peter [Tue, 17 May 2016 00:24:53 +0000 (00:24 +0000)]
Attempt to fix r299660:
slba is used only for the GPT case.
elba is used if either GPT or LOADER_GELI_SUPPORT is enabled.

8 years ago[bhnd] Centralize fetching of board information
adrian [Tue, 17 May 2016 00:23:46 +0000 (00:23 +0000)]
[bhnd] Centralize fetching of board information

Centralizes fetching of board information (vendor, type, revision, etc),
and adds support for matching quirks against board identification info.

* Adds a BHND_BUS_READ_BOARD_INFO(), allowing bhnd bus/bus parent(s) to
  handle implementation-specific fetching of board info.
* Integrates board type constants from the latest Broadcom ISC-licensed
  bcmdevs.h included in dd-wrt's Broadcom driver source drops.
* Adds support for matching on chip/board quirks to bhnd_device_quirks()/
  bhnd_chip_quirks().
* Use the new board/chip quirk matching to match Apple devices that failed
  to set BFL2_PCIEWAR_OVR in SROM.

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6361

8 years agoAllow -f - to read from stdin.
sjg [Tue, 17 May 2016 00:08:43 +0000 (00:08 +0000)]
Allow -f - to read from stdin.

8 years ago[mips/broadcom] Add initial support for Broadcom MIPS processor
adrian [Tue, 17 May 2016 00:00:01 +0000 (00:00 +0000)]
[mips/broadcom] Add initial support for Broadcom MIPS processor

Relies on BHND(4) driver.

There files contains machine-dependent code for Broadcom MIPS processor and
provide UART driver.

This is a work in progress; it and the current bhnd code is enough to boot
on the ASUS RT-N16 and RT-N53 platforms.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6251

8 years ago[mips] Improve MIPS trampoline code
adrian [Mon, 16 May 2016 23:56:31 +0000 (23:56 +0000)]
[mips] Improve MIPS trampoline code

This patch fix trampoline build. inckern.S increases stack and calls _startC
of elf_trampoline, so inckern.S should be called before elf_trampoline. gcc4.2 puts
text (code) into image according to order of source files in this call, so order has changed.

In addition make will install trampoline kernel. It allows to use kernel for firmware build.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6242

8 years ago[mips/broadcom] Add initial code for interrupts on the Broadcom MIPS processor
adrian [Mon, 16 May 2016 23:54:28 +0000 (23:54 +0000)]
[mips/broadcom] Add initial code for interrupts on the Broadcom MIPS processor

Broadcom MIPS processor doesn't reset TI flag if additional manipulation
is done.

Thanks to @sobomax!

8 years agoDon't walk off the end of the array when proto isn't explicitly
truckman [Mon, 16 May 2016 23:47:08 +0000 (23:47 +0000)]
Don't walk off the end of the array when proto isn't explicitly
listed above.  Instead update the catch-all "Others" bucket.

Reported by: Coverity
CID: 10075711007572
MFC after: 1 week

8 years ago[bhnd] Add logging macros to BHND.
adrian [Mon, 16 May 2016 23:40:32 +0000 (23:40 +0000)]
[bhnd] Add logging macros to BHND.

There are 5 logging levels:

* ERROR
* WARN
* INFO
* DEBUG
* TRACE

There are 2 logging context:

* with
* without device

DEBUG and TRACE records are printed only if bootverbose.
Logging records are printed with source code line information if acceptable
logging level is DEBUG or TRACE.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6247

8 years ago[bhnd] Add support for matching of MIPS & ARM cores
adrian [Mon, 16 May 2016 23:37:18 +0000 (23:37 +0000)]
[bhnd] Add support for matching of MIPS & ARM cores

Extend macros for MIPS & ARM cores. Now only BCM cores can be matched by matching mechanism.

Submitted by: Michael Zhilin <mizhka@gmail.com>
Differential Revision: https://reviews.freebsd.org/D6246

8 years agoSet ai2 to NULL in in find_host() before the loop and after calling
truckman [Mon, 16 May 2016 23:29:04 +0000 (23:29 +0000)]
Set ai2 to NULL in in find_host() before the loop and after calling
freeaddrinfo() on it to indicate that it doesn't point to a valid
addrinfo list.  This fixes this Coverity issues:
1006368 Uninitialized pointer read
1018506 Double free
1305590 Resource leak
that can be triggered in the hp->hostname[0] != '\0' case.

Don't treat a character as a boolean.

Fix these Coverity issues:
1009293 Unchecked return value from library
1194246 Wrong size argument
by tweaking the status file extend code.

Reported by: Coverity
CID: 10063681018506130559010092931194246
Reviewed by: rmacklem
Feedback from: hrs
MFC after: 1 week
Differential Revision: D6398

8 years agoActually use the loop interation limit so carefully computed on the
truckman [Mon, 16 May 2016 23:00:48 +0000 (23:00 +0000)]
Actually use the loop interation limit so carefully computed on the
previous line to prevent buffer overflow.  This turns out to not be
important because the upstream xdr code already capped the object
size at the proper value.  Using the correct limit here looks a lot
less scary and should please Coverity.

Reported by: Coverity
CID: 11993091199310
MFC after: 1 week

8 years ago[bwn] add opt_wlan.h / opt_bwn.h for build-time control
adrian [Mon, 16 May 2016 22:57:36 +0000 (22:57 +0000)]
[bwn] add opt_wlan.h / opt_bwn.h for build-time control

This is a separate commit as I have local changes to bwn for now and
this needs a manual merge/commit.

Sponsored by: Palm Springs

8 years ago[bwn] add opt_wlan.h and opt_bwn.h so we can enable bwn debugging as appropriate.
adrian [Mon, 16 May 2016 22:56:45 +0000 (22:56 +0000)]
[bwn] add opt_wlan.h and opt_bwn.h so we can enable bwn debugging as appropriate.

Tested:

* BCM4322, STA mode (11a)

Sponsored by: Palm Springs

8 years ago[bwn] switch to ieee80211_add_channel()
adrian [Mon, 16 May 2016 22:39:17 +0000 (22:39 +0000)]
[bwn] switch to ieee80211_add_channel()

This is an updated version of D6140.

Tested:

* BCM4321 11abgn, STA mode (11a)

Submitted by: avos
Differential Revision: https://reviews.freebsd.org/D6140

8 years agoUse polling spin loops for timeouts during early boot.
jhb [Mon, 16 May 2016 21:33:31 +0000 (21:33 +0000)]
Use polling spin loops for timeouts during early boot.

Some ACPI operations such as mutex acquires and event waits accept a
timeout.  The ACPI OSD layer implements these timeouts by using regular
sleep timeouts.  However, this doesn't work during early boot before
event timers are setup.  Instead, use polling combined with DELAY()
to spin.

This fixes booting on upcoming Intel systems with Kaby Lake processors.

Tested by: "Jeffrey E Pieper" <jeffrey.e.pieper@intel.com>
Reviewed by: jimharris
MFC after: 1 week

8 years ago[bwn] check DUALPHY; add BCM4322 to the don't-override list.
adrian [Mon, 16 May 2016 20:26:30 +0000 (20:26 +0000)]
[bwn] check DUALPHY; add BCM4322 to the don't-override list.

* DUALPHY in TGSHIGH tells us there's a phy that is dualband, rather than
  two separate PHYs/MACs (which we almost but don't quite yet support.)
  Use it.

* Add the BCM4322 PCI ID to the list of devices we don't override.
  This means the 2g/5g flags are preserved, and thus we get 5GHz
  operation (with N-PHY, of course.)

Tested:

* BCM4311, STA mode (11bg)
* BCM4312, STA mode (11bg)
* BCM4321, STA mode (11abg)

Sponsored by: Palm Springs

8 years ago[siba] fix up debugging.
adrian [Mon, 16 May 2016 20:22:52 +0000 (20:22 +0000)]
[siba] fix up debugging.

* unbreak non-debug builds - don't default to debugging SCAN; that was
  left-over from my testing.
* include opt_siba.h, now that it's generated as appropriate.
* stick the debug enum outside the debug block, just so it's there for
  any code that wants to set siba_debug for some reason (like say,
  my debugging muckup.)
* make DPRINTF() use __VA_ARGS__ for formatting too, so it correctly
  handles printing w/ no args.
* Make DPRINTF() use device_printf().

Sponsored by: Palm Springs

8 years ago[siba] add SIBA_DEBUG option.
adrian [Mon, 16 May 2016 20:18:54 +0000 (20:18 +0000)]
[siba] add SIBA_DEBUG option.

Sponsored by: Palm Springs

8 years agodev/ow: Tag an unreachable switch default.
pfg [Mon, 16 May 2016 20:04:38 +0000 (20:04 +0000)]
dev/ow: Tag an unreachable switch default.

Coverity reports an uninitialized "dir" in case the switch defaults
without hitting any case. Respect the original intent and quell the
false positive with the relatively new __unreachable() builtin.

CID: 1331566

8 years agolibefi: Tag an unreachable switch default.
pfg [Mon, 16 May 2016 20:00:09 +0000 (20:00 +0000)]
libefi: Tag an unreachable switch default.

Coverity reports an uninitialized "len" in case the switch defaults
without hitting any case. Respect the original intent and quell the
false positive with the relatively new __unreachable() builtin.

CID: 1347796

8 years agoFix off by one error that overflowed the rep_len array when doing
truckman [Mon, 16 May 2016 19:48:02 +0000 (19:48 +0000)]
Fix off by one error that overflowed the rep_len array when doing
the final NUL termination.

Reported by: Coverity
CID: 1007617
MFC after: 1 week

8 years agoAdd a small set of logical operators to DDB command language.
pfg [Mon, 16 May 2016 19:42:38 +0000 (19:42 +0000)]
Add a small set of logical operators to DDB command language.

This are based on Mach3.
Documentation is pending but has been promised.

Submitted by: Dan Partelly
Reviewed by: adrian, jhb (older version)

Differential Revision: https://reviews.freebsd.org/D4230
RelNotes: yes

8 years ago[siba] make the debug code somewhat useful again.
adrian [Mon, 16 May 2016 19:39:05 +0000 (19:39 +0000)]
[siba] make the debug code somewhat useful again.

It's still not configurable by a kernel option; that'll come next.

Sponsored by: Palm Springs

8 years agourtwn: add support for hardware multicast filter setup.
avos [Mon, 16 May 2016 19:10:59 +0000 (19:10 +0000)]
urtwn: add support for hardware multicast filter setup.

Tested with RTL8188EU and RTL8188CUS.

8 years agoAdd HWPMC_HOOKS to std.armv6 to make them available
bz [Mon, 16 May 2016 19:07:58 +0000 (19:07 +0000)]
Add HWPMC_HOOKS to std.armv6 to make them available
so the module could be loaded.

Discussed with: andrew
Reviewed by: andrew
Sponsored by: DARPA/AFRL
Differential Revision: https://reviews.freebsd.org/D6359

8 years agoOnly lock Giant when needed in the LinuxKPI.
hselasky [Mon, 16 May 2016 17:41:25 +0000 (17:41 +0000)]
Only lock Giant when needed in the LinuxKPI.

Suggested by: ngie @
MFC after: 1 week
Sponsored by: Mellanox Technologies

8 years agoReduce verbosity of "now sending synthesized status" message.
mav [Mon, 16 May 2016 17:18:26 +0000 (17:18 +0000)]
Reduce verbosity of "now sending synthesized status" message.

MFC after: 1 week

8 years agoNo need to check login status for ZOMBIE ports.
mav [Mon, 16 May 2016 16:44:34 +0000 (16:44 +0000)]
No need to check login status for ZOMBIE ports.

ZOMBIE ports are always logged out, and so initiator may try to relogin.

MFC after: 1 weeks

8 years agoFix an off by one error to avoid overflowing rp[].
truckman [Mon, 16 May 2016 16:16:46 +0000 (16:16 +0000)]
Fix an off by one error to avoid overflowing rp[].

Reported by: Coverity
CID: 1007579

8 years agoIncrease size of argv[] array to avoid running off the end.
truckman [Mon, 16 May 2016 16:01:46 +0000 (16:01 +0000)]
Increase size of argv[] array to avoid running off the end.

Reported by: Coverity
CID: 1193819
MFC after: 1 week

8 years agodo not destroy 'snapdir' when it becomes inactive
avg [Mon, 16 May 2016 15:48:56 +0000 (15:48 +0000)]
do not destroy 'snapdir' when it becomes  inactive

That was just wrong.  In fact, we can safely keep this static entry when
it's inactive.
Now the destructive action is moved to the reclaim method and the
function is renamed from zfsctl_snapdir_inactive(0 to
zfsctl_snapdir_reclaim().

Also, we can use gfs_vop_reclaim() instead of gfs_dir_inactive() +
kmem_free().

Lastly, we can just assert that the node does not any children when it
is reclaimed, even on the force unmount.  That's because zfs_umount()
does an extra vflush() pass which should destroy all snapshot-mountpoint
vnodes that are the snapdir's children.

MFC after: 5 weeks

8 years agoFix off by one error in index limit calculation
truckman [Mon, 16 May 2016 15:42:59 +0000 (15:42 +0000)]
Fix off by one error in index limit calculation

Reported by: Coverity
CID: 1193826

8 years agotry to recycle "snap" vnodes as soon as possible
avg [Mon, 16 May 2016 15:37:41 +0000 (15:37 +0000)]
try to recycle "snap" vnodes as soon as possible

Those vnodes should not linger.  "Stale" nodes may get out of
synchronization with actual snapshots.  For example if we destroy a
snapshot and create a new one with the same name.  Or when we rename a
snapshot.

While there fix the argument type for zfsctl_snapshot_reclaim().
Also, its original argument can be passed to gfs_vop_reclaim() directly.

Bug 209093 could be related although I have not specifically verified
that.  Referencing just in case.

PR: 209093
MFC after: 5 weeks

8 years agoSet retval in the empty password case to avoid a path through the
truckman [Mon, 16 May 2016 15:32:02 +0000 (15:32 +0000)]
Set retval in the empty password case to avoid a path through the
code that fails to set retval before falling through to the final
return().

Reported by: emaste
Reported by: Coverity
CID: 1018711
MFC after: 1 week

8 years agofix locking in zfsctl_root_lookup
avg [Mon, 16 May 2016 15:28:39 +0000 (15:28 +0000)]
fix locking in zfsctl_root_lookup

Dropping the root vnode's lock after VFS_ROOT() didn't really help the
fact that we acquired the lock while holding its child's, .zfs, lock
while performing the operaiton.
So, directly use zfs_zget() to get the root vnode.

While there simplify the code in zfsctl_freebsd_root_lookup.
We know that .zfs is always exclusively locked.
We know that there is already a reference on *vpp, so no need for an
extra one.
Account for the fact that .. lookup may ask for a different lock type,
not necessarily LK_EXCLUSIVE.  And handle a possible failure to acquire
the lock given the lock flags.

MFC after: 5 weeks

8 years agogfs_lookup_dot() does not have to acquire any locks
avg [Mon, 16 May 2016 15:13:16 +0000 (15:13 +0000)]
gfs_lookup_dot() does not have to acquire any locks

In fact, that was dangerous.  For example, zfsctl_snapshot_reclaim()
calls gfs_dir_lookup() on ".." path and that ends up calling
gfs_lookup_dot() which violated locking order by acquiring the parent's
directory vnode lock after the child's vnode lock.

Also, the previous behavior was inconsistent as gfs_dir_lookup()
returned a locked vnode for . and .. lookups, but not for any other.

Now gfs_lookup_dot() just references a resulting vnode and the locking
is done in its consumers, where necessary.
Note that we do not enable shared locking support for any gfs / zfsctl
vnodes.

This commit partially reverts r273641.

MFC after: 5 weeks

8 years agoavoid deadlock between zfsctl_snapdir_lookup and zfsctl_snapshot_reclaim
avg [Mon, 16 May 2016 15:03:52 +0000 (15:03 +0000)]
avoid deadlock between zfsctl_snapdir_lookup and zfsctl_snapshot_reclaim

The former acquired a snap vnode lock while holding sd_lock while the
latter does the opposite.

The solution is drop sd_lock before acquiring the vnode lock.  That
should be okay as we are still holding a lock on the 'snapshot'
directory in the exclusive mode.  That lock ensures that there are no
concurrent lookups in the directory and thus no concurrent mount attempts.

But now we have to account for the possibility that the snap vnode
might get reclaim after we drop sd_lock and before we can get
the node lock.  So, check for that case and retry.

MFC after: 5 weeks

8 years agoAdd intrng support to the GICv3 driver. It lacks ITS support so won't handle
andrew [Mon, 16 May 2016 14:07:43 +0000 (14:07 +0000)]
Add intrng support to the GICv3 driver. It lacks ITS support so won't handle
MSI or MSI-X interrupts, however this is enought to boot FreeBSD under the
ARM Foundation Model with a GICv3 interrupt controller.

Approved by: ABT Systems Ltd
Relnotes: yes
Sponsored by: The FreeBSD Foundation

8 years agolibthr(3): Fix xref to _umtx_op(2) now that we have it.
jilles [Mon, 16 May 2016 13:39:04 +0000 (13:39 +0000)]
libthr(3): Fix xref to _umtx_op(2) now that we have it.

8 years agoinstall: Revert utimensat usage (r299850).
jilles [Mon, 16 May 2016 12:56:28 +0000 (12:56 +0000)]
install: Revert utimensat usage (r299850).

This should fix the build on older stable/10, since install is a bootstrap
tool.

Pending a decision how to fix this properly, revert utimensat usage. Copies
with the -p option will again appear older than the original almost always,
but -p is not commonly used.

8 years agoCall ofw_bus_msimap to find the parent MSI controller, it may not use the
andrew [Mon, 16 May 2016 12:18:30 +0000 (12:18 +0000)]
Call ofw_bus_msimap to find the parent MSI controller, it may not use the
msi-parent property.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agofix a vnode reference leak caused by illumos compat traverse()
avg [Mon, 16 May 2016 12:15:19 +0000 (12:15 +0000)]
fix a vnode reference leak caused by illumos compat traverse()

This commit partially reverts r273641 which introduced the leak.
It did so to accomodate for some consumers of traverse() that expected
the starting vnode to stay as-is.  But that introduced the leak in the
case when a mounted filesystem was found and its root vnode was
returned.

r299914 removed the troublesome consumers and now there is no reason to
keep the starting vnode.  So, now the new rules are:
- if there is no mounted filesystem, then nothing is changed
- otherwise the starting vnode is always released
- the root vnode of the mounted filesystem is returned locked and
  referenced in the case of success

MFC after: 5 weeks
X-MFC after: r299914