Commit Graph

141799 Commits

Author SHA1 Message Date
Mark Johnston
82f4e0d0f0 riscv: Rename struct pmap's pm_l1 field to pm_top
In SV48 mode, the top-level page will be an L0 page rather than an L1
page.  Rename the field accordingly.  No functional change intended.

Reviewed by:	alc, jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34270
2022-03-01 09:39:43 -05:00
Mark Johnston
9f70c04da4 rip: Fix a -Wunused-but-set-variable warning
Fixes:		81728a538d ("Split rtinit() into multiple functions.")
Reviewed by:	imp, melifaro
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34395
2022-03-01 09:39:43 -05:00
Mark Johnston
84369dd523 x86: Probe the TSC frequency earlier
This lets us use the TSC to implement early DELAY, limiting the use of
the sometimes-unreliable 8254 PIT.

PR:		262155
Reviewed by:	emaste
Tested by:	emaste, mike tancsa <mike@sentex.net>, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34367
2022-03-01 09:39:35 -05:00
Mark Johnston
c3d830cf7c i386: Call clock_init() after finishidentcpu()
In a subsequent commit clock_init() will attempt to determine the TSC
frequency, and this requires that CPU identification is finalized.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 09:38:45 -05:00
Mark Johnston
89ae8eb74e rmlock: Add required compiler barriers to _rm_runlock()
Also remove excessive whitespace in _rm_rlock().

Reviewed by:	jah, mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34381
2022-03-01 09:38:45 -05:00
Kirk McKusick
3cf2f812f5 Add casts to printf statements to keep armv6, armv7, and powerpc
builds happy.
2022-02-28 19:28:02 -08:00
Kirk McKusick
c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00
Robert Wing
2062ce996d vmm: fix "set but not used" warnings 2022-02-28 15:09:32 -09:00
Robert Wing
39d87a0235 vmm: fix "set but not used" warnings 2022-02-28 14:55:37 -09:00
Robert Wing
73505a1076 vmm: fix "set but not used" warnings 2022-02-28 14:46:08 -09:00
Warner Losh
dbd330fc1c bwn: Remove useless variable
type is a write-only variable. Eliminate it.

Sponsored by:		Netflix
2022-02-28 10:14:34 -07:00
Warner Losh
44b4f0370f bnxt: Remove dead write to cp_ring_id
Since this is read from memory, reading it and then ignoring it is dead
code...

Sponsored by:		Netflix
2022-02-28 10:14:34 -07:00
Warner Losh
1c347de37f axgbe_setup_sysctl is a nop, remove it and the call to it.
Should we need something like this in the future, we can add it back.

Sponsored by:		Netflix
2022-02-28 10:14:33 -07:00
Mark Johnston
ceb246c7b2 cdce: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 11:08:55 -05:00
Mark Johnston
f4a5d1f6c4 axe: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 11:07:19 -05:00
Mark Johnston
4db93fb278 pci: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 10:54:42 -05:00
Mark Johnston
9218449b98 axge: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 10:54:32 -05:00
Mark Johnston
1db163b825 bhnd: Fix some -Wunused-but-set-variable warnings
MFC after:	1 week
2022-02-28 10:54:25 -05:00
Mark Johnston
1dc8ed06f3 iwm: Fix -Wunused-but-set-variable warnings
MFC after:	1 week
2022-02-28 10:54:15 -05:00
Xin LI
561524cfb0 Remove prototype of x86emu_init_default.
It's removed in 3219f535d9 (r198251) as part of code refactor.

MFC after:	2 weeks
2022-02-27 15:11:17 -08:00
Marco Devesas Campos
5f702d6d9a vchiq: Add compat string for rpi4
The RPi 4 has a newer vchiq compatible device, add it to the list.

Reviewed by: imp
2022-02-27 09:46:49 -07:00
Warner Losh
9891cb1e76 Eliminate curlen, it's set but never used
Sponsored by:		Netflix
2022-02-27 09:02:45 -07:00
Scott Long
6f3c0d2764 Default to always accepting the PHY that's present. Linux did
something similar a while back, and there are devices in the wild
that otherwise won't attach.  This patch is temporary until the
PHY code is further cleared up.

Obtained from: grehan
2022-02-26 18:29:08 -07:00
Scott Long
66b86c8a76 Fix "set but not used" in the mrsas driver. Remove dead code. 2022-02-26 12:21:11 -07:00
Scott Long
c61dc85428 Fix "set but not used" in the mvs driver. Remove dead code. 2022-02-26 12:18:42 -07:00
Scott Long
0fd7b4c74d Fix "set but not used" in the bfe driver. Remove dead code. 2022-02-26 12:14:22 -07:00
Scott Long
887ae1953f Fix "set but not used" in the siis driver. 2022-02-26 11:46:53 -07:00
Scott Long
4b22ce0730 The TWE driver should have been marked with gone_in for FreeBSD 13.x,
but was missed.  Mark it for gone_in 14.0.  The hardware hasn't been
produced or supported in over 20 years, and even back then it was
known to be electrically unreliable and prone to catastrophic failure.
2022-02-26 11:40:17 -07:00
Scott Long
b6ac753a88 Fix "set but not used" in twe. 2022-02-26 11:16:31 -07:00
Scott Long
fa911920b1 Fix "set but not used" for real in the ciss driver. 2022-02-26 11:07:05 -07:00
Scott Long
55339af296 Expand __diagused to include the KTR kernel diagnostic option. 2022-02-26 11:01:54 -07:00
Scott Long
dec703c7e0 Fix "set but not used" in the ips driver. Dead code. 2022-02-26 10:35:51 -07:00
Scott Long
f94066c8aa Fix "set but not used" in aic7xxx/aic79xx. The variables were dead
code.
2022-02-26 10:33:31 -07:00
Scott Long
e28289ca83 Fix "set but not used" in smartpqi. The PCI_MEM macros don't require a
physical/absolute address in FreeBSD, but it looks like the calling
code might be somewhat portable to other OS's that do require this.
Therefore, set the variables to __unused instead of removing the code
entirely.
2022-02-26 10:25:43 -07:00
Richard Scheffenegger
2ff07d9220 tcp: Restore correct ECT marking behavior on SACK retransmissions
While coalescing all ECN-related code into new common source files,
the flag to deal with SACK retransmissions was skipped. This leads
to non-compliant ECT-marking of SACK retransmissions, as well as
the premature sending of other TCP ECN flags (CWR).

Reviewed By: rrs, #transport
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34376
2022-02-25 20:05:32 +01:00
Mark Johnston
c84bb8cd77 rmlock: Micro-optimize read locking
Use get_pcpu() instead of an open-coded pcpu_find(td->td_oncpu).  This
eliminates some memory accesses and results in a shorter instruction
sequence.  Note that get_pcpu() didn't exist when rmlocks were added.

Reviewed by:	jah, mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34377
2022-02-25 13:55:24 -05:00
Marvin Ma
1517b8d5a7 vfs_unregister: fix error handling
Due to misplaced braces, an error from vfs_uninit() in the VFCF_SBDRY
case was ignored.

Reported by:	Anton Rang <rang@acm.org>
Reviewed by:	Anton Rang <rang@acm.org>, markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34375
2022-02-25 12:19:14 -06:00
Alexander Motin
f00ced06da CTL: Rework 05c3e8e871 using %zu format.
MFC after:	2 days
2022-02-25 11:53:53 -05:00
Rick Macklem
1cedb4ea1a nfscl: Fix a use after free in nfscl_cleanupkext()
ler@, markj@ reported a use after free in nfscl_cleanupkext().
They also provided two possible causes:
- In nfscl_cleanup_common(), "own" is the owner string
  owp->nfsow_owner.  If we free that particular
  owner structure, than in subsequent comparisons
  "own" will point to freed memory.
- nfscl_cleanup_common() can free more than one owner, so the use
  of LIST_FOREACH_SAFE() in nfscl_cleanupkext() is not sufficient.

I also believe there is a 3rd:
- If nfscl_freeopenowner() or nfscl_freelockowner() is called
  without the NFSCLSTATE mutex held, this could race with
  nfscl_cleanupkext().
  This could happen when the exclusive lock is held
  on the client, such as when delegations are being returned
  or when recovering from NFSERR_EXPIRED.

This patch fixes them as follows:
1 - Copy the owner string to a local variable before the
    nfscl_cleanup_common() call.
2 - Modify nfscl_cleanup_common() so that it will never free more
    than the first matching element.  Normally there should only
    be one element in each list with a matching open/lock owner
    anyhow (but there might be a bug that results in a duplicate).
    This should guarantee that the FOREACH_SAFE loops in
    nfscl_cleanupkext() are adequate.
3 - Acquire the NFSCLSTATE mutex in nfscl_freeopenowner()
    and nfscl_freelockowner(), if it is not already held.
    This serializes all of these calls with the ones done in
    nfscl_cleanup_common().

Reported by:	ler
Reviewed by:	markj
Tested by:	cy
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34334
2022-02-25 07:27:03 -08:00
Richard Scheffenegger
bd6bb49397 iscsi: per-session timeouts and rapid teardown of session on reconnect
Add per-Session configurable ping (SCSI NOP) and login timeouts.

Remove the torn down, old iSCSI session quickly, when performing a reconnect.

Reviewed By: trasz
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34198
2022-02-25 10:35:47 +01:00
Alexander Motin
05c3e8e871 Fix 32-bit build after 530d274c15.
MFC after:	3 days
2022-02-24 18:11:36 -05:00
Bjoern A. Zeeb
062103fc93 iwlwifi: update firmware
Update to the latest firmware based on
linux-firmware at c53073d4e1485ac9f7cb065db466793c495aead7
and update firmware module Makefiles accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-24 21:42:02 +00:00
Bjoern A. Zeeb
51152e5e61 iwlwifi: enhance debug information
Add a string of the debug type to the output of the debug message so it
is easier to search for specific events in a trace with lots of debugging
on.  While here remove superflous ().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-24 21:42:01 +00:00
Bjoern A. Zeeb
d9836fb4b9 iwlwifi: update from iwlwifi-next
Import new code from iwlwifi-next at cb0a1fb7fd86b0062692b5056ca8552906509512
(matching tag: iwlwifi-next-for-kalle-2022-02-18).

Also add files not previously imported because we are not yet compiling
them to ease updating and having them when needed.

This adds MEI (Management Engine) support upstream which we cannot import
(currently GPL-only) so we have stub functions for the missing bits.

This also reduces the diff to upstream.  Changes submitted to avoid
problems with const and  with void * arithmetics were merged.

In the module build Makefile disable CONFIG_IWLWIFI_OPMODE_MODULAR
as we are building iwlwifi as a single module.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
2022-02-24 21:42:01 +00:00
Alexander Motin
530d274c15 CTL: Add length validation for incoming HA messages.
This should fix uninitialized memory reads when working with broken
HA peer, like one fixed in 1a8d8a3a90.  Instead print error message
and kill the HA link.

MFC after:	3 days
Sponsored by:	iXsystems, Inc.
2022-02-24 16:24:43 -05:00
Alan Somers
e8553be9bc fusefs: fix a cached attributes bug during directory rename
When renaming a directory into a different parent directory, invalidate
the cached attributes of the new parent.  Otherwise, stat will show the
wrong st_nlink value.

MFC after:	1 week
Reviewed by:	ngie
Differential Revision: https://reviews.freebsd.org/D34336
2022-02-24 14:07:25 -07:00
Bjoern A. Zeeb
f6fb9b524f LinuxKPI: add MODULE_IMPORT_NS()
Add dummy MODULE_IMPORT_NS() used by an updated iwlwifi.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D34349
2022-02-24 19:59:25 +00:00
Bjoern A. Zeeb
fab601c5b7 LinuxKPI: change DECLARE_FLEX_ARRAY()
DECLARE_FLEX_ARRAY can be used inside a structure.  On FreeBSD due to
-Wgnu-variable-sized-type-not-at-end this yields an error.  Use [0]
instead of [] to overcome this.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D34350
2022-02-24 19:57:20 +00:00
Bjoern A. Zeeb
810ca5629a LinuxKPI: USB change successful probe result to BUS_PROBE_DEFAULT
Rather than returning 0 (which is BUS_PROBE_SPECIFIC) return
BUS_PROBE_DEFAULT to give other drivers a possible chance too
to attach.

Reported by:	jhb
Reviewed by:	hselasky, jhb, imp
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D34317
2022-02-24 19:55:19 +00:00
Warner Losh
2bfdc1ee9b cons: Use bool for boolean variables
MFC After:		3 days
Sponsored by:		Netflix
2022-02-24 10:58:07 -07:00
Jamie Gritton
d7c4ea7d72 posixshm: Allow jails to use kern.ipc.posix_shm_list
PR:		257554
Reported by:	grembo@
2022-02-24 09:30:49 -08:00
Rick Macklem
06148d2251 Revert "nfscl: Fix a use after free in nfscl_cleanupkext()"
This reverts commit dd08b84e35.

cy@ reported a problem caused by this patch.  He will be
testing an alternate patch, but I'm reverting this one.
2022-02-24 07:01:03 -08:00
Hans Petter Selasky
7520b88860 usb(4): Automagically apply all quirks for USB mass storage devices.
Currently there are five quirks the USB stack tries to automagically detect:
- UQ_MSC_NO_PREVENT_ALLOW
- UQ_MSC_NO_SYNC_CACHE
- UQ_MSC_NO_TEST_UNIT_READY
- UQ_MSC_NO_GETMAXLUN
- UQ_MSC_NO_START_STOP

If any of the quirks above are set, no further quirks will be probed.

If any of the USB mass storage tests fail, the USB device is
re-enumerated as a last resort to clear any error states from the
device. Then the USB stack will try to probe and attach the umass<N>
device passing the detected quirks.

While at it give more details in dmesg about what is going on.

Tested by:		several
Submitted by:		Idwer Vollering <vidwer_fbsdbugs@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D30919
MFC after:		1 week
Sponsored by:		NVIDIA Networking
2022-02-24 10:28:55 +01:00
Jason A. Harmening
fcb164742b unionfs: rework unionfs_getwritemount()
VOP_GETWRITEMOUNT() is called on the vn_start_write() path without any
vnode locks guaranteed to be held.  It's therefore unsafe to blindly
access per-mount and per-vnode data.  Instead, follow the approach taken
by nullfs and use the vnode interlock coupled with the hold count to
ensure the mount and the vnode won't be recycled while they are being
accessed.

Reviewed by:	kib (earlier version), markj, pho
Tested by:	pho
Differential Revision: https://reviews.freebsd.org/D34282
2022-02-23 22:10:02 -06:00
Warner Losh
e3d92d4cb8 cam iosched: Update comment for when we schedule writes.
Sponsored by:		Netflix
2022-02-23 16:21:27 -07:00
Warner Losh
077ab5bd43 bio: make _bio_cflags match bio_cflags
While none of the in-tree geoms that modify the bio_cflags use the top
half of the word, were they to do this in the future, we'd hit false
positives for DIAGNOSTIC kernels. Make both uint16_t.

MFC After:		1 week
Sponsored by:		Netflix
2022-02-23 14:35:52 -07:00
Randall Stewart
a43b0aca12 tcp: Push bit failure to set in fastpath
Recently changes were made to the tcp stack to use a macro/function
to set tcp flags. In the process the PUSH bit setting in the fastpath of
rack was broken. This fixes that as well as cleans up a warning that
is occurring when you don't have INVARIANT on (inp used in KASSERT).

We can use the tcp test suite to find this bug the test plan shows the script
that fails due to the missing push bit

Reviewed by: rscheff, tuexen
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D34332
2022-02-23 16:25:56 -05:00
Gleb Smirnoff
d2b3a0ed31 sendto: don't clear transient errors for atomic protocols
The changeset 65572cade3 uncovered the fact that top layer of sendto(2)
would clear a transient error code if some data was copied out of uio.
The clearing of the error makes sense for non-atomic protocols, since
they have sent some data.  The atomic protocols send all or nothing.

The current implementation of unix/dgram uses sosend_generic(), which
would always copyout and only then it may fail to deliver a message.
The sosend_dgram(), currently used by UDP only, also has same behavior.

Reported by:		pho
Reviewed by:		pho, markj
Differential revision:	https://reviews.freebsd.org/D34309
2022-02-23 10:24:14 -08:00
Mark Johnston
2997ab002e fbt: Remove handling for CTFv1
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-23 11:41:22 -05:00
Ed Maste
521dbfd6b1 vt: fix double-click word selection for last word on line
Previously when double-clicking on the last word on a line we would
select from the beginning of the word to the cursor position, because
we searched forward for a space character to find the end of a word.
Now, use the end of the line if we do not find a space.

PR:		261553
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34339
2022-02-23 10:53:24 -05:00
Michal Meloun
01f8011736 iicbus: Add missing dependency for iicbus module.
Reported by: rpokala, mjg
MFC with:       1bd3e8ba69
2022-02-23 16:30:12 +01:00
Andrew Turner
d8da59ddf8 Fix the sanitizer header checks on arm64
We need to not include the MI _san.h files when builing some parts of
the kernel. Fix these checks in the arm64 header files.

Sponsored by:	The FreeBSD Foundation
2022-02-23 14:50:56 +00:00
Andrew Turner
d58b79d1ce Built all KCSAN atomic interceptors on arm64
These atomic functions are now supported. Add them to KCSAN.

Sponsored by:	The FreeBSD Foundation
2022-02-23 14:45:47 +00:00
Andrew Turner
ec1ecf78ae Add the char and short atomic operations on arm64
Sponsored by:	The FreeBSD Foundation
2022-02-23 14:45:28 +00:00
Emmanuel Vadot
f34560385c arm: Add extres pseudo devices to some kernel
All the pseudo devices and framework are required by drivers.

Reported by:	mjg
2022-02-23 08:47:57 +01:00
Emmanuel Vadot
b7bfded146 files: Make mmc_fdt_helper and sdhci depends on clk and regulator
Those two frameworks are needed.
2022-02-23 08:47:57 +01:00
Bjoern A. Zeeb
9ad210c159 iwlwifi: fix the build
Pull in a case statement from the upcoming iwlwifi update to
unbreak the build after d875aa1587 .

Reported by:	cy
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
X-MFC with:	d875aa1587
2022-02-23 01:09:26 +00:00
Bjoern A. Zeeb
d875aa1587 LinuxKPI: update 802.11 headers
Add new defines, struct members, and (stub) functions needed for an
updated iwlwifi.  Most of the defines are for rfkill or HE.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-22 22:57:31 +00:00
Bjoern A. Zeeb
a3e07b6ef3 LinuxKPI: skbuff.h add skb_postpush_rcsum()
Add a stub for skb_postpush_rcsum() needed by an updated iwlwifi.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-22 22:54:48 +00:00
Rick Macklem
dd08b84e35 nfscl: Fix a use after free in nfscl_cleanupkext()
ler@, markj@ reported a use after free in nfscl_cleanupkext().
They also provided two possible causes:
- In nfscl_cleanup_common(), "own" is the owner string
  owp->nfsow_owner.  If we free that particular
  owner structure, than in subsequent comparisons
  "own" will point to freed memory.
- nfscl_cleanup_common() can free more than one owner, so the use
  of LIST_FOREACH_SAFE() in nfscl_cleanupkext() is not sufficient.

I also believe there is a 3rd:
- If nfscl_freeopenowner() or nfscl_freelockowner() is called
  without the NFSCLSTATE mutex held, this could race with
  nfscl_cleanupkext().
  This could happen when the exclusive lock is held
  on the client, such as when delegations are being returned.

This patch fixes them as follows:
1 - Copy the owner string to a local variable before the
    nfscl_cleanup_common() call.
2 - Modify nfscl_cleanup_common() to return whether or not a
    free was done.
    When a free was done, do a goto to restart the loop, instead
    of using FOREACH_SAFE, which was not safe in this case.
3 - Acquire the NFSCLSTATE mutex in nfscl_freeopenowner()
    and nfscl_freelockowner(), if it not already held.
    This serializes all of these calls with the ones done in
    nfscl_cleanup_common().

Reported by:	ler
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34334
2022-02-22 14:21:43 -08:00
Ed Maste
327da507f9 vt: whitespace and style(9) updates 2022-02-22 16:30:27 -05:00
Alexander Motin
074bed4f48 mps/mpr: Add missing newlines in error messages.
MFC after:	1 week
2022-02-22 15:08:22 -05:00
Mateusz Guzik
f17ef28674 fd: rename fget*_locked to fget*_noref
This gets rid of the error prone naming where fget_unlocked returns with
a ref held, while fget_locked requires a lock but provides nothing in
terms of making sure the file lives past unlock.

No functional changes.
2022-02-22 18:53:43 +00:00
Robert Wing
0a2f498234 tty: fix a panic with INVARIANTS
watch'ing a tty triggers a refcount wraparound panic, take a reference
on fp after fget_cap_locked() to fix.

Reported by:    Michael Jung <mikej_at_paymentallianceintl.com>
Reviewed by:	hselasky, mjg
Fixes:          f40dd6c803 ("tty: switch ttyhook_register to use fget_cap_locked")
Differential Revision:	https://reviews.freebsd.org/D34335
2022-02-22 09:37:13 -09:00
Andrew Turner
6713be3159 Add NT_ARM_ADDR_MASK
This can be used by debuggers to find which bits in a virtual address
should be masked off to get a canonical address. This is currently used
by the Pointer Authentication Code support to get its mask. It could also
be used if we support Top Byte Ignore for the same purpose.

Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34302
2022-02-22 17:10:35 +00:00
Mark Johnston
d5c0a7b6d3 riscv: Fix another race in pmap_pinit()
Commit c862d5f2a7 ("riscv: Fix a race in pmap_pinit()") did not really
fix the race.  Alan writes,

 Suppose that N entries in the L1 tables are in use, and we are in the
 middle of the memcpy().  Specifically, we have read the zero-filled
 (N+1)st entry from the kernel L1 table.  Then, we are preempted.  Now,
 another core/thread does pmap_growkernel(), which fills the (N+1)st
 entry.  Finally, we return to the original core/thread, and overwrite
 the valid entry with the zero that we earlier read.

Try to fix the race properly, by copying kernel L1 entries while holding
the allpmaps lock.  To avoid doing unnecessary work while holding this
global lock, copy only the entries that we expect to be valid.

Fixes:		c862d5f2a7 ("riscv: Fix a race in pmap_pinit()")
Reported by:	alc, jrtc27
Reviewed by:	alc
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34267
2022-02-22 09:26:33 -05:00
Ed Maste
692bb3f029 vt: fix double-click word selection for first word on line
Previously when double-clicking on the first word on a line we would
select from the cursor position to the end of the word, not from the
beginning of the line.  This is because we searched backward for a
space to mark the beginning of a word.

Now, use the beginning of the line if we do not find a space.

PR:		261553
Reported by:	Stefan B.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-02-22 09:08:50 -05:00
Emmanuel Vadot
adbb32d3e6 files: Make mmc_pwrseq depends on regulator and clk
It uses those two frameworks too.
2022-02-22 11:22:23 +01:00
Emmanuel Vadot
da6252a6a0 dwc: Support phy mode MII
Some board use dwc phy in MII mode, so do not fail to attach if this is
the case.
Only rockchip code uses the phy mode to program some custom syscon register.

PR:	260848
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-22 10:01:56 +01:00
Emmanuel Vadot
30f16ad460 dwc: Release resources when attach fails
PR:	259282
MFC after:	1 week
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-22 10:01:54 +01:00
Emmanuel Vadot
832adbd4c4 files: Make mmc_helpers depends on regulator and clk
It also needs those two framework.
2022-02-22 10:01:22 +01:00
Hubert Mazur
f97e7d6e9d sdhci_fsl_fdt: Add voltage switching through syscon
Some SoCs does not have a fixed regulator to handle voltage
switching automatically. Add support for voltage switching
through syscon register when necessary. Add new errata flag
indicating missing regulator. Apply errata to SoCs, which are
known to be affected, i.e. LS1046 and LS1012.

Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D34029
2022-02-22 09:58:38 +01:00
Hubert Mazur
caca7dd087 sdhci_fsl_fdt: Apply errata for LX2160A
LX2160A is affected by two erratum regarding SDHCI. However this board
has generic compat string in DTS for SDHCI which means erratum cannot
be simply applied. Compare compat string from "/" path with LX2160A
compat string when attaching device and apply erratum.

Reviewed by: mmel, imp
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D34028
2022-02-22 09:58:35 +01:00
Kornel Duleba
29cb30dcb0 sdhci_fsl_fdt: Fix tuning code
- Some of the register writes were already done in the generic tuning code.
  Remove them.
- Increase the polling timeout. The previous value is probably fine, but since
  timeouts are treated as fatal errors increasing it to 200ms won't hurt.
- Rework the HS400 switching code. Make sure that the switch happens at the
  right time. Reset the DLL0 block. We need to do that if u-boot has previously
  configured the controller in HS400 mode.
- Check current timing before tuning. The tuning devmethod is always called,
  even for timings that don't require the tuning procedure.
- Rework software tuning routine code. Use inner formula for clock
  divider calculation, as previous one was incorrect.
- Implement custom re-tune procedure.

Co-authored-by: Hubert Mazur <hum@semihalf.com>
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D34027
2022-02-22 09:58:32 +01:00
Kornel Duleba
a974a7bcdf sdhci_fsl_fdt: Fix pulse width errata application
The errata has to be applied every time after SDHCI_RESET_ALL is done.
Move it from attach to the custom reset routine.

Reviewed by: wma, mmel
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D33981
2022-02-22 09:58:24 +01:00
Mitchell Horne
7b0a665d72 boottrace: annotate init and shutdown utilities
Add boottrace annotations to record events in init(8), shutdown(8), and
reboot(8).

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#23
Differential Revision:	https://reviews.freebsd.org/D31928
2022-02-21 20:16:07 -04:00
Mitchell Horne
5a8fceb3bd boottrace: trace annotations for startup and shutdown
Add trace events for execution of SYSINITs (both static and dynamically
loaded), and to the various steps in the shutdown/panic/reboot paths.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#23
Differential Revision:	https://reviews.freebsd.org/D30187
2022-02-21 20:15:57 -04:00
Mitchell Horne
0aa9ffcd9c init_main.c: sort includes
This is preferred by style(9). Do this ahead of adding another include.

Reviewed by:	imp, kevans, allanjude
MFC after:	3 days
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30186
2022-02-21 20:15:51 -04:00
Mitchell Horne
877eea429b kern_linker.c: sort includes
This is preferred by style(9). Do this ahead of adding another include.

Reviewed by:	imp, kevans
MFC after:	3 days
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D30185
2022-02-21 20:15:51 -04:00
Mitchell Horne
da5b7e90e7 boottrace: a simple boot and shutdown-time tracing facility
Boottrace is a facility for capturing trace events during boot and
shutdown. This includes kernel initialization, as well as rc. It has
been used by NetApp internally for several years, for catching and
diagnosing slow devices or subsystems. It is driven from userspace by
sysctl interface, and the output is a human-readable log of events
(kern.boottrace.log).

This commit adds the core boottrace functionality implementing these
interfaces. Adding the trace annotations themselves to kernel and
userland will happen in follow-up commits. A future commit will also add
a boottrace(4) man page.

For now, boottrace is unconditionally compiled into the kernel but
disabled by default. It can be enabled by setting the
kern.boottrace.enabled tunable to 1 in loader.conf(5).

There is an existing boot-time event tracing facility, which can be
compiled into the kernel with 'options TSLOG'. While there is some
functional overlap between this and boottrace, they are distinct. TSLOG
is suitable for generating detailed timing information and flamegraphs,
and has been used to great success by cperciva@ to diagnose and reduce
the overall system boot time. Boottrace aims to more quickly provide an
overview of timing and resource usage of the boot (and shutdown) process
to a sysadmin who requires this knowledge.

Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
X-NetApp-PR:	#23
Differential Revision:	https://reviews.freebsd.org/D30184
2022-02-21 20:15:45 -04:00
Kristof Provost
36637dd19d bridge: Don't share broadcast packets
if_bridge duplicates broadcast packets with m_copypacket(), which
creates shared packets. In certain circumstances these packets can be
processed by udp_usrreq.c:udp_input() first, which modifies the mbuf as
part of the checksum verification. That may lead to incorrect packets
being transmitted.

Use m_dup() to create independent mbufs instead.

Reported by:	Richard Russo <toast@ruka.org>
Reviewed by:	donner, afedorov
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D34319
2022-02-21 19:03:44 +01:00
Chuck Tuffli
c2318cf80a nvme: fix spelling of Namespace
Fix spelling of a macro definition.

Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D34330
2022-02-21 10:34:46 -08:00
Chuck Tuffli
e71afa1202 nvme: Add OAES bit-field definitions
Create definitions for the Optional Asynchronous Events Supported (OAES)
values. Also adds a helper macro for the common use case of "mask and
shift". E.g.
    value = NVME_CTRLR_DATA_OAES_NS_ATTR_MASK << NVME_CTRLR_DATA_OAES_NS_ATTR_SHIFT;
becomes
    value = NVMEB(NVME_CTRLR_DATA_OAES_NS_ATTR);

Reviewed by:	mav, imp
Differential Revision:	https://reviews.freebsd.org/D34300
2022-02-21 10:34:14 -08:00
Emmanuel Vadot
f898e41925 files: Make mmc_helper depend on gpio
mmc_helper have an hard dependency on gpio_if.h
gpio(4) isn't in the default x86 kernel and none of the x86
sd/mmc drivers uses mmc_helper so just add a dependency on gpio.

Fixes: 85b3794cee ("files: Make ext_resources non-optional")
2022-02-21 18:31:00 +01:00
Emmanuel Vadot
8b39d2fe35 options: Remove EXT_RESOURCES
It is now unused in kernel code.

MFC after:	Never
Differential Revision:	https://reviews.freebsd.org/D33839
2022-02-21 17:29:15 +01:00
Emmanuel Vadot
092a42a6a3 riscv: conf: Remove options EXT_RESOURCES
It is now unused in kernel code.

Reviewed by:	mhorne
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33838
2022-02-21 17:29:13 +01:00
Emmanuel Vadot
34223f74a2 arm: conf: Remove options EXT_RESOURCES
It is now unused in kernel code.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33837
2022-02-21 17:29:11 +01:00
Emmanuel Vadot
90288dcb4c arm64: conf: Remove options EXT_RESOURCES
It is now unused in kernel code.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33836
2022-02-21 17:29:09 +01:00
Emmanuel Vadot
02398e581d ofw_cpu: Make ext_resources non-optional for arm* and riscv
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
For RISC-V it was always enabled.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33835
2022-02-21 17:29:07 +01:00
Emmanuel Vadot
85b3794cee files: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33834
2022-02-21 17:29:06 +01:00
Emmanuel Vadot
ee2e56c6d7 armv7: allwinner: Make ext_resources non-optional
The only valid condition for if_awg and aw_syscon is syscon.
EXT_RESOURCES is enabled in GENERIC since 12-CURRENT.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33833
2022-02-21 17:29:04 +01:00
Emmanuel Vadot
4bcdfeb06f vf_i2c: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33832
2022-02-21 17:29:02 +01:00
Emmanuel Vadot
90a5fc326e imx_gpio: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33831
2022-02-21 17:29:00 +01:00
Emmanuel Vadot
774a4b6a51 imx_i2c: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33830
2022-02-21 17:28:58 +01:00
Emmanuel Vadot
14444bf7c8 bcm2835_sdhci: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

Reviewed by:	kevans
MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33829
2022-02-21 17:28:56 +01:00
Emmanuel Vadot
5c00765bf2 uart_dev_snps: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33828
2022-02-21 17:28:54 +01:00
Emmanuel Vadot
fb6cebd8bd usb: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33827
2022-02-21 17:28:52 +01:00
Emmanuel Vadot
4f64df4e32 uart_dev_imx: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33826
2022-02-21 17:28:50 +01:00
Emmanuel Vadot
d46fd9e855 if_cgem: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33825
2022-02-21 17:28:48 +01:00
Emmanuel Vadot
a813b0965d sdhci: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33824
2022-02-21 17:28:46 +01:00
Emmanuel Vadot
36498b1408 twsi: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33823
2022-02-21 17:28:44 +01:00
Emmanuel Vadot
b4cc0f7d28 dwmmc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33822
2022-02-21 17:28:42 +01:00
Emmanuel Vadot
78f8b4aafa mmc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33821
2022-02-21 17:28:40 +01:00
Emmanuel Vadot
a5339ba3ff dwc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33820
2022-02-21 17:28:37 +01:00
Randall Stewart
ea9017fb25 tcp: Congestion control move to using reference counting.
In the transport call on 12/3 Gleb asked to move the CC modules towards
using reference counting to prevent folks from unloading a module in use.
It was also agreed that Michael would do a user space utility like tcp_drop
that could be used to move all connections that are using a specific CC
to some other CC.

This is the half I committed to doing, making it so that we maintain a refcount
on a cc module every time a pcb refers to it and decrementing that every
time a pcb no longer uses a cc module. This also helps us simplify the
whole unloading process by getting rid of tcp_ccunload() which munged
through all the tcb's. Instead we mark a module as being removed and
prevent further references to it. We also make sure that if a module is
marked as being removed it cannot be made as the default and also
the opposite of that, if its a default it fails and does not mark it as being
removed.

Reviewed by: Michael Tuexen, Gleb Smirnoff
Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D33249
2022-02-21 06:30:17 -05:00
Emmanuel Vadot
eb80ba8d54 cpufreq: dt: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:23 +01:00
Emmanuel Vadot
4f118605ad twsi: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:21 +01:00
Emmanuel Vadot
6582b75a32 audio_soc: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:20 +01:00
Emmanuel Vadot
79778f8692 if_dwc: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:18 +01:00
Emmanuel Vadot
8c70a27c4d arm: allwinner: a33_codec: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:16 +01:00
Emmanuel Vadot
8604ba7423 arm: allwinner: a10_timer: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:14 +01:00
Emmanuel Vadot
89f8aa7d41 pmic: rockchip: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:12 +01:00
Emmanuel Vadot
4c5b550e63 arm: allwinner: clk: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:10 +01:00
Emmanuel Vadot
cfd8b9545e arm64: allwinner: aw_usb3phy: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:08 +01:00
Emmanuel Vadot
d6ab3d1c20 arm64: allwinner: aw_i2s: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:06 +01:00
Emmanuel Vadot
3dc60bab27 arm: allwinner: aw_gpio: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:05 +01:00
Emmanuel Vadot
aeb70a6707 arm64: allwinner: axp81x: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:02 +01:00
Emmanuel Vadot
34abc89413 arm64: allwinner: aw_sid: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-02-21 11:08:00 +01:00
Hans Petter Selasky
eb16e362d6 mlx5core: Add PCI IDs for ConnectX-8.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-21 09:35:19 +01:00
Hans Petter Selasky
91c8ffd7e6 mlx5ib: Add support for NDR link speed.
The IBTA specification has new speed - NDR. That speed supports signaling
rate of 100Gb. mlx5 IB driver translates link modes reported by ConnectX
device to IB speed and width. Added translation of new 100Gb, 200Gb and
400Gb link modes to NDR IB type and width of x1, x2 or x4 respectively.

Linux commits:
f946e45f59ef01ff54ffb3b1eba3a8e7915e7326

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-21 09:35:19 +01:00
Hans Petter Selasky
ea8aacc523 mlx5core: Add PCI IDs for ConnectX-7.
Linux commits:
505a7f5478062c6cd11e22022d9f1bf64cd8eab3
dd8595eabeb486d41ad9994e6cece36e0e25e313

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-21 09:35:19 +01:00
Hans Petter Selasky
1aa593b90c ibcore: Add support for NDR link speed.
Add new IBTA speed NDR, supporting signaling rate of 100Gb.

Linux commit:
c7adf7717301558e8852949d8e3dc3748d1a4a97

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-21 09:35:19 +01:00
Stefan Eßer
f01c863337 dev/pci: fix potential panic due to bogus VPD data
A panic has been observed on a system with a Intel X520 dual LAN
device. The panic is caused by a KASSERT() noticing that the amount
of VPD data copied out to the pciconf command does not match the
amount of data read from the device.

The cause of the size mismatch was VPD data that started with 0x82,
the VPD tag that indicates that a VPD ident follows, but with a length
of more than 255 characters, which happens to be the maximum ident
size supported by the API between kernel and the pciconf program.
The data provided did not resemble an actual VPD identifier, and it
can be assumed that the initial tag value 0x82 happens to be there
by accident.

An ident size of 255 far exceeds the sensible length of that data
element, which is in the order of at most 30 to 40 bytes.

This patch adds several consitstency checks to the VPD parser, the
most critical being that ident lengths of more than 255 bytes are
rejected. Other checks reject VPD with more than one ident tag or
with an empty (zero length) ident string.

This patch prevents the panic that occured when "pciconf -lV" was
executed on the affected system.

During the anaylsis of the issue and the VPD code it has been
found that the VPD parser uses a state machine that accepts tags
in any order and combination. This is a bad match for the actual
VPD data, which has a very simple structure that can be parsed
with a non-recursive direct descent parser (which always knows
exactly which token to expect next).

A review fpr a much simpler VPD parser that performs many more
consistency checks and rejects invalid VPD has been proposed in
review https://reviews.freebsd.org/D34268.

Reported by:	mikej at paymentallianceintl.com (Michael Jung)
Approved by:	jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D34255
2022-02-20 22:36:04 +01:00
Michael Tuexen
bdb99f6f5e sctp: remove KASSERT() which not always holds
Reported by:	syzbot+c907045aed2043011f3c@syzkaller.appspotmail.com
MFC after:	3 days
2022-02-20 15:59:21 +01:00
Michael Tuexen
e255f0c9fb sctp: make sure new locking requirements are satisfied.
Reported by:	syzbot+cd3c1dd64861b8c200bd@syzkaller.appspotmail.com
MFC after:	3 days
2022-02-20 15:36:26 +01:00
Michael Tuexen
2f0656fb9b sctp: don't hold the assoc create lock longer than needed
Reported by:	syzbot+c738e3df67cf425c49a2@syzkaller.appspotmail.com
MFC after:	3 days
2022-02-20 14:55:41 +01:00
Michal Meloun
7504f32c2e ofw_iicbus: Use uint32_t for iic bus address argument, not int.
The iicbus devinfo uses uint32_t for storing iic bus address and new method
should comply with this fact.

MFC with:	1bd3e8ba696633ccd7525030d951b58ade167814#
2022-02-20 14:17:50 +01:00
Michal Meloun
960ce3f7b2 Fix a534b50e24 on powerpc.
MFC with:	1bd3e8ba69
2022-02-20 14:06:29 +01:00
Michal Meloun
a534b50e24 tegra: Improve the detection of the secondary function (RTC) of the MAX77620.
Use the new ofw_iicbus_set_devinfo() method to implant an OFW compatibility
string for a manually created RTC sub-device.

MFC after:	4 weeks
Reported by:	archimedes.gaviola_at_gmail.com
		bscott_at_bunyatech.com.au
2022-02-20 12:26:04 +01:00
Michal Meloun
1bd3e8ba69 ofw_iicbus: Add method for manual setting of basic OFW parameters.
Some IIC multifunction devices may have multiple I2C addresses per chip, but
only the primary address is listed in the DT (e.g. MAX776200). In this case,
the sub-devices for the secondary addresses must be created manually with
fixed OFW parameters (node, name, compatibility string, IIC address).
Add a bus method to the ofw_iicbus interface that does this.

MFC after:	4 weeks
2022-02-20 12:25:58 +01:00
Kirk McKusick
c8cc568961 Provide an interface that allows GEOM modules to return multiple messages.
The gctl_error() function provides GEOM modules with the ability
to report only a single message. When running with the verbose
flag, commands that handle multiple devices may want to report a
message for each of the devices on which it operates. This commit
adds the gctl_msg() function that can be called multiple times
to post messages. When finished issuing messages, the application
must either call gctl_post_messages() or call gctl_error() to cause
the messages to be reported to the calling process.

Tested by:    Peter Holm
2022-02-19 21:33:02 -08:00
Michael Tuexen
a4a31271cc sctp: cleanup sctp_lower_sosend
This is a preparation for retiring the tcp send lock in the
next step.

MFC after:	3 days
2022-02-20 01:09:30 +01:00
Hans Petter Selasky
f190f8d1a2 snd_uaudio(4): Set hardware buffering to the minimum by default.
Improves the audio experience when using applications like
audio/jamulus and audio/hpsjam .

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-02-20 00:11:51 +01:00
Mateusz Guzik
430e0e409c vnet: add CURVNET_ASSERT_SET for !VIMAGE
Reported by:	ler
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-02-19 21:00:00 +00:00
Henri Hennebert
577130e56e rtsx: Add RTS5260 support and replace bootverbose with sysctl.
Tested by:	mav
MFC after:	4 days
Differential Revision:	https://reviews.freebsd.org/D34246
2022-02-19 11:46:40 -05:00
Mateusz Guzik
8a9269edd7 ipsec: sprinkle CURVNET_ASSERT_SET
Reviewed by:	ae
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34314
2022-02-19 13:10:41 +00:00
Mateusz Guzik
91c35dd765 ipsec: extend vnet coverage in esp_input/output_cb
key_delsav used to conditionally dereference vnet, leading to panics as
it was getting unset too early.

While the particular condition was removed, it makes sense to handle all
operations of the sort with correct vnet set so change it.

Reviewed by:	ae
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34313
2022-02-19 13:10:21 +00:00
Mateusz Guzik
75cde1f872 vnet: add CURVNET_ASSERT_SET
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34312
2022-02-19 13:10:01 +00:00
John Baldwin
bd6e8729d6 ctl ramdisk: Free compare buffer after a compare I/O request.
For a compare request, the ramdisk backend allocates a temporary
buffer to hold the I/O data and then compares it against the LUN's
pages in ctl_backend_ramdisk_cmp after the data has been filled.
However, the tempory buffer was leaked when after the comparison was
complete.  Fix this by freeing the buffer after the comparison.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34316
2022-02-18 15:20:14 -08:00
Bjoern A. Zeeb
39d8c38707 LinuxKPI: return value for linux_pci_probe()
In linux_pci_probe() return BUS_PROBE_DEFAULT rather than 0
(which actually is BUS_PROBE_SPECIFIC and means 'Only this
driver can use this device').

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D33913
2022-02-18 21:52:33 +00:00