]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r314592: Fix JSON output.
mav [Fri, 10 Mar 2017 06:17:54 +0000 (06:17 +0000)]
MFC r314592: Fix JSON output.

7 years agoMFC r314614:
ae [Fri, 10 Mar 2017 05:44:14 +0000 (05:44 +0000)]
MFC r314614:
  Fix matching table entry value. Use real table value instead of its index
  in valuestate array.

  When opcode has size equal to ipfw_insn_u32, this means that it should
  additionally match value specified in d[0] with table entry value.
  ipfw_table_lookup() returns table value index, use TARG_VAL() macro to
  convert it to its value. The actual 32-bit value stored in the tag field
  of table_value structure, where all unspecified u32 values are kept.

  PR: 217262

7 years agoMFC r314145, r314158
pfg [Thu, 9 Mar 2017 02:58:02 +0000 (02:58 +0000)]
MFC r314145, r314158
vxge(4): double assignments.

Fix some suspicious code, likely caused by excessive copy-pasting.

Found with: coccinelle (da.cocci)

7 years agoMFC r314505:
pfg [Wed, 8 Mar 2017 22:38:40 +0000 (22:38 +0000)]
MFC r314505:
Split the ficl CFLAGS when they refer to an arch-specific include path.

This is a minimal attempt to keep consistency in the Makefiles so that
moving ficl to somwehere like contrib will be less error prone.

7 years agoMFC r314219
mmokhi [Wed, 8 Mar 2017 13:09:12 +0000 (13:09 +0000)]
MFC r314219
Add linux_preadv() and linux_pwritev() syscalls to Linuxulator.

Approved by: dchagin

7 years agoMFC r314497:
ae [Wed, 8 Mar 2017 07:59:45 +0000 (07:59 +0000)]
MFC r314497:
  Do not invoke the resize event when previous provider's size was zero.
  This is similar to r303637 fix for geom_disk.

7 years agoMFC r314061:
dim [Wed, 8 Mar 2017 07:58:29 +0000 (07:58 +0000)]
MFC r314061:

Add __int128-related symbols to libcxxrt's version map.  Put these into
the same CXXABI verions as recent libstdc++.

Note that __int128 types are only available on arches where long long is
128 bit wide.

Noticed by: harti

MFC r314104:

Surround any unmangled C++ names in libcxxrt's version map with 'extern
"C++"', otherwise ld refuses to make the symbols global in the final
library.  This causes the __int128-related symbols to go missing when
the library is stripped during installation.

Helpful hints: emaste

7 years agoPull in r291403 from upstream clang trunk (by Richard Smith):
dim [Tue, 7 Mar 2017 21:44:05 +0000 (21:44 +0000)]
Pull in r291403 from upstream clang trunk (by Richard Smith):

  PR30305: Implement proposed DR resolution to prevent slicing via
  inherited constructor.

  The rule we use is that a construction of a class type T from an
  argument of type U cannot use an inherited constructor if U is the
  same as T or is derived from T (or if the initialization would first
  convert it to such a type). This (approximately) matches the rule in
  use by GCC, and matches the current proposed DR resolution.

Pull in r291955 from upstream clang trunk (by Richard Smith):

  PR31606: Generalize our tentative DR resolution for inheriting
  copy/move constructors to better match the pre-P0136R1 behavior.

Together, these fix an issue with C++ using declarations sometimes
enabling illegal implicit casts.

Direct commit to stable/11, since head already has clang 4.0.0, which
includes this change.

Reported by: kami
PR: 215969

7 years agoMFC 313879
jpaetzel [Tue, 7 Mar 2017 18:27:35 +0000 (18:27 +0000)]
MFC 313879

MVF: 313876

7504 kmem_reap hangs spa_sync and administrative tasks

illumos/illumos-gate@405a5a0f5c3ab36cb76559467d1a62ba648bd809
https://github.com/illumos/illumos-gate/commit/405a5a0f5c3ab36cb76559467d1a62ba648bd80

https://www.illumos.org/issues/7504

  We see long spa_sync(). We are waiting to hold dp_config_rwlock for writer. Some
  other thread holds dp_config_rwlock for reader, then calls arc_get_data_buf(),
  which finds that arc_is_overflowing()==B_TRUE. So it waits (while holding
  dp_config_rwlock for reader) for arc_reclaim_thread to signal arc_reclaim_waiters_cv.
  Before signaling, arc_reclaim_thread does arc_kmem_reap_now(), which takes ~seconds.

Author: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

7 years agoMFC r314058: zfs: lower priority of zio_write_issue threads by four
avg [Tue, 7 Mar 2017 15:27:40 +0000 (15:27 +0000)]
MFC r314058: zfs: lower priority of zio_write_issue threads by four

Obtained from: Panzura
Sponsored by: Panzura

7 years agoMFC r314429:
kib [Tue, 7 Mar 2017 12:16:47 +0000 (12:16 +0000)]
MFC r314429:
Initialize pcb_save for thread0.

7 years agoMFC r314374: Add safety check against too long CDB.
mav [Tue, 7 Mar 2017 05:56:48 +0000 (05:56 +0000)]
MFC r314374: Add safety check against too long CDB.

SBP-2 specification defined maximum CDB length as 12 bytes.  Newer SBP-3
specification allows CDB of any size, but this driver is too old.  Proper
solution would be to look on maximal ORB size supported by the target.

7 years agoMFC r314627:
cy [Tue, 7 Mar 2017 05:35:14 +0000 (05:35 +0000)]
MFC r314627:

Fix leak (free str before returning when ctx's calloc fails).

Submitted by: trix_juniper.net (Tom Rix)
Reviewed by: cy, ngie
Discovered by: clang's static analyzer
Differential Revision: D9877

7 years agoMFC r314430:
ae [Tue, 7 Mar 2017 03:01:09 +0000 (03:01 +0000)]
MFC r314430:
  When IPv6 fragments reassembly is complete, update mbuf's csum_data
  and csum_flags using information from all fragments. This fixes
  dropping of reassembled packets due to wrong checksum when the IPv6
  checksum offloading is enabled on a network card.

7 years agoMFC r314242:
ngie [Tue, 7 Mar 2017 02:16:40 +0000 (02:16 +0000)]
MFC r314242:

Remove MK_CRYPT stub

It doesn't directly control what gets installed today; it indirectly
pulls other knobs (like MK_KERBEROS, etc).

7 years agoMFC r314226:
ngie [Tue, 7 Mar 2017 02:02:23 +0000 (02:02 +0000)]
MFC r314226:

Use SRCTOP instead of .CURDIR relative paths with ".."

This simplifies pathing in make/displayed output

7 years agoMFC r313009:
ngie [Tue, 7 Mar 2017 02:01:02 +0000 (02:01 +0000)]
MFC r313009:

Expose symbols in lib/libclang_rt/profile to fix --coverage

The symbols currently hidden in libprofile_rt are needed for linking with
`clang --coverage` to add coverage counters at link time and produce
coverage numbers at runtime.

In collaboration with: dim

7 years agoMFC r313438:
ngie [Tue, 7 Mar 2017 01:58:39 +0000 (01:58 +0000)]
MFC r313438:

Clean up trailing and leading whitespace for variables to make it
consistent with the rest of the file and style.Makefile(9) a bit
more

7 years agoMFC r313439,r314450:
ngie [Tue, 7 Mar 2017 01:52:56 +0000 (01:52 +0000)]
MFC r313439,r314450:

r313439:

Merge content from ^/projects/netbsd-tests-upstream-01-2017 into ^/head

The primary end-goal of this drop is ease future merges with NetBSD and
collaborate further with the NetBSD project.

The goal was (largely, not completely as some items are still oustanding
in the NetBSD GNATS system) achieved by doing the following:
- Pushing as many changes required to port contrib/netbsd-tests
  back to NetBSD as possible, then pull the upstream applied changes
  back in to FreeBSD.
- Diff reduce with upstream where possible by:
-- Improving libnetbsd header, etc compat glue.
-- Using _SED variables to modify test scripts on the fly for items
   that could not be upstreamed to NetBSD.

As a bonus for this work, this change also introduces testcases for
uniq(1).

Many thanks to Christos for working with me to get many of the changes
back into the NetBSD project.

In collaboration with: Christos Zoulas <christos@netbsd.org>

r314450:

Add additional __FreeBSD_version guards around the hsearch_r testcases

The reasoning for this is the same as r276046: to ease MFCing the tests
to ^/stable/10 .

This was accidentally missed in r313439

7 years agoMFC r314062
davidcs [Mon, 6 Mar 2017 20:25:33 +0000 (20:25 +0000)]
MFC r314062
add bus_dmamap_unload in ql_free_dmabuf()

7 years agoMFC r314509 and r314578.
np [Mon, 6 Mar 2017 15:14:59 +0000 (15:14 +0000)]
MFC r314509 and r314578.

r314509:
cxgbe/iw_cxgbe: Do not check the size of the memory region being
registered.  T4/5/6 have no internal limit on this size.  This is
probably a copy paste from the T3 iw_cxgb driver.

r314578:
cxgbe/iw_cxgbe: Implement sq/rq drain operation.

ULPs can set a qp's state to ERROR and then post a work request on the
sq and/or rq.  When the reply for that work request comes back it is
guaranteed that all previous work requests posted on that queue have
been drained.

Sponsored by: Chelsio Communications

7 years agoMFC r314338: Polish handling of different reset flavours.
mav [Mon, 6 Mar 2017 06:46:21 +0000 (06:46 +0000)]
MFC r314338: Polish handling of different reset flavours.

The biggest change is that ctl_remove_initiator() now generates I_T NEXUS
LOSS event, cleaning part of LUs state related to the initiator.

7 years agoMFC r314326: Send TERMINATE to firmware when aborting active ATIO.
mav [Mon, 6 Mar 2017 06:45:00 +0000 (06:45 +0000)]
MFC r314326: Send TERMINATE to firmware when aborting active ATIO.

7 years agoMFC r314496: Add check missed in r314257.
mav [Mon, 6 Mar 2017 06:42:47 +0000 (06:42 +0000)]
MFC r314496: Add check missed in r314257.

7 years agoMFC r314387: Make ctl_queue_sense() not sleep.
mav [Mon, 6 Mar 2017 06:40:33 +0000 (06:40 +0000)]
MFC r314387: Make ctl_queue_sense() not sleep.

It may be called in non-sleepable frontend context.

7 years agoMFC r314302: Return better error code in case of too long CDB.
mav [Mon, 6 Mar 2017 06:39:10 +0000 (06:39 +0000)]
MFC r314302: Return better error code in case of too long CDB.

Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.

7 years agoMFC r314299, r314300: Fix residual length reporting in target mode.
mav [Mon, 6 Mar 2017 06:37:44 +0000 (06:37 +0000)]
MFC r314299, r314300: Fix residual length reporting in target mode.

This allows to properly handle cases when target wants to receive or send
more data then initiator wants to send or receive.  Previously in such
cases isp(4) returned CAM_DATA_RUN_ERR, while now it returns resid > 0.

7 years agoMFC r314257: Add reporting SAS protocol, in case we ever have one.
mav [Mon, 6 Mar 2017 06:36:15 +0000 (06:36 +0000)]
MFC r314257: Add reporting SAS protocol, in case we ever have one.

7 years agoMFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.
mav [Mon, 6 Mar 2017 06:35:02 +0000 (06:35 +0000)]
MFC r314255: Reenable CTL_WITH_CA, optimizing it for lower memory usage.

This code was disabled due to its high memory usage.  But now we need this
functionality for cfumass(4) frontend, since USB MS BBB transport does not
support autosense.

7 years agoMFC r314247: Axe out some forever disabled questionable functionality.
mav [Mon, 6 Mar 2017 06:32:50 +0000 (06:32 +0000)]
MFC r314247: Axe out some forever disabled questionable functionality.

This code is complicated enough even in its base shape.

7 years agoMFC r314246: Improve CAM target frontend reference counting.
mav [Mon, 6 Mar 2017 06:31:42 +0000 (06:31 +0000)]
MFC r314246: Improve CAM target frontend reference counting.

Before this change it was possible to trigger some use-after-free panics
by disabling LUNs/ports under heavy load.

7 years agoMFC r314208: Respecting r314204 tighten ATIO cleanup requirements.
mav [Mon, 6 Mar 2017 06:30:27 +0000 (06:30 +0000)]
MFC r314208: Respecting r314204 tighten ATIO cleanup requirements.

Every ATIO must complete with either successfully sent status or XPT_ABORT.

7 years agoMFC r314204: Explicitly abort ATIO if CTIO sending status has failed.
mav [Mon, 6 Mar 2017 06:29:10 +0000 (06:29 +0000)]
MFC r314204: Explicitly abort ATIO if CTIO sending status has failed.

This helps SIM to free related resources in questionable cases.

7 years agoMFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.
mav [Mon, 6 Mar 2017 06:27:59 +0000 (06:27 +0000)]
MFC r314203: Fix missing xpt_done() for ATIO/INOT on missing LUN.

7 years agoMFC r314200: We can't access periph after ctlfe_free_ccb().
mav [Mon, 6 Mar 2017 06:27:15 +0000 (06:27 +0000)]
MFC r314200: We can't access periph after ctlfe_free_ccb().

7 years agoMFC r314196: Unify ATIO/INOT CCBs requeuing.
mav [Mon, 6 Mar 2017 06:25:33 +0000 (06:25 +0000)]
MFC r314196: Unify ATIO/INOT CCBs requeuing.

7 years agoMFC r314193: Some code cleanup.
mav [Mon, 6 Mar 2017 06:24:24 +0000 (06:24 +0000)]
MFC r314193: Some code cleanup.

7 years agoMFC r314088: Slightly polish isp_dump_atpd().
mav [Mon, 6 Mar 2017 06:23:17 +0000 (06:23 +0000)]
MFC r314088: Slightly polish isp_dump_atpd().

7 years agoMFC r314086: Fix multiple problems around LUN disable under load.
mav [Mon, 6 Mar 2017 06:22:07 +0000 (06:22 +0000)]
MFC r314086: Fix multiple problems around LUN disable under load.

 - Move private data about ATIOs/INOTs from per-LUN to per-channel data.
This allows active commands to continue operation after LUN destruction.
This also simplifies lookup of the data by tag in some situations.
 - Unify three restart_queue processing implementations.
 - Complete all ATIOs from restart_queue on LUN disable.
 - Delete ATIO private data when command completed or aborted, not depending
on the ATIO being requeued, that was ugly hack and could never happen.  CAM
should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT.
 - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful
shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4).
 - Unify isp_endcmd() arguments to make it more usable in generic code.
 - Remove never really used LUN state reference counter.

7 years agoMFC r314045: Remove duplicate INOT allocation.
mav [Mon, 6 Mar 2017 06:20:58 +0000 (06:20 +0000)]
MFC r314045: Remove duplicate INOT allocation.

For some reason isp_handle_platform_notify_fc() allocated INOT just
before calling isp_handle_platform_target_tmf(), which also allocates
INOT.  It seems to be a braino introduced in r196008.

7 years agoMFC r314038: Remove ancient __FreeBSD_version checks.
mav [Mon, 6 Mar 2017 06:19:42 +0000 (06:19 +0000)]
MFC r314038: Remove ancient __FreeBSD_version checks.

7 years agoMFC r314027: Do not blindly free completed ATIOs/INOTs on invalidation.
mav [Mon, 6 Mar 2017 06:18:30 +0000 (06:18 +0000)]
MFC r314027: Do not blindly free completed ATIOs/INOTs on invalidation.

When LUN is disabled, SIM starts returning queued ATIOs/INOTs.  But at the
same time there can be some ATIOs/INOTs still carrying real new requests.
If we free those, SIM may leak some resources, forever expecting for any
response from us.  So try to be careful, separating ATIOs/INOTs carrying
requests which still must be processed, from ATIOs/INOTs completed with
errors which can be freed.

7 years agoMFC r314358: Announce that sbp_targ(4) does not support initiator mode.
mav [Mon, 6 Mar 2017 06:08:17 +0000 (06:08 +0000)]
MFC r314358: Announce that sbp_targ(4) does not support initiator mode.

7 years agoMFC r313733:
badger [Mon, 6 Mar 2017 01:11:34 +0000 (01:11 +0000)]
MFC r313733:

sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Approved by: kib (mentor)
Sponsored by: Dell EMC

7 years agoMFC r314572:
mm [Sun, 5 Mar 2017 21:41:48 +0000 (21:41 +0000)]
MFC r314572:

Fix null pointer dereference in zfs_freebsd_setacl().

Prevents unprivileged users from panicking the kernel by calling
__acl_delete_*() on files or directories inside a ZFS mount.

7 years agopf: Fix a crash in low-memory situations
kp [Sun, 5 Mar 2017 13:14:18 +0000 (13:14 +0000)]
pf: Fix a crash in low-memory situations

If the call to pf_state_key_clone() in pf_get_translation() fails (i.e. there's
no more memory for it) it frees skp. This is wrong, because skp is a
pf_state_key **, so we need to free *skp, as is done later in the function.
Getting it wrong means we try to free a stack variable of the calling
pf_test_rule() function, and we panic.

7 years agoMFC r313936, r313937: Move CTIO waitq from per-LUN to per-channel.
mav [Sun, 5 Mar 2017 05:17:02 +0000 (05:17 +0000)]
MFC r313936, r313937: Move CTIO waitq from per-LUN to per-channel.

All resources lack of which may put CTIO into the queue are either
per-channel or potentially per-queue, but none of them are per-LUN.

This is a first step to fix live LUN disabling.  Before this change
any CTIOs held in a queue in time of disabling were just leaked.

7 years agoMFC r313945: Remove broken remnants of obsolete INOT API.
mav [Sun, 5 Mar 2017 05:15:02 +0000 (05:15 +0000)]
MFC r313945: Remove broken remnants of obsolete INOT API.

7 years agoMFC r314562:
kib [Sun, 5 Mar 2017 00:34:12 +0000 (00:34 +0000)]
MFC r314562:
Style.

7 years agoMFC r313909:
bdrewery [Sat, 4 Mar 2017 18:07:30 +0000 (18:07 +0000)]
MFC r313909:

  Fix panic with unlocked vnode to vrecycle().

7 years agoMFC r314273: zfs: call spa_deadman on a taskqueue thread
avg [Sat, 4 Mar 2017 12:42:52 +0000 (12:42 +0000)]
MFC r314273: zfs: call spa_deadman on a taskqueue thread

7 years agoMFC r314272: call vm_lowmem hook in uma_reclaim_worker
avg [Sat, 4 Mar 2017 12:05:46 +0000 (12:05 +0000)]
MFC r314272: call vm_lowmem hook in uma_reclaim_worker

7 years agoMFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM
avg [Sat, 4 Mar 2017 12:04:19 +0000 (12:04 +0000)]
MFC r314357: edge-triggered interrupt mode is set by clearing APIC_LVT_TM

7 years agoMFC r314490:
kib [Sat, 4 Mar 2017 00:33:41 +0000 (00:33 +0000)]
MFC r314490:
Add some explanation for SV_TIMEKEEP flag.

7 years agoMFC r313907:
bdrewery [Fri, 3 Mar 2017 21:46:30 +0000 (21:46 +0000)]
MFC r313907:

  xdev: Fix after libc++ update in r300873.

7 years agoMFC r309626,r309627,r309659:
bdrewery [Fri, 3 Mar 2017 21:43:03 +0000 (21:43 +0000)]
MFC r309626,r309627,r309659:

  r309626:
    strvis(3): Avoid internal state of multibyte functions being tainted.
  r309627:
    Remove unneeded hack fixed by r309626.
  r309659:
    Support spaces in group names.

7 years agoMFC r313905:
bdrewery [Fri, 3 Mar 2017 21:41:26 +0000 (21:41 +0000)]
MFC r313905:

  xdev: Build yacc which is needed for recent libpcap updates.

7 years agoMFC r314001:
bdrewery [Fri, 3 Mar 2017 21:39:36 +0000 (21:39 +0000)]
MFC r314001:

  Make it more clear that -k sends SIGKILL, not the -s signal.

7 years agoMFC r313904:
bdrewery [Fri, 3 Mar 2017 21:38:34 +0000 (21:38 +0000)]
MFC r313904:

  META_MODE+xdev: Don't rebuild build-tools during normal build.

7 years agoMFC r313163:
bdrewery [Fri, 3 Mar 2017 21:37:33 +0000 (21:37 +0000)]
MFC r313163:

  native-xtools: Add missing readelf.

7 years agoMFC r313184:
bdrewery [Fri, 3 Mar 2017 21:35:09 +0000 (21:35 +0000)]
MFC r313184:

  Remove LOCAL_LIB_DIRS warning added in r275839.

7 years agoMFC r314400:
np [Fri, 3 Mar 2017 17:53:22 +0000 (17:53 +0000)]
MFC r314400:

cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets.

Sockets representing the TCP endpoints for iWARP connections are
allocated by the ibcore module.  Before this revision they were closed
either by the ibcore module or the iw_cxgbe hardware driver depending on
the state transitions during connection teardown.  This is error prone
and there were cases where both iw_cxgbe and ibcore closed the socket
leading to double-free panics.  The fix is to let ibcore close the
sockets it creates and never do it in the driver.

- Use sodisconnect instead of soclose (preceded by solinger = 0) in the
  driver to tear down an RDMA connection abruptly.  This does what's
  intended without releasing the socket's fd reference.

- Close the socket in ibcore when the iWARP iw_cm_id is destroyed.  This
  works for all kinds of sockets: clients that initiate connections,
  listeners, and sockets accepted off of listeners.

Sponsored by: Chelsio Communications

7 years agoMFC r314039:
garga [Fri, 3 Mar 2017 12:30:18 +0000 (12:30 +0000)]
MFC r314039:

Fix style(9)

Reviewed by: ngie, tuexen, vangyzen, allanjude
Approved by: allanjude
MFC after: 1 week
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D9588

7 years agoMFC r313898, r313902, r313903, r313934, r314087, r314252:
kib [Fri, 3 Mar 2017 10:30:30 +0000 (10:30 +0000)]
MFC r313898, r313902, r313903, r313934, r314087, r314252:
Merge i386 and amd64 mtrr drivers.

7 years agoMFC r314195:
kib [Fri, 3 Mar 2017 10:02:56 +0000 (10:02 +0000)]
MFC r314195:
Properly handle possible underflow in vm_fault_prefault().

7 years agoMFC r313854, r313963: Change the way MaxCmdSN is used.
mav [Fri, 3 Mar 2017 06:06:27 +0000 (06:06 +0000)]
MFC r313854, r313963: Change the way MaxCmdSN is used.

Before this change MaxCmdSN was reported as CmdSN + delta, that made it
limit number of requests in transmission from the initiator to target,
that was pretty useless.  After this change MaxCmdSN limits number of
requests queued to CTL, i.e. maximal queue depth for the initiator.
The default limit is 256 outstanding requests per initiator at a time.

This code uses existing cs_outstanding_ctl_pdus counter to track queue
depth.  It's semantics doen't perfectly match, but close enough to not
add another counter.  Just don't set the maxtags below 2.

7 years agoMFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN.
mav [Fri, 3 Mar 2017 06:04:03 +0000 (06:04 +0000)]
MFC r313852: Freeze CAM SIM when request is postponed due to MaxCmdSN.

This allows to avoid resource allocation (especially offload) for requests
that can not be executed at this time any way.

7 years agoMFC r313851: Fix tight loop spinning on postponed requests.
mav [Fri, 3 Mar 2017 06:02:27 +0000 (06:02 +0000)]
MFC r313851: Fix tight loop spinning on postponed requests.

7 years agoMFC r314287:
avos [Fri, 3 Mar 2017 00:47:42 +0000 (00:47 +0000)]
MFC r314287:
iwn: stop all watchdogs on device shutdown.

Tested with Intel 6205, STA mode.

7 years agoMFC r312899: add octeon+ as an alias for octeon in GCC & binutils
emaste [Fri, 3 Mar 2017 00:39:29 +0000 (00:39 +0000)]
MFC r312899: add octeon+ as an alias for octeon in GCC & binutils

r208737 added support for the "mips64r2" architecture and "octeon" CPU,
and the saa/saad instructions.

Upstream binutils also added the "octeon+" CPU, and the saa/saad
instructions are only available in octeon+, not octeon.  Since our
base system tool chain already accepts saa/saad with -march=octeon,
just allow octeon+ as an alias.

This allows the use of octeon+ in kernel config files, for use with both
external tool chain and in-tree GCC/binutils.

Also includes GCC FBSD_CC_VER bump (r313041 in HEAD)

PR: 216516
Sponsored by: The FreeBSD Foundation

7 years agoMFC r314535:
gonzo [Thu, 2 Mar 2017 22:42:59 +0000 (22:42 +0000)]
MFC r314535:

[intelspi][bytgio] Fix buildworld with MODULES_WITH_WORLD set

Add opt_platform.h and opt_acpi.h to the dependencies so modules can be
built as a part of buildworld when MODULES_WITH_WORLD is set

Reported by: Andre Albsmeier (for 11-stable)

7 years agoMFC r314268: add chromebook_platform.4 to the list of manual pages
avg [Thu, 2 Mar 2017 10:44:57 +0000 (10:44 +0000)]
MFC r314268: add chromebook_platform.4 to the list of manual pages

7 years agoMFC r314271: chromebook_platform: catch up with ig4iic -> ig4iic_pci in r310621
avg [Thu, 2 Mar 2017 10:43:42 +0000 (10:43 +0000)]
MFC r314271: chromebook_platform: catch up with ig4iic -> ig4iic_pci in r310621

It was MFC-ed as r311809.

7 years agoMFC r312679:
ian [Thu, 2 Mar 2017 04:55:54 +0000 (04:55 +0000)]
MFC r312679:

  Handle imx6 erratum ERR004346... to reboot, clear the SRS bit twice within
  the same cycle of the 32khz clock.

  I've never actually noticed this error happening, but it's an easy fix.

7 years agoMFC r313287:
ian [Thu, 2 Mar 2017 04:42:33 +0000 (04:42 +0000)]
MFC r313287:

  Add tsw_busy support to usb_serial (ucom).

  The tty layer uses tsw_busy to poll for busy/idle status of the transmitter
  hardware during close() and tcdrain(). The ucom layer defines ULSR_TXRDY and
  ULSR_TSRE bits for the line status register; when both are set, the
  transmitter is idle. Not all chip drivers maintain those bits in the sc_lsr
  field, and if the bits never get set the transmitter will always appear
  busy, causing hangs in tcdrain().

  These changes add a new sc_flag bit, UCOM_FLAG_LSRTXIDLE. When this flag is
  set, ucom_busy() uses the lsr bits to return busy vs. idle state, otherwise
  it always returns idle (which is effectively what happened before this
  change because tsw_busy wasn't implemented).

  For the uftdi chip driver, these changes stop masking out the tx idle bits
  when processing the status register (because now they're useful), and it
  calls ucom_use_lsr_txbits() to indicate the bits are maintained by the
  driver and can be used by ucom_busy().

7 years agoMFC r311954, r311996, r312077, r312080:
ian [Thu, 2 Mar 2017 04:23:53 +0000 (04:23 +0000)]
MFC r311954, r311996, r312077, r312080:

  Rework tty_drain() to poll the hardware for completion, and restore
  drain timeout handling to historical freebsd behavior.

  The primary reason for these changes is the need to have tty_drain() call
  ttydevsw_busy() at some reasonable sub-second rate, to poll hardware that
  doesn't signal an interrupt when the transmit shift register becomes empty
  (which includes virtually all USB serial hardware).  Such hardware hangs
  in a ttyout wait, because it never gets an opportunity to trigger a wakeup
  from the sleep in tty_drain() by calling ttydisc_getc() again, after
  handing the last of the buffered data to the hardware.

  Restructure the tty_drain loop so that device-busy is checked one more time
  after tty_timedwait() returns an error only if the error is EWOULDBLOCK;
  other errors cause an immediate return.  This fixes the case of the tty
  disappearing while in tty_drain().

  Check tty_gone() after allocating IO buffers.  The tty lock has to be
  dropped then reacquired due to using M_WAITOK, which opens a window in
  which the tty device can disappear.  Check for this and return ENXIO
  back up the call chain so that callers can cope.

  Correct the comments about how much buffer is allocated.

7 years agoMFC r314139: make vi message catalogues build independent of locale
emaste [Thu, 2 Mar 2017 01:28:15 +0000 (01:28 +0000)]
MFC r314139: make vi message catalogues build independent of locale

r275234 addressed sort automatically converting 8-bit locales to UTF-8
by using "LANG=C sort", but LC_ALL overrides LANG if set, so the issue
may still be present depending on the user's environment. Use LC_ALL=C
instead.

Reported by: https://tests.reproducible-builds.org/
Sponsored by: The Linux Foundation / Core Infrastructure Initiative

7 years agoMFC r311103, r311907:
ian [Thu, 2 Mar 2017 01:23:17 +0000 (01:23 +0000)]
MFC r311103, r311907:

  Update ntp.conf to use the ntpd pool feature.

  Our previous ntp.conf file configured 3 servers from freebsd.pool.ntp.org
  using 3 separate 'server' config lines.  That is now replaced with a single
  'pool' line which causes ntpd to add multiple servers from the pool.

  More than just making the config smaller, the pool feature in ntpd has one
  major advantage over configuring 3 separate servers from a pool: if a server
  that was added using a 'pool' statement provides bad time (initially or at
  some later date), ntpd automatically discards it and configures a new
  different server from the pool without needing to be restarted.

  These changes also add a 'tos' line to control how many pool servers get
  added, a 'restrict source' line that is required to allow ntpd to add new
  peers from the pool, and it deletes a 'restrict 127.127.1.0' line that does
  nothing and should never have been there (127.127.1.0 is not a valid IP
  address, it's a refclock identifier).

  Add "pool" to the keywords that rc.d/ntpdate examines to
  find a server address in ntp.conf.

7 years agoMFC r312292, r313573:
ian [Thu, 2 Mar 2017 01:18:46 +0000 (01:18 +0000)]
MFC r312292, r313573:

  Stop including sys/types.h from arm's machine/atomic.h, fix the places
  where atomic.h was being included without ensuring that types.h (via
  param.h) was included first, as required by atomic(9).

  Remove arm's cpuconf.h, and references to it, after moving a few lines from
  it into pmap-v4.h where they are used.  Other than those few lines of
  support for different MMU types, nothing in cpuconf.h has been used in our
  code for quite a while.
  The file existed to set up a variety of symbols to describe the
  architecture.  Over the past few years we have converted all of our source
  to use the new architecture symbols standardized by ARM Inc, and predefined
  by both clang and gcc.

7 years agoMFC r312251:
ian [Wed, 1 Mar 2017 23:35:40 +0000 (23:35 +0000)]
MFC r312251:

  Remove a bit of armv6 support that didn't get deleted when this file was
  split from trap.c into trap-v4.c and trap-v6.c.

7 years agoMFC r306901:
ian [Wed, 1 Mar 2017 22:45:12 +0000 (22:45 +0000)]
MFC r306901:

  ARM: Split identify_arm_cpu() into ARMv4 and ARMv6 variant.
  On ARMv6, be more verbose about supported CPU features and/or
  optional instructions.

7 years agoMFC r309195:
ian [Wed, 1 Mar 2017 21:48:15 +0000 (21:48 +0000)]
MFC r309195:

  Add an ethernet0 alias pointing to the /aix/usb/hub/ethernet node.  This
  is required for u-boot to locate the ethernet node when it's doing fixup
  of the mac-address property when the user has overridden the default addr.

7 years agoMFC r302506:
ian [Wed, 1 Mar 2017 21:45:03 +0000 (21:45 +0000)]
MFC r302506:

  Remove HZ=<various> from all armv6 configs, put HZ=1000 in std.armv6.

7 years agoMFC r313919: Add dtb files for Boundary Devices Nitrogen 6 family boards.
ian [Wed, 1 Mar 2017 21:31:44 +0000 (21:31 +0000)]
MFC r313919:  Add dtb files for Boundary Devices Nitrogen 6 family boards.

7 years agoMFC r313918: Add definitions for the IEEE-1588 registers.
ian [Wed, 1 Mar 2017 21:20:28 +0000 (21:20 +0000)]
MFC r313918:  Add definitions for the IEEE-1588 registers.

7 years agoMFC r313917:
ian [Wed, 1 Mar 2017 21:19:46 +0000 (21:19 +0000)]
MFC r313917:

  Change the naming of imx{5,6} gpio pins to exactly match the names used in
  the reference manual.

7 years agoMFC r314064, r314060:
ian [Wed, 1 Mar 2017 21:18:42 +0000 (21:18 +0000)]
MFC r314064, r314060:

  Fix typos in bootverbose printfs... display the write-protect pin info,
  not the card-detect pin info.

  Remove a variable that has been unused since r311735 (it should have been
  removed as part of those changes).

7 years agoMFC r313674:
ian [Wed, 1 Mar 2017 21:12:50 +0000 (21:12 +0000)]
MFC r313674:

  Enable usb low and full speed devices connected to the imx6 root hubs.

7 years agoMFC r312859:
ian [Wed, 1 Mar 2017 21:11:36 +0000 (21:11 +0000)]
MFC r312859:

 Configure the timer capture pin to input mode in the timer control
 register, in addition to configuring it as input with the pinmux driver.

 There was a control register bit commented as "no desc in datasheet".  A
 later revision of the manual reveals the bit to be an input/output control
 for the timer pin.  In addition to configuring capture or pulse mode, you
 apparently have to separately configure the pin direction in the timer
 control register.

 Before this change, the timer block was apparently driving a signal onto a
 pad configured by pinmux as input.  Capture mode still accidentally worked
 for me during testing because I was using a very strong signal source that
 just out-muscled the weaker drive from the misconfigured pin.

7 years agoMFC r311736:
ian [Wed, 1 Mar 2017 21:05:24 +0000 (21:05 +0000)]
MFC r311736:

  Use the new sdhci_fdt_gpio helper functions to add full support for FDT
  gpio pins for detecting card insert/remove and write protect.

7 years agoMFC r308186, r308188, r308231, r308232:
ian [Wed, 1 Mar 2017 21:02:26 +0000 (21:02 +0000)]
MFC r308186, r308188, r308231, r308232:

  Move imx_sdhci driver over to a dev/sdhci in preparation for QorIQ support.
  Freescale uses eSDHC in both i.MX (ARM) and QorIQ (PowerPC), with slight
  differences.  This is part one in unifying the drivers.

  Merge i.MX and PowerPC SDHCI drivers
  Summary:
  i.MX5 and PowerPC use a very similar eSDHC controller, which is also
  similar to the uSDHC controller used by i.MX6.  The imx_sdhci driver works
  almost completely with PowerPC, with some minor tweaks.

  Fix the build.  protctl is only used on powerpc.
  While here, remove the need to check the SVR SPR, as others may be compatible
  with the p1022-esdhc type.

  Since it's no longer accessing a powerpc-specific register, drop the #ifdef.

7 years agoMFC r311734, r311735, r311951, r314071:
ian [Wed, 1 Mar 2017 20:22:25 +0000 (20:22 +0000)]
MFC r311734, r311735, r311951, r314071:

  Add new helper routines for sdhci bridge drivers that use gpio pins for
  card presence and write protect switch detection.

  Use the new sdhci_fdt_gpio helper functions to add full support for FDT
  gpio pins for detecting card insert/remove and write protect for ti_sdhci.

  Include sys/systm.h for use of bootverbose.

  Revert to ti_sdhci driver's historic behavior: assume an sd card is
  writable if the fdt data doesn't provide a gpio pin for reading the write
  protect switch and also doesn't contain a "wp-disable" property.

7 years agoMFC r306262, r306267, r310021: (needed to avoid conflicts on later merges)
ian [Wed, 1 Mar 2017 19:55:04 +0000 (19:55 +0000)]
MFC r306262, r306267, r310021: (needed to avoid conflicts on later merges)

  Remove bus_dma_get_range and bus_dma_get_range_nb on armv6. We only need
  this on a few earlier arm SoCs.

  Restrict where we need to define fdt_fixup_table to just PowerPC and
  Marvell.

  Add the missing void to function signatures in much of the arm code.

7 years agoMFC r308640:
ian [Wed, 1 Mar 2017 18:53:05 +0000 (18:53 +0000)]
MFC r308640:

  Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read
  integer data from the device tree.

7 years agoMFC r303347, r303350, r303351, r303353:
ian [Wed, 1 Mar 2017 18:23:30 +0000 (18:23 +0000)]
MFC r303347, r303350, r303351, r303353:

  Translate modem status reg bits from ns16550 to SER_* values used by the
  tty layer.

  Annotate the usb-serial drivers which always return 0 for line status,
  so that it'll be easier to find and fix them in the future.

  Also annotate a switch case fall-through per style(9).

7 years agoMFC r303346:
ian [Wed, 1 Mar 2017 18:19:46 +0000 (18:19 +0000)]
MFC r303346:

 Actually return line status register values from umoscom_cfg_get_status().

 The hardware delivers ns16550-compatible status bits, which is what the
 usb_serial code expects, so no need for translation, no need for a local
 variable to hold a temporary lsr result.

7 years agoMFC r311658:
ian [Wed, 1 Mar 2017 18:05:40 +0000 (18:05 +0000)]
MFC r311658:

  Only write to *active once, even when GPIO_ACTIVE_LOW is set.

7 years agoMFC r310430:
ian [Wed, 1 Mar 2017 18:03:34 +0000 (18:03 +0000)]
MFC r310430:

  Use ${.OBJDIR} to refer to the kernel build object dir, instead of trying
  to recreate it from ${MAKEOBJDIRPREFIX} and ${SRC_BASE} and ${KERNCONF},
  the latter being especially problematic when KERNCONF is set to the names
  of multiple kernel configs.

7 years agoMFC r314101: don't use C99 static array indices with older GCC versions
avg [Wed, 1 Mar 2017 13:47:28 +0000 (13:47 +0000)]
MFC r314101: don't use C99 static array indices with older GCC versions

Sponsored by: Panzura

7 years agoMFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements
avg [Wed, 1 Mar 2017 13:45:40 +0000 (13:45 +0000)]
MFC r314100: fix a typo in __STDC_VERSION__ in __min_size requirements