]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoFix the return type for pager_output(..) in bootparttest and zfsboottest
Enji Cooper [Tue, 1 Aug 2017 05:29:36 +0000 (05:29 +0000)]
Fix the return type for pager_output(..) in bootparttest and zfsboottest

pager_output(..) has always returned int. For some reason (probably the
clang 5.0 update), this mismatch now results in an error with CC=clang.

MFC after: 1 week

6 years agoChase r315408 with the fourth parameter being removed from disk_open(..)
Enji Cooper [Tue, 1 Aug 2017 05:26:45 +0000 (05:26 +0000)]
Chase r315408 with the fourth parameter being removed from disk_open(..)

This fixes one part of the build.

6 years agoBatch updates to v_wire_count when freeing page table pages on x86.
Mark Johnston [Tue, 1 Aug 2017 05:26:30 +0000 (05:26 +0000)]
Batch updates to v_wire_count when freeing page table pages on x86.

The removed release stores are not needed since stores are totally
ordered on i386 and amd64.

Reviewed by: alc, kib (previous revision)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11790

6 years agoLog when we have finished pushing users and groups.
Marcelo Araujo [Tue, 1 Aug 2017 05:26:20 +0000 (05:26 +0000)]
Log when we have finished pushing users and groups.

Obtained from: OpenBSD (rev 1.4)
MFC after: 3 weeks.

6 years agoStandardize on SRCTOP instead of .CURDIR-relative paths
Enji Cooper [Tue, 1 Aug 2017 05:23:49 +0000 (05:23 +0000)]
Standardize on SRCTOP instead of .CURDIR-relative paths

MFC after: 3 days

6 years agoClean up style in print_state(..) and pager_printf(..)
Enji Cooper [Tue, 1 Aug 2017 05:16:14 +0000 (05:16 +0000)]
Clean up style in print_state(..) and pager_printf(..)

No functional change intended.

MFC after: 3 days

6 years agoRemove local variables missed in r321842.
Mark Johnston [Tue, 1 Aug 2017 04:52:03 +0000 (04:52 +0000)]
Remove local variables missed in r321842.

X-MFC with: r321842

6 years agoLet lockstat use ksyms(4)'s mmap interface.
Mark Johnston [Tue, 1 Aug 2017 04:49:54 +0000 (04:49 +0000)]
Let lockstat use ksyms(4)'s mmap interface.

The workaround described in the deleted comment is no longer needed.

MFC after: 1 week

6 years agoAdd a driver for the Intersil ISL12xx family of i2c RTC chips.
Ian Lepore [Tue, 1 Aug 2017 04:16:52 +0000 (04:16 +0000)]
Add a driver for the Intersil ISL12xx family of i2c RTC chips.

Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC
functionality, not all the other fancy stuff the chips can do).

6 years agoThe blist_meta_* routines that process a subtree take arguments 'radix' and
Alan Cox [Tue, 1 Aug 2017 03:51:26 +0000 (03:51 +0000)]
The blist_meta_* routines that process a subtree take arguments 'radix' and
'skip', which denote, respectively, the largest number of blocks that can be
managed by a subtree of that height, and one less than the number of nodes
in a subtree of that height.  This change removes the 'skip' argument from
those functions because 'skip' can be trivially computed from 'radius'.
This change also redefines 'skip' so that it denotes the number of nodes in
the subtree, and so changes loop upper bound tests from '<= skip' to '<
skip' to account for the change.

The 'skip' field is also removed from the blist struct.

The self-test program is changed so that the print command includes the
cursor value in the output.

Submitted by: Doug Moore <dougm@rice.edu>
MFC after: 1 week

6 years agoImplement proper Linux /dev/fd and /proc/self/fd behavior by adding
Dmitry Chagin [Tue, 1 Aug 2017 03:40:19 +0000 (03:40 +0000)]
Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
Linux specific things to the native fdescfs file system.

Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
links to the actual files, which the process has open.
A readlink(2) call on this file returns a full path in case of regular file
or a string in a special format (type:[inode], anon_inode:<file-type>, etc..).
As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
equivalent to duplicating the corresponding file descriptor.

Here we have mutually exclusive requirements:
- in case of readlink(2) call fdescfs lookup() method should return VLNK
vnode otherwise our kern_readlink() fail with EINVAL error;
- in the other calls fdescfs lookup() method should return non VLNK vnode.

For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed
mounted with linrdlnk option an modified kern_readlinkat() to properly handle it.

For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:

    mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd

Reviewed by: kib@
MFC after: 1 week
Relnotes: yes

6 years agosys/net8021: Add missing braces in setcurchan().
Pedro F. Giffuni [Tue, 1 Aug 2017 03:13:43 +0000 (03:13 +0000)]
sys/net8021: Add missing braces in setcurchan().

Obtained from: DragonFlyBSD (git c69e37d6)
MFC after: 3 days

6 years agohyperv/hn: Add comment about ether_ifattach event subscription.
Sepherosa Ziehau [Tue, 1 Aug 2017 02:55:43 +0000 (02:55 +0000)]
hyperv/hn: Add comment about ether_ifattach event subscription.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11710

6 years agohyperv/hn: Renaming and minor cleanup
Sepherosa Ziehau [Tue, 1 Aug 2017 02:45:54 +0000 (02:45 +0000)]
hyperv/hn: Renaming and minor cleanup

This prepares for the upcoming transparent VF support.

MFC after: 3 days
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11708

6 years agoAdd myself to FreeBSD calendar
Jason A. Harmening [Tue, 1 Aug 2017 01:39:54 +0000 (01:39 +0000)]
Add myself to FreeBSD calendar

Requested by: mckusick

6 years agoBring my aging self to calendar.freebsd.
Pedro F. Giffuni [Tue, 1 Aug 2017 01:35:23 +0000 (01:35 +0000)]
Bring my aging self to calendar.freebsd.

Requested by: mckusick

6 years agoBuild iicbus/{ds1307,ds3231,nxprtc} as modules.
Ian Lepore [Mon, 31 Jul 2017 22:32:11 +0000 (22:32 +0000)]
Build iicbus/{ds1307,ds3231,nxprtc} as modules.

6 years agoRestructure the SUBDIR list as 1-per-line and alphabetize, so it will be
Ian Lepore [Mon, 31 Jul 2017 22:26:30 +0000 (22:26 +0000)]
Restructure the SUBDIR list as 1-per-line and alphabetize, so it will be
easier to add new things (and see what changed) in the future.

6 years agoAllow changing the test PORT at compile-time.
Bryan Drewery [Mon, 31 Jul 2017 22:00:27 +0000 (22:00 +0000)]
Allow changing the test PORT at compile-time.

Sponsored by: Dell EMC Isilon

6 years agoBugfixes and enhancements...
Ian Lepore [Mon, 31 Jul 2017 22:00:00 +0000 (22:00 +0000)]
Bugfixes and enhancements...

Don't enable the oscillator when it is found to be stopped at init time,
just let the first setting of valid time start it.  But still report a dead
battery if it's stopped at init time.

Don't force the chip into 24hr mode, just cope with whatever mode it is
already in.

Schedule the clock_settime() callbacks to align the RTC clock to top of
second when setting it.

6 years agoNo need to call getnanotime() now that the waiting is done by the central
Ian Lepore [Mon, 31 Jul 2017 21:53:00 +0000 (21:53 +0000)]
No need to call getnanotime() now that the waiting is done by the central
subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ
so that we get fed a timestamp, but it's not adjusted to compensate for
inaccuracy in setting time.

6 years agoAdd myself to the calendar.freebsd
Tobias C. Berner [Mon, 31 Jul 2017 21:08:31 +0000 (21:08 +0000)]
Add myself to the calendar.freebsd

Reported by:    mckusick

6 years agoAdd myself to the calendar.freebsd
Pawel Pekala [Mon, 31 Jul 2017 20:54:23 +0000 (20:54 +0000)]
Add myself to the calendar.freebsd

Reported by: mckusick

6 years agoAvoid reading a snapshot block when it is already in the cache.
Kirk McKusick [Mon, 31 Jul 2017 20:41:45 +0000 (20:41 +0000)]
Avoid reading a snapshot block when it is already in the cache.
Update the use of the B_CACHE flag (since the May 1999 commit
that made it the correct test here).

Reported by: Andreas Longwitz <longwitz@incore.de>
Reviewed by: kib
Tested by: Peter Holm
MFC after: 1 week

6 years agoAdd myself to the calendar.
Mateusz Guzik [Mon, 31 Jul 2017 20:15:11 +0000 (20:15 +0000)]
Add myself to the calendar.

Prodded by: invisible peer pressure

6 years agoUpdate pci_vendors to 2017.07.27
Baptiste Daroussin [Mon, 31 Jul 2017 19:51:36 +0000 (19:51 +0000)]
Update pci_vendors to 2017.07.27

MFC after: 2 days

6 years agoUpdate mandoc to 1.14.2
Baptiste Daroussin [Mon, 31 Jul 2017 19:34:38 +0000 (19:34 +0000)]
Update mandoc to 1.14.2

6 years agoImport mandoc 1.14.2
Baptiste Daroussin [Mon, 31 Jul 2017 19:17:54 +0000 (19:17 +0000)]
Import mandoc 1.14.2

6 years agoRemove redundant include directories which expand to a noop,
Cy Schubert [Mon, 31 Jul 2017 19:07:45 +0000 (19:07 +0000)]
Remove redundant include directories which expand to a noop,
"-I/lib/krb5 -I -I".

Reviewed by: ngie@, markm@
MFC after: 1 month
Differential Revision: D11769

6 years agoBatch v_wire_count decrements in vm_hold_free_pages().
Mark Johnston [Mon, 31 Jul 2017 18:48:58 +0000 (18:48 +0000)]
Batch v_wire_count decrements in vm_hold_free_pages().

Atomic updates to v_wire_count are a significant source of contention, so
combine multiple updates into one in this easy case. Also remove an old
printf that gets executed if the page is shared-busied, which is a case
that will lead to a panic anyway.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11791

6 years agoAdd myself to the calendar.
Matt Joras [Mon, 31 Jul 2017 18:10:10 +0000 (18:10 +0000)]
Add myself to the calendar.

Reported by: mckusick
Approved by: rstone (mentor)
Differential Revision: https://reviews.freebsd.org/D11797

6 years agoDon't trace running threads that have interrupts disabled.
Mark Johnston [Mon, 31 Jul 2017 17:57:54 +0000 (17:57 +0000)]
Don't trace running threads that have interrupts disabled.

In this case we shouldn't assume that the thread has a valid frame pointer.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11787

6 years agoAdd myself to calendar.freebsd
Eric Joyner [Mon, 31 Jul 2017 17:57:44 +0000 (17:57 +0000)]
Add myself to calendar.freebsd

Reported by: mckusick

6 years agoAdd myself to calendar.
Dru Lavigne [Mon, 31 Jul 2017 17:49:47 +0000 (17:49 +0000)]
Add myself to calendar.

6 years ago[wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC.
Adrian Chadd [Mon, 31 Jul 2017 17:33:57 +0000 (17:33 +0000)]
[wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC.

The wlanwds code was just creating a clone VAP without specifying the MAC
address to use for said clone VAP.  This meant that if an interface
was cloned from an AP interface that wasn't the first created VAP
(which shares the same MAC as the parent physical interface by default)
then the cloned interface would have the wrong MAC and traffic wouldn't work.

Besides chip bugs (ha!) this isn't a requirement.

So, teach wlanwds to:

* look up the link layer address for a given interface (which really should
  be a library interface, and will likely quickly become one);
* use this when creating a cloned interface for a DWDS peer;
* (net80211 already has the infrastructure to do this, it just needed to be
  used);
* add some extra logging to see what MAC addresses, parent interfaces, etc
  are being created.

Whilst here, add a reminder that I should extend this to include monitoring
a specific VAP for DWDS updates rather than just the parent interface.

This is the first step in allowing for multiple DWDS hops, which is a
pre-requisite for adrian's house having wifi in the single upstairs room.

Tested:

* AR9380, DWDS AP + AP mode - with DWDS AP being the second VAP created
  with a different MAC address;
* AR9331 (Carambola2), AP + DWDS STA;
* passing traffic

TODO:

* fix 802.11s so this DWDS stuff is no longer required!

6 years agoFix a logic bug in the split PCI interrupt code that slipped through
Scott Long [Mon, 31 Jul 2017 16:55:56 +0000 (16:55 +0000)]
Fix a logic bug in the split PCI interrupt code that slipped through

Reported by: Harry Schmalzbauer

6 years agoRestore a few rather important lines of code that got fumbled in r321746.
Ian Lepore [Mon, 31 Jul 2017 16:46:16 +0000 (16:46 +0000)]
Restore a few rather important lines of code that got fumbled in r321746.

6 years agoAdd an entry to the freebsd calendar for myself.
Scott Long [Mon, 31 Jul 2017 15:50:58 +0000 (15:50 +0000)]
Add an entry to the freebsd calendar for myself.

Reported by: kirk

6 years agoAdd myself to the birthday calendar.
Jamie Gritton [Mon, 31 Jul 2017 15:29:44 +0000 (15:29 +0000)]
Add myself to the birthday calendar.

Reminded by: mckusick

6 years agoCheck the clock-halted flag every time the clock is read, not just once
Ian Lepore [Mon, 31 Jul 2017 15:24:40 +0000 (15:24 +0000)]
Check the clock-halted flag every time the clock is read, not just once
at startup.  The flag stays set until the clock is loaded with good time,
so we need to keep saying the time is invalid until that happens.

6 years agoImprove FHA locality control for NFS read/write requests.
Alexander Motin [Mon, 31 Jul 2017 15:23:19 +0000 (15:23 +0000)]
Improve FHA locality control for NFS read/write requests.

This change adds two new tunables, allowing to control serialization for
read and write NFS requests separately.  It does not change the default
behavior since there are too many factors to consider, but gives additional
space for further experiments and tuning.

The main motivation for this change is very low write speed in case of ZFS
with sync=always or when NFS clients requests sychronous operation, when
every separate request has to be written/flushed to ZIL, and requests are
processed one at a time.  Setting vfs.nfsd.fha.write=0 in that case allows
to increase ZIL throughput by several times by coalescing writes and cache
flushes.  There is a worry that doing it may increase data fragmentation
on disks, but I suppose it should not happen for pool with SLOG.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

6 years agospellcheck jhale's calendar entry
Alan Somers [Mon, 31 Jul 2017 15:21:26 +0000 (15:21 +0000)]
spellcheck jhale's calendar entry

6 years agoAdd a detach() method.
Ian Lepore [Mon, 31 Jul 2017 14:58:01 +0000 (14:58 +0000)]
Add a detach() method.

6 years agoSwitch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
Ian Lepore [Mon, 31 Jul 2017 14:57:02 +0000 (14:57 +0000)]
Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
that transfers will be done with proper ownership of the bus. No
behavioral changes.  Also add a detach() method.

6 years agoDon't request CTLTYPE_OPAQUE if we can't print them.
Andrew Gallatin [Mon, 31 Jul 2017 14:56:35 +0000 (14:56 +0000)]
Don't request CTLTYPE_OPAQUE if we can't print them.

The intent is to skip expensive opaque sysctls like tcp_pcblist unless
they are explicitly requested. Sysctl nodes like this don't show up in
sysctl -a, but they do generate output that winds up being dropped,
unless the user specifically requested  binary/hex output or opaques.

This reduces the runtime of sysctl in many circumstances on a loaded
system.  It also reduces the likelihood that simply gathering
diagnostics on a sick machine (stuck lock, etc) via sysctl -a might
push it over the edge into a total lockup.

Reviewed by: jtl
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D11461

6 years agoAdd myself.
Yoshihiro Takahashi [Mon, 31 Jul 2017 14:53:03 +0000 (14:53 +0000)]
Add myself.

Reminded by: mckusick

6 years agoAdd myself to the calendar
Alan Somers [Mon, 31 Jul 2017 14:50:42 +0000 (14:50 +0000)]
Add myself to the calendar

Reported by: mckusick

6 years agoAdd myself to the calendar
Martin Matuska [Mon, 31 Jul 2017 14:49:44 +0000 (14:49 +0000)]
Add myself to the calendar

Reminded by: mckusick

6 years agoAdd my birthday to the FreeBSD calendar
Ravi Pokala [Mon, 31 Jul 2017 14:42:38 +0000 (14:42 +0000)]
Add my birthday to the FreeBSD calendar

Requested by: mckusick

6 years agoAdd myself to the calendar
Justin Hibbits [Mon, 31 Jul 2017 14:16:35 +0000 (14:16 +0000)]
Add myself to the calendar

Reminded by: mckusick

6 years agoadd myself to calendar.freebsd
Wen Heping [Mon, 31 Jul 2017 13:32:35 +0000 (13:32 +0000)]
add myself to calendar.freebsd

6 years agoadd myself to calendar.freebsd
Nikolai Lifanov [Mon, 31 Jul 2017 13:08:47 +0000 (13:08 +0000)]
add myself to calendar.freebsd

6 years agoRemove some dead statistics related code and a structure field from the
Hans Petter Selasky [Mon, 31 Jul 2017 12:09:24 +0000 (12:09 +0000)]
Remove some dead statistics related code and a structure field from the
mlx4en driver which is used by its Linux counterpart, but not under
FreeBSD.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoMake sure on-stack buffer is properly aligned.
Hans Petter Selasky [Mon, 31 Jul 2017 12:03:45 +0000 (12:03 +0000)]
Make sure on-stack buffer is properly aligned.

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook
Andrey V. Elsukov [Mon, 31 Jul 2017 11:04:35 +0000 (11:04 +0000)]
Add inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook
from enc_hhook().

This should solve the problem when pf is used with if_enc(4) interface,
and outbound packet with existing PCB checked by pf, and this leads to
deadlock due to pf does its own PCB lookup and tries to take rlock when
wlock is already held.

Now we pass PCB pointer if it is known to the pfil hook, this helps to
avoid extra PCB lookup and thus rlock acquiring is not needed.
For inbound packets it is safe to pass NULL, because we do not held any
PCB locks yet.

PR: 220217
MFC after: 3 weeks
Sponsored by: Yandex LLC

6 years agoAdd myself to calendar
Stanislav Galabov [Mon, 31 Jul 2017 09:46:48 +0000 (09:46 +0000)]
Add myself to calendar

Reminded by: mckusick

6 years agoAdd myself.
Eugene Grosbein [Mon, 31 Jul 2017 09:18:53 +0000 (09:18 +0000)]
Add myself.

Reminded by:    mckusick
Approved by: vsevolod (mentor)

6 years agoRemove cycle_t type from the LinuxKPI similar to Linux upstream.
Hans Petter Selasky [Mon, 31 Jul 2017 09:17:54 +0000 (09:17 +0000)]
Remove cycle_t type from the LinuxKPI similar to Linux upstream.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoFix broken usage of the mlx4_read_clock() function:
Hans Petter Selasky [Mon, 31 Jul 2017 09:15:15 +0000 (09:15 +0000)]
Fix broken usage of the mlx4_read_clock() function:
 - return value has too small width
 - cycle_t is unsigned and cannot be less than zero

Sponsored by: Mellanox Technologies
MFC after: 1 week

6 years agoAdd myself to calendar
Kristof Provost [Mon, 31 Jul 2017 09:13:18 +0000 (09:13 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agoAdd my birthday entry to the calendar file.
Nick Hibma [Mon, 31 Jul 2017 08:16:12 +0000 (08:16 +0000)]
Add my birthday entry to the calendar file.

6 years agoAdd myself
Romain Tartière [Mon, 31 Jul 2017 08:11:58 +0000 (08:11 +0000)]
Add myself

Reminded by: mckusick

6 years agoAdd myself to calendar
Toomas Soome [Mon, 31 Jul 2017 08:11:05 +0000 (08:11 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agoAdd my birthday.
Ruslan Bukin [Mon, 31 Jul 2017 08:10:02 +0000 (08:10 +0000)]
Add my birthday.

6 years agoAdd myself to calendar
Emmanuel Vadot [Mon, 31 Jul 2017 07:58:29 +0000 (07:58 +0000)]
Add myself to calendar

Reminded by:  mckusick

6 years agocalendar: Add myself.
Sepherosa Ziehau [Mon, 31 Jul 2017 07:48:08 +0000 (07:48 +0000)]
calendar: Add myself.

Reminded by: mckusick

6 years agohyperv: Add VF bringup scripts and devd rules.
Sepherosa Ziehau [Mon, 31 Jul 2017 07:18:15 +0000 (07:18 +0000)]
hyperv: Add VF bringup scripts and devd rules.

How network VF works with hn(4) on Hyper-V in non-transparent mode:

- Each network VF has a cooresponding hn(4).
- The network VF and the it's cooresponding hn(4) have the same hardware
  address.
- Once the network VF is up, e.g. ifconfig VF up:
  o  All of the transmission should go through the network VF.
  o  Most of the reception goes through the network VF.
  o  Small amount of reception may go through the cooresponding hn(4).
     This reception will happen, even if the the cooresponding hn(4) is
     down.  The cooresponding hn(4) will change the reception interface
     to the network VF, so that network layer and application layer will
     be tricked into thinking that these packets were received by the
     network VF.
  o  The cooresponding hn(4) pretends the physical link is down.
- Once the network VF is down or detached:
  o  All of the transmission should go through the cooresponding hn(4).
  o  All of the reception goes through the cooresponding hn(4).
  o  The cooresponding hn(4) fallbacks to the original physical link
     detection logic.

All these features are mainly used to help live migration, during which
the network VF will be detached, while the network communication to the
VM must not be cut off.  In order to reach this level of live migration
transparency, we use failover mode lagg(4) with the network VF and the
cooresponding hn(4) attached to it.

To ease user configuration for both network VF and non-network VF, the
lagg(4) will be created by the following rules, and the configuration
of the cooresponding hn(4) will be applied to the lagg(4) automatically.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D11635

6 years agoRemove now-unused variable.
Ian Lepore [Mon, 31 Jul 2017 03:19:16 +0000 (03:19 +0000)]
Remove now-unused variable.

6 years agoUse the new clock_schedule() to arrange for clock_settime() to be called
Ian Lepore [Mon, 31 Jul 2017 01:36:51 +0000 (01:36 +0000)]
Use the new clock_schedule() to arrange for clock_settime() to be called
at the right time to keep the RTC hardware time in sync, instead of using
pause_sbt() to sleep until the right time.

6 years agoAdd clock_schedule(), a feature that allows realtime clock drivers to
Ian Lepore [Mon, 31 Jul 2017 01:18:21 +0000 (01:18 +0000)]
Add clock_schedule(), a feature that allows realtime clock drivers to
request that their clock_settime() methods be called at a given offset
from top-of-second.  This adds a timeout_task to the rtc_instance so that
each clock can be separately added to taskqueue_thread with the scheduling
it prefers, instead of looping through all the clocks at once with a
single task on taskqueue_thread.  If a driver doesn't call clock_schedule()
the default is the old behavior: clock_settime() is queued immediately.

The motivation behind this is that I was on the path of adding identical
code to a third RTC driver to figure out a delta to top-of-second and
sleep for that amount of time because writing the the RTC registers resets
the hardware's concept of top-of-second.  (Sometimes it's not top-of-second,
some RTC clocks tick over a half second after you set their time registers.)
Worst-case would be to sleep for almost a full second, which is a rude thing
to do on a shared task queue thread.

6 years agoCorrect the predicates on which lockstat:::{thread,spin}-spin fire.
Mark Johnston [Mon, 31 Jul 2017 00:59:28 +0000 (00:59 +0000)]
Correct the predicates on which lockstat:::{thread,spin}-spin fire.

In particular, they should fire only if the lock was owned by another
thread when we first attempted to acquire that lock.

MFC after: 1 week

6 years agoAdd taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
Ian Lepore [Mon, 31 Jul 2017 00:54:50 +0000 (00:54 +0000)]
Add taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
over the scheduling precision than 'ticks' can offer, and because sometimes
you're already working with sbintime_t units and it's dumb to convert them
to ticks just so they can get converted back to sbintime_t under the hood.

6 years ago Don't re-parse PCI IDs in order to set card-specific flags, use
Scott Long [Mon, 31 Jul 2017 00:05:49 +0000 (00:05 +0000)]
Don't re-parse PCI IDs in order to set card-specific flags, use
    the flags field in the PCIID table.

6 years agortwn(4): refresh manpage
Andriy Voskoboinyk [Mon, 31 Jul 2017 00:03:42 +0000 (00:03 +0000)]
rtwn(4): refresh manpage

- Remove 'if_rtwn_load="YES"' line from loader.conf; the module was
renamed in r319733 + it will be loaded automatically as a dependency.
- Move new sentence to new line.
- Add short description for dev.rtwn.%d.rx_buf_size tunable.

6 years agortwn_usb: add support for fragmented Rx.
Andriy Voskoboinyk [Sun, 30 Jul 2017 23:35:21 +0000 (23:35 +0000)]
rtwn_usb: add support for fragmented Rx.

Since device can pass multiple frames in a single payload temporary
Rx buffer was big enough to hold all of them; now the driver can
concatenate a single frame from multiple payloads.

The Rx buffer size may be configured via tunable (dev.rtwn.%d.rx_buf_size).

Tested with:
 - rtl8188cus, rtl8188eu and rtl8821au (STA mode).
 - (by kevlo) rtl8192cu and rtl8188eu.

PR: 218527
Reviewed by: kevlo
Differential Revision: https://reviews.freebsd.org/D11705

6 years agobsdinstall: default to UEFI-only boot on arm64
Ed Maste [Sun, 30 Jul 2017 23:15:30 +0000 (23:15 +0000)]
bsdinstall: default to UEFI-only boot on arm64

Reviewed by: allanjude
Sponsored by: The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D11721

6 years agoChange from using underbar function names to normal function names for
Scott Long [Sun, 30 Jul 2017 22:34:24 +0000 (22:34 +0000)]
Change from using underbar function names to normal function names for
the informational print functions.  Collapse the debug API a bit to be
more generic and not require as much code duplication.  While here, fix
a bug in MPS that was already fixed in MPR.

6 years agozyd: code cleanup + drop unneeded cast.
Andriy Voskoboinyk [Sun, 30 Jul 2017 22:17:08 +0000 (22:17 +0000)]
zyd: code cleanup + drop unneeded cast.

No functional change intended.

6 years agoRemove unused symbols.
Konstantin Belousov [Sun, 30 Jul 2017 21:52:22 +0000 (21:52 +0000)]
Remove unused symbols.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agortwn: drop unnecessary / wrong conversion.
Andriy Voskoboinyk [Sun, 30 Jul 2017 21:50:45 +0000 (21:50 +0000)]
rtwn: drop unnecessary / wrong conversion.

The 'chan' field occupies only one byte.

6 years agoAvoid using [LINUX_]SHAREDPAGE constant directly in the vdso code.
Dmitry Chagin [Sun, 30 Jul 2017 21:24:20 +0000 (21:24 +0000)]
Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code.
This is needed for https://reviews.freebsd.org/D11780.

Reported by: kib@

6 years agoFix AM/PM mode handling. The bits to mask off in the hours register changes
Ian Lepore [Sun, 30 Jul 2017 19:58:31 +0000 (19:58 +0000)]
Fix AM/PM mode handling.  The bits to mask off in the hours register changes
between 12/24 hour mode.  Also fix conversion between 12 and 24 hour mode.
It's not as easy as adding/subtracting 12, because the clock doesn't roll
over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode.

6 years agoBugfixes and enhancements...
Ian Lepore [Sun, 30 Jul 2017 18:46:38 +0000 (18:46 +0000)]
Bugfixes and enhancements...

Don't enable the oscillator when it is found to be stopped at init time,
just let the first setting of valid time start it.  But still report a dead
battery if it's stopped at init time.

Don't force the chip into 24hr mode, just cope with whatever mode it is
already in.

Align the RTC clock to top of second when setting it.

6 years agoUpgrade our copies of clang, llvm, lld and lldb to r309439 from the
Dimitry Andric [Sun, 30 Jul 2017 18:01:34 +0000 (18:01 +0000)]
Upgrade our copies of clang, llvm, lld and lldb to r309439 from the
upstream release_50 branch.  This is just after upstream's 5.0.0-rc1.

MFC after: 2 months
X-MFC-with: r321369

6 years agoProperly range check length of parsed information elements in RSU driver.
Hans Petter Selasky [Sun, 30 Jul 2017 16:45:28 +0000 (16:45 +0000)]
Properly range check length of parsed information elements in RSU driver.

Found by: Ilja van Sprundel <ivansprundel@ioactive.com>
MFC after: 3 days
Sponsored by: Mellanox Technologies

6 years agoSwitch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
Ian Lepore [Sun, 30 Jul 2017 16:17:06 +0000 (16:17 +0000)]
Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
that transfers will be done with proper ownership of the bus. No
behavioral changes.

6 years agoAttach ichwd(4) only to ISA bus of the LPC bridge.
Alexander Motin [Sun, 30 Jul 2017 15:19:07 +0000 (15:19 +0000)]
Attach ichwd(4) only to ISA bus of the LPC bridge.

Resource allocation for parent device does not look good by itself, but
attempt to allocate them for unrelated device just does not end up good.
On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI
this reported to cause kernel panic on shutdown due to messed resources:
https://bugs.freenas.org/issues/25237.

MFC after: 1 week

6 years agoPull in r309503 from upstream clang trunk (by Richard Smith):
Dimitry Andric [Sun, 30 Jul 2017 11:50:16 +0000 (11:50 +0000)]
Pull in r309503 from upstream clang trunk (by Richard Smith):

  PR33902: Invalidate line number cache when adding more text to
  existing buffer.

  This led to crashes as the line number cache would report a bogus
  line number for a line of code, and we'd try to find a nonexistent
  column within the line when printing diagnostics.

This fixes an assertion when building the graphics/champlain port.

Reported by: antoine, kwm
PR: 219139

6 years ago Split the interrupt setup code into two parts: allocation and configuration.
Scott Long [Sun, 30 Jul 2017 06:53:58 +0000 (06:53 +0000)]
Split the interrupt setup code into two parts: allocation and configuration.
    Do the allocation before requesting the IOCFacts message.  This triggers
    the LSI firmware to recognize the multiqueue should be enabled if available.
    Multiqueue isn't used by the driver yet, but this also fixes a problem with
    the cached IOCFacts not matching latter checks, leading to potential problems
    with error recovery.

    As a side-effect, fetch the driver tunables as early as possible.

Reviewed by: slm
Obtained from: Netflix
Differential Revision: D9243

6 years agoBump copyright year.
Xin LI [Sun, 30 Jul 2017 06:27:32 +0000 (06:27 +0000)]
Bump copyright year.

MFC after: 3 days

6 years agoAdd the i2c RTC drivers found on various arm systems.
Ian Lepore [Sun, 30 Jul 2017 00:25:29 +0000 (00:25 +0000)]
Add the i2c RTC drivers found on various arm systems.

6 years agoMove the device descriptions onto the device lines, so they cut and paste
Ian Lepore [Sun, 30 Jul 2017 00:24:15 +0000 (00:24 +0000)]
Move the device descriptions onto the device lines, so they cut and paste
nicely into other config files.

6 years agoAdd a few missing i2c devices that build fine on all arches.
Ian Lepore [Sun, 30 Jul 2017 00:01:31 +0000 (00:01 +0000)]
Add a few missing i2c devices that build fine on all arches.

6 years agoFix building this driver on non-FDT platforms.
Ian Lepore [Sun, 30 Jul 2017 00:00:30 +0000 (00:00 +0000)]
Fix building this driver on non-FDT platforms.

6 years agoReplace the pcf8563 i2c RTC driver with a new nxprtc driver which handles
Ian Lepore [Sat, 29 Jul 2017 23:45:57 +0000 (23:45 +0000)]
Replace the pcf8563 i2c RTC driver with a new nxprtc driver which handles
all the chips in the NXP PCA212x and PCA/PCF85xx series.  In addition to
supporting more chips, this driver uses the countdown timer on the chips as
a fractional seconds counter, giving it a resolution of about 15 milliseconds.

6 years agokldstat: Use sizeof in place of named constants for sizing
Conrad Meyer [Sat, 29 Jul 2017 23:31:21 +0000 (23:31 +0000)]
kldstat: Use sizeof in place of named constants for sizing

No functional change.

This is handy for FreeBSD derivatives that want to modify the value of
MAXPATHLEN, but not the kld_file_stat ABI.

Submitted by: Siddhant Agarwal <sagarwal AT isilon.com>
Sponsored by: Dell EMC Isilon

6 years agolibprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)
Enji Cooper [Sat, 29 Jul 2017 22:25:45 +0000 (22:25 +0000)]
libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

Neither libcall takes a fourth argument (`char *errbuf`).

PR: 217884
Submitted by: tobik
MFC after: 1 month

6 years agolibprocstat(3): fix reference (typo) to procstat_freeenvv in description for
Enji Cooper [Sat, 29 Jul 2017 22:19:00 +0000 (22:19 +0000)]
libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
procstat_getargv(3)

PR: 217884
MFC after: 1 month
Submitted by: tobik

6 years agoAdd sys/socket.h to SYNOPSIS for libprocstat(3)
Enji Cooper [Sat, 29 Jul 2017 22:16:05 +0000 (22:16 +0000)]
Add sys/socket.h to SYNOPSIS for libprocstat(3)

sys/socket.h is required for procstat_get_socket_info(3), added in
r221807.

MFC after: 1 month
PR: 217884
Submitted by: tobik

6 years agoRemove superfluous `exit 0` added in r321702
Enji Cooper [Sat, 29 Jul 2017 22:03:21 +0000 (22:03 +0000)]
Remove superfluous `exit 0` added in r321702

atf_skip triggers equivalent functionality, which means the `exit 0`
is unreachable code.

PR: 220164
MFC after: 1 month
MFC with: r321702