gonzo [Wed, 11 May 2016 18:20:02 +0000 (18:20 +0000)]
Add OF_prop_free function as a counterpart for OF_*prop_alloc
- Introduce new OF API function OF_prop_free to free memory allocated by
OF_getprop_alloc and OF_getencprop_alloc. Current code just calls free(9)
with M_OFWPROP memory class which assumes knowledge about OF_*prop_alloc
functions' internals and leads to unneccessary code coupling
- Convert some of the free(..., M_OFWPROP) instances to OF_prop_free
Files affected by this commit are the ones I was able to test on real
hardware. The rest of free(..., M_OFWPROP) instances will be handled with
idividual maintainers
Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D6315
gonzo [Wed, 11 May 2016 17:57:26 +0000 (17:57 +0000)]
Add gpiokeys driver
gpiokey driver implements functional subset of gpiokeys device-tree bindings:
https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt
It acts as a virtual keyboard, so keys are visible through kbdmux(4)
Driver maps linux scancodes for most common keys to FreeBSD scancodes and
also extends spec by introducing freebsd,code property to specify
FreeBSD-native scancodes.
emaste [Wed, 11 May 2016 17:55:09 +0000 (17:55 +0000)]
Deorbit ALLOW_SHARED_TEXTREL
We want to avoid .text relocations in shared objects. libcrypto was the
only consumer and it is now fixed (as of r299389). Remove the now-unused
support for turning off the linker warning.
cem [Wed, 11 May 2016 17:52:06 +0000 (17:52 +0000)]
whois(1): Pull out async multiple host connection code into a routine
This logic was added to the whois() function in r281959, but could easily be
its own routine. In this case, I think the abstraction makes both functions
easier to reason about.
hselasky [Wed, 11 May 2016 17:17:48 +0000 (17:17 +0000)]
The idr_for_each() function is now part of the LinuxKPI. Use the
LinuxKPI's idr_for_each() function instead of the local one to avoid
compilation issues.
andrew [Wed, 11 May 2016 17:07:29 +0000 (17:07 +0000)]
Add a new get_id interface to pci and pcib. This will allow us to both
detect failures, and get different PCI IDs.
For the former the interface returns an int to signal an error. The ID is
returned at a uintptr_t * argument.
For the latter there is a type argument that allows selecting the ID type.
This only specifies a single type, however a MSI type will be added
to handle the need to find the ID the hardware passes to the ARM GICv3
interrupt controller.
A follow up commit will be made to remove pci_get_rid.
Reviewed by: jhb, rstone
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6239
andrew [Wed, 11 May 2016 16:53:41 +0000 (16:53 +0000)]
On arm64 always create a bus_dmamap_t object. This will be use to hold the
list of memory that the kernel will need to sync when operating with a
non-cache coherent DMA engine.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
cem [Wed, 11 May 2016 16:20:23 +0000 (16:20 +0000)]
fsck_ffs: Don't overrun mount device buffer
Maybe this case is impossible. Either way, when attempting to "/dev/"-prefix a
non-global device name, check that we do not overrun the f_mntfromname buffer.
In this case, truncating (with strlcpy or similar) would not be useful, since
the f_mntfromname result of getmntpt() is passed directly to open(2) later.
cem [Wed, 11 May 2016 15:31:31 +0000 (15:31 +0000)]
Fix buffer overrun in gcore(1) NT_PRPSINFO
Use size of destination buffer, rather than a constant that may or may not
correspond to the source buffer, to restrict the length of copied strings. In
particular, pr_fname has 16+1 characters but MAXCOMLEN is 18+1.
Use strlcpy instead of strncpy to ensure the result is nul-terminated. This
seems to be what is expected of these fields.
andrew [Wed, 11 May 2016 14:59:54 +0000 (14:59 +0000)]
Add data barriers to the arm64 bus_dmamap_sync function. We need these
to ensure ordering between the CPU and device. As the CPU and DMA target
may be in different shareability domains they need to be full system
barriers.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation
zbb [Wed, 11 May 2016 13:42:20 +0000 (13:42 +0000)]
Add support for MTU chaning and Jumbo frames to VNIC
Enable previously added code for MTU handling (based on
Cavium 1.0 driver released on BSD license).
This commit enables possibility to change MTU on VNIC driver.
zbb [Wed, 11 May 2016 13:38:29 +0000 (13:38 +0000)]
Fix deadlock in VNIC when using single CPU only
Number of free Tx descriptors does not need to be locked since
it can be modified atomically between SND and CQ tasks.
It will also block Tx routine from sending packets while CQ will not
be able to free descriptors.
zbb [Wed, 11 May 2016 13:22:13 +0000 (13:22 +0000)]
Add HW RSS support to VNIC driver
Based on v1.0 driver provided by Cavium under BSD license.
Support in-hardware RSS to distribute IP, UDP and TCP traffic
among available RX Queues and hence multiple CPUs.
mav [Wed, 11 May 2016 12:54:00 +0000 (12:54 +0000)]
MFV r299440: 6736 ZFS per-vdev ZAPs
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Joe Stein <joe.stein@delphix.com>
mav [Wed, 11 May 2016 12:38:07 +0000 (12:38 +0000)]
MFV r299434: 6841 Undirty freed spill blocks
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Tim Chase <tim@chase2k.com>
royger [Wed, 11 May 2016 10:10:25 +0000 (10:10 +0000)]
xen/resume: only send BITMAP IPIs if CPUs > 1
This is quite harmless on HEAD, but it's worse on stable/10 where
lapic_ipi_vectored is the local APIC native IPI implementation. On
stable/10 cpu_ops.ipi_vectored should be used instead.
MFC after: 5 days
Sponsored by: Citrix Systems R&D
trasz [Wed, 11 May 2016 10:03:13 +0000 (10:03 +0000)]
When rerooting, take the init(8) path from argv[0] instead of fetching
it via kern.proc.pathname sysctl(2). In some cases - booting from NFS
or rerooting after replacing the init binary with a new one - the sysctl
would fail. In other cases - after upgrading, which moves the old init
to /sbin/init.bak - it would return /sbin/init.bak, which is the actual
path of the running init, instead of /sbin/init.
Reported by: Melissa Jenkins <melissa-freebsd at littlebluecar.co.uk>, jilles@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
trasz [Wed, 11 May 2016 09:30:18 +0000 (09:30 +0000)]
When rerooting, ignore ESRCH returned from kill(2). I couldn't reproduce
this by myself, but apparently it sometimes happens when rerooting from
single user mode.
Reported by: jilles@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
kib [Wed, 11 May 2016 06:32:22 +0000 (06:32 +0000)]
Add vfs_hash_ref(9) function, which finds a vnode by the hash value
and returns it referenced.
The function is similar to vfs_hash_get(9), but unlike the later,
returned vnode is not locked. This operation cannot be requested with
the vget(9) flags.
Reviewed and tested by: rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
As unicast filters are not chained, we should always try to insert the
specific filter for our MAC address, and then try to insert the unicast
mis-match filter if that fails or all unicast has been requested.
Submitted by: Mark Spender <mspender at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6295
arybchik [Wed, 11 May 2016 06:15:07 +0000 (06:15 +0000)]
sfxge(4): add TLV format buffer manipulation functions for V3 licensing
The licensing partition for V3 licensing will use the standard TLV format,
so Medford licensing operations on the staging buffer are implemented using
the TLV functions.
Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by: Solarflare Communications, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6288
jhibbits [Wed, 11 May 2016 00:41:40 +0000 (00:41 +0000)]
Don't mark the initial portal registers as fully mapped.
BMan and QMan will do this at attach time. Even though the registers are mapped
now, dpaa_portal_map_registers() will be called at BMan and QMan attach time,
updating the mappings to be private, and in the case of cache-enabled registers,
marked as coherent memory mappings.
gonzo [Wed, 11 May 2016 00:26:52 +0000 (00:26 +0000)]
Use GPIO pin management API in gpiobacklight
- Get rid of hack with re-parenting gpio-leds node to gpiobus
- Use gpio_pin_set_active to enable/disable backlight, it automatically
takes care of active-low pins
jhb [Tue, 10 May 2016 22:32:23 +0000 (22:32 +0000)]
Change the default installation directory for modules to /boot/modules.
Kernel installs always override KMODDIR when installing modules, so
this default setting is only used for standalone module builds. Many
out-of-tree modules manually override KMODDIR already to avoid placing
modules in /boot/kernel. This now makes that behavior the default.
Discussed on: arch@
Reviewed by: imp
Relnotes: yes
gonzo [Tue, 10 May 2016 20:02:03 +0000 (20:02 +0000)]
Pass device tree node as a part of gpio_pin_get_by_ofw_XXX API
Current API assumes that "gpios" property belongs to the device's node but for
some binding it's not true: gpiokeys has set of child nodes with this property.
Patch adds new argument instead of replacing device_t because device_t will be
used to track ownership for allocated pins
hselasky [Tue, 10 May 2016 18:18:29 +0000 (18:18 +0000)]
Ensure waiting loops terminate during cold boot. This fixes boot with
MacBookPro and i915kms_load="YES" in /boot/loader.conf.
A lowlevel timeout in one of the display ports caused an infinite wait
because a ticks/jiffies comparison was constant. The clock subsystem
which makes ticks/jiffies increment is started after the initial
driver probing is done. Refer to sys/kernel.h and SI_SUB_DRIVERS vs
SI_SUB_CLOCKS .
mav [Tue, 10 May 2016 16:20:36 +0000 (16:20 +0000)]
Allow sleepable allocations in enclosure daemon threads.
There were at least two places where M_NOWAIT was used without NULL check.
This change should fix NULL-dereference panic there and possibly improve
operation in other ways under memory pressure.
trasz [Tue, 10 May 2016 15:46:33 +0000 (15:46 +0000)]
Add "camcontrol reprobe" subcommand, and implement it for da(4).
This makes it possible to manually force updating capacity data
after the disk got resized. Without it it might be neccessary to
reboot before FreeBSD notices updated disk size under eg VMWare.
Discussed with: imp@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6108
andrew [Tue, 10 May 2016 15:45:59 +0000 (15:45 +0000)]
Push the logic to talk with the MSI/MSI-X interrupt controller to the FDT
attachment. This is where it will live when we import intrng as it will
need to look at either the msi-parent or msi-map FDT properties.
Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation