FreeBSD/src 8a7ab3esys/dev/usb/video uvideo.c

uvideo: Return actual mtx_sleep error in dqbuf

Don't coerce errors to EINVAL, which isn't correct for mtx_sleep's
failure cases.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1sys/dev/usb/video/uvideo.c
+1-11 files

FreeBSD/src b22b159sys/dev/aq aq_hw.h aq_fw1x.c

aq(4): Use standard ETHER_ADDR_LEN definition

No need for a bespoke #define.

(cherry picked from commit 8c64625d90792462289686e0209a9f3fff67fc9b)
DeltaFile
+2-1sys/dev/aq/aq_hw.h
+1-1sys/dev/aq/aq_fw1x.c
+0-2sys/dev/aq/aq_common.h
+1-1sys/dev/aq/aq_fw2x.c
+4-54 files

FreeBSD/src daf364fsys/dev/aq aq_hw_llh.c aq_ring.c

aq(4): style(9) cleanup

(cherry picked from commit 668423f75b4d9006f16847b415c861defb8267d7)
DeltaFile
+62-34sys/dev/aq/aq_hw_llh.c
+11-7sys/dev/aq/aq_ring.c
+10-6sys/dev/aq/aq_fw.c
+10-5sys/dev/aq/aq_hw.c
+4-2sys/dev/aq/aq_dbg.c
+2-3sys/dev/aq/aq_fw1x.c
+99-575 files not shown
+106-6711 files

FreeBSD/src 06a2734sys/dev/aq aq_hw_llh.c aq_hw.c

aq(4): Style, whitespace and misc cleanup

The compiled objects do not change other than a few diagnostic messages
that include __LINE__.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54304

(cherry picked from commit 96156003ec0c70de88a448d48d8e9bd37913589f)
DeltaFile
+1,100-1,024sys/dev/aq/aq_hw_llh.c
+516-503sys/dev/aq/aq_hw.c
+453-420sys/dev/aq/aq_hw_llh.h
+299-271sys/dev/aq/aq_fw2x.c
+260-204sys/dev/aq/aq_main.c
+219-209sys/dev/aq/aq_fw.c
+2,847-2,63112 files not shown
+3,598-3,34118 files

FreeBSD/src df0b781sys/dev/aq aq_common.h aq_dbg.h

aq(4): Use sys, not userland, headers

And remove some unused definitions.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54152

(cherry picked from commit d2850435f18c81479f79bd23ea8d4b997dbc0521)
DeltaFile
+1-7sys/dev/aq/aq_common.h
+1-1sys/dev/aq/aq_dbg.h
+1-1sys/dev/aq/aq_fw.c
+1-1sys/dev/aq/aq_fw1x.c
+1-1sys/dev/aq/aq_fw2x.c
+0-1sys/dev/aq/aq_hw.h
+5-126 files

FreeBSD/src 56e056asys/dev/aq aq_hw_llh_internal.h aq_hw_llh.c

sys: Import snapshot of Aquantia ACQ107 vendor driver

Obtained from https://github.com/Aquantia/aqtion-freebsd commit
c61d27b1d94af72c642deefa0595884481ea7377.

This is not using a vendor branch.  The formerly-upstream repo is
abandoned and I do not believe it will receive updates.  This initial
import serves as a snapshot of the vendor code, but from here we will
iterate on it in the tree as our own code.

Bug fixes, code cleanup, and build infrastructure will follow.

NetBSD and OpenBSD have derivatives of this driver (with additional
hardware support).  We can look to changes in those drivers, and the
Linux driver, to add support here.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53813

    [2 lines not shown]
DeltaFile
+3,335-0sys/dev/aq/aq_hw_llh_internal.h
+1,986-0sys/dev/aq/aq_hw_llh.c
+1,329-0sys/dev/aq/aq_main.c
+1,176-0sys/dev/aq/aq_hw_llh.h
+907-0sys/dev/aq/aq_hw.c
+581-0sys/dev/aq/aq_ring.c
+9,314-012 files not shown
+12,109-018 files

FreeBSD/src c9ee056sys/dev/aq aq_main.c aq_media.c

aq(4): Port to IfAPI

Direct access to struct ifnet members is not possible in FreeBSD 15;
accessors must be used.  These exist in all supported FreeBSD versions,
so we do not need to make this conditional.

(cherry picked from commit 4756f5ff8f10cdda925cab60c0b66606698e49ee)
DeltaFile
+8-8sys/dev/aq/aq_main.c
+6-6sys/dev/aq/aq_media.c
+2-2sys/dev/aq/aq_ring.c
+16-163 files

FreeBSD/src 539bc9asys/dev/aq aq_main.c

aq(4): Remove unused DRIVER_MODULE devclass

(cherry picked from commit 2b587c0c8a933cd110ae579366644a280c509b7f)
DeltaFile
+4-0sys/dev/aq/aq_main.c
+4-01 files

FreeBSD/src f6e84c7sys/dev/aq aq_hw.c

aq(4): Remove #include of user header <unistd.h>

pause() has 2 different definition in unistd.h and sys/systm.h

(cherry picked from commit 14eb7ec7b7135ad1a3448590cbe70b1368b40ec7)
DeltaFile
+0-1sys/dev/aq/aq_hw.c
+0-11 files

FreeBSD/src 1fecb10sys/dev/aq aq_ring.c

aq(4): Fix VLAN tag test

Previously emitted a compiler warning "warning: bitwise comparison
always evaluates to false."

Looking at the OpenBSD driver (which is based on this code) it looks
like the VLAN flag should be set if either of these bits is.  In the
OpenBSD driver these are AQ_RXDESC_TYPE_VLAN and AQ_RXDESC_TYPE_VLAN2
rather than a magic number 0x60.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53836

(cherry picked from commit 8666fda1afb03b3a88e57a20d76da8e7910b6407)
DeltaFile
+1-1sys/dev/aq/aq_ring.c
+1-11 files

FreeBSD/src bd6af81sys/dev/aq aq_main.c

aq(4): Remove unimplemented functions

aq_if_priv_ioctl and aq_if_debug have prototypes but are not yet
implemented.  Just remove the commented-out DEVMETHODs and the unused
prototypes, to clear a build-time warning; the DEVMETHODs and prototypes
can be readded if / when they are implemented.

(cherry picked from commit 0156be41a1eb8e0408819466b912181aa7966df9)
DeltaFile
+0-4sys/dev/aq/aq_main.c
+0-41 files

FreeBSD/src cff985dusr.bin/vtfontcvt vtfontcvt.c

vtfontcvt: Avoid dead store in add_char

The fallback glyph is stored at index 0, and does not need to be
inserted into a mapping.

Previously there was a dead store of add_glyph's return value for the
fallback case, which upset Clang's static analyzer.  Now, cast the
return value to (void) to make it clear this is intentional.

Also change add_glyph's fallback parameter to a c99 bool to make its use
more clear.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57174

(cherry picked from commit b273481f2a840a05e4039655be99528e1fa9388c)
DeltaFile
+4-4usr.bin/vtfontcvt/vtfontcvt.c
+4-41 files

FreeBSD/src 8468152sys/dev/usb/video uvideo.c

uvideo: fix step=0 infinite loop and int overflow in fbuf_size

Prevent infinite loop in uvideo_vs_negotiation() when a USB camera reports
step=0 in its continuous frame interval descriptor.
Cast fbuf_size calculation to uint64_t to avoid int overflow for large
width/height/bpp combinations.

Reported by:    emaste
DeltaFile
+3-1sys/dev/usb/video/uvideo.c
+3-11 files

FreeBSD/src 26bb78blib/libsysdecode netlink.c

libsysdecode: add Netlink attribute decoding infrastructure

Introduce a generic Netlink attribute decoding framework based on
attribute decoder tables. The framework supports decoding primitive
attribute types as well as nested attributes and can be reused by
different Generic Netlink families.

Signed-off-by:  Ishan Agrawal <iagrawal9990 at gmail.com>
Sponsored-by:   Google LLC (GSoC 2026)
Reviewed-by:    kp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2337
DeltaFile
+213-2lib/libsysdecode/netlink.c
+213-21 files

FreeBSD/src 967e86dsys/dev/sound/pcm channel.c dsp.c

sound: Scale PCM secondary buffers by byte rate

The fixed 128 KiB secondary buffer cap dates from stereo-sized streams.
High channel-count or high sample-width OSS streams can consume most of
that budget in one graph quantum, leaving too little room for capture
catch-up or playback headroom.

Keep 128 KiB as the low-rate floor, but derive the effective soft-ring
cap from the channel byte rate, clamped to 4 MiB. Use that per-channel
cap when resizing the soft buffer and when clamping
SNDCTL_DSP_SETFRAGMENT requests.

Also clamp SNDCTL_DSP_LOW_WATER to the current soft-buffer size so an
impossible readiness threshold cannot make poll/select wait forever.

MFC after:      3 weeks
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D58064
DeltaFile
+46-16sys/dev/sound/pcm/channel.c
+27-11sys/dev/sound/pcm/dsp.c
+23-7sys/dev/sound/pcm/channel.h
+96-343 files

FreeBSD/src d83e422sys/fs/cuse cuse.c

cuse: Fix server reference leak in cuse_client_open()

If the server is closing (or the device node is going away), or if
devfs_set_cdevpriv() fails, cuse_client_open() returns with the server
reference taken at the top of the function still held and the newly
allocated client still linked on pcs->hcli.  Since cuse_client_free()
has not been registered as the cdevpriv destructor at that point,
nothing ever undoes this work: every open() that races the is_closing
window permanently leaks one server reference and one cuse_client.

A leaked reference is fatal on server exit: cuse_server_free()
busy-waits in an uninterruptible pause("W", hz) loop until pcs->refs
drops to 1, which now never happens, so the exiting server process
(e.g. virtual_oss(8)) is left wedged in state "D", immune to SIGKILL,
cuse.ko is pinned (kldunload hangs too), and only a reboot recovers.

Before 634e578ac7b0 the is_closing error path dropped the reference by
calling devfs_clear_cdevpriv(), which ran the cuse_client_free()
destructor.  That commit moved devfs_set_cdevpriv() after the

    [14 lines not shown]
DeltaFile
+10-2sys/fs/cuse/cuse.c
+10-21 files

FreeBSD/src 755685dsys/dev/sound/usb uaudio.c

snd_uaudio: Don't let an idle stream reprogram a shared UAC2 clock

Some UAC2 devices expose a single Clock Source entity that is shared
between their playback and capture interfaces (it appears in both the
output and input clock bitmaps).  On such a device uaudio(4) programs
the sample rate for both directions when a stream starts.  If playback
runs at a 44.1 kHz-family rate while the idle capture channel is left
at its 48 kHz-family default, the capture
SET_CUR(UA20_CS_SAM_FREQ_CONTROL) is issued after the playback one and
overwrites the rate on the shared clock.  The device then runs at
~48 kHz while the playback stream carries 44.1 kHz data.  Consuming
samples faster than they arrive, the device repeatedly runs out of
data, loses sync with the playback stream, and re-locks onto it
(audible dropouts, front-panel play/idle flicker).  The 48 kHz family
is unaffected because both directions then agree on the rate.

Fix it in three parts:

- Add a shared-clock guard: before issuing SET_CUR to a clock id, if

    [28 lines not shown]
DeltaFile
+95-8sys/dev/sound/usb/uaudio.c
+95-81 files

FreeBSD/src daf57ebsys/netinet ip_icmp.c

icmp: Verify redirect gateway with fib-aware ifa selection

During call to `icmp_verify_redirect_gateway()` ensure using
fib-aware source address selection function.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D58409
DeltaFile
+1-2sys/netinet/ip_icmp.c
+1-21 files

FreeBSD/src 5b5a10e. .git-blame-ignore-revs

.git-blame-ignore-revs: Fix hash for sys/kern/kern_cpu.c whitespace changes

Really fill in the hash of the MFCed commit, removing the placeholder
I forgot to update before commit.

This is a direct commit to stable/14.

Fixes:          83e087e0ea21 (".git-blame-ignore-revs: sys/kern/kern_cpu.c whitespace changes")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1.git-blame-ignore-revs
+1-11 files

FreeBSD/src 815c439. .git-blame-ignore-revs

.git-blame-ignore-revs: Fix hash for sys/kern/kern_cpu.c whitespace changes

Really fill in the hash of the MFCed commit, removing the placeholder
I forgot to update before commit.

This is a direct commit to stable/15.

Fixes:          bd13516d400b (".git-blame-ignore-revs: sys/kern/kern_cpu.c whitespace changes")
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-1.git-blame-ignore-revs
+1-11 files

FreeBSD/src f594f06sys/dev/acpica acpi_cpu.c

acpi_cpu(4): Call ACPI_GET_FEATURES() on a reset 'features' variable

This is to prevent child drivers from using the features returned by
previous drivers (in an arbitrary order).  None of the existing ones do
that, so this is purely defensive.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 664ad9ac4c9047d29d5f37d43174e1b469e2ec80)
DeltaFile
+2-1sys/dev/acpica/acpi_cpu.c
+2-11 files

FreeBSD/src 45254c2sys/x86/include apicvar.h, sys/x86/x86 local_apic.c

x86/local_apic.c: Fiddle with thermal LVT slot only if supported

The thermal LVT slot does not necessarily exist.

According to Intel's Software Developers Manual, for Intel processors
supporting 64-bit operation (amd64), probably even the earliest ones
should have a local APIC with such a slot (the slot was introduced with
Pentium 4 and Xeon processors according to the manual, and the 64-bit
implementation in some later versions of them).  AMD's Architecture
Programmer's Manual also seems to imply that all AMD processors
supporting amd64 should have the slot too.  So this change may not be
needed when i386's code is dropped, but it does not hurt to have it, and
it might ease possible MFCs.

Change the signature of lapic_enable_thermal() so that it can report
failure (if there is no local APIC or if there is no thermal LVT slot).

Reviewed by:    bnovkov, kib
MFC after:      2 weeks

    [4 lines not shown]
DeltaFile
+16-6sys/x86/x86/local_apic.c
+1-1sys/x86/include/apicvar.h
+17-72 files

FreeBSD/src f02f552sys/i386/include pcpu.h

i386: provide PCPU pc_small_core for amd64 compat

Provide pc_small_core for i386 too to fix an i386 build break from x86
code referring to it.  It won't be set.

Reviewed by:    aokblast, kib
Fixes:  7b26353a59d6 ("hwpstate_intel: Disable package control on hybrid CPU")
Differential Revision:  https://reviews.freebsd.org/D58335

(cherry picked from commit 29d15d658d175139196d821b123c30a5b58e135e)
DeltaFile
+2-1sys/i386/include/pcpu.h
+2-11 files

FreeBSD/src 49f19f3sys/i386/i386 apic_vector.S

i386: supply thermal interrupt handler

This fixes a build break for i386.

Reviewed by:    kib, olce, Koine Yuusuke <koinec at yahoo.co.jp>
Fixes:  87ba088fa310 ("x86/local_apic.c: Add support for installing a thermal interrupt handler")
Differential Revision:  https://reviews.freebsd.org/D58332

(cherry picked from commit cb325dcedfa291c9bfe350a513694df3776a17a4)
DeltaFile
+15-0sys/i386/i386/apic_vector.S
+15-01 files

FreeBSD/src 93dbde1sys/x86/x86 local_apic.c

x86/local_apic.c: Factor out version read and max LVT slot computation

This makes the code slightly more compact and easier to read.

No functional change intended.

Reviewed by:    bnovkov
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58110

(cherry picked from commit 060ecf296664fd150328ac6dcdc24764a427bc3a)
DeltaFile
+36-36sys/x86/x86/local_apic.c
+36-361 files

FreeBSD/src de695c6sys/x86/include apicvar.h, sys/x86/x86 local_apic.c

x86/local_apic.c: Thermal interrupt support: Additional style fixes

Rename handler function type 'lapic_thermal_handle_function' to the
shorter 'lapic_thermal_handler_t'.  Move it closer to the function
declaration block where it is used.  Make it a true function type (no
pointer) and add explicit pointer marks on usage.

Rename 'lapic_thermal_function_value' to the more immediately clear
'lapic_thermal_function_arg'.  In lapic_thermal_enable(), use 'func_arg'
as the argument name for the handler argument, which at least refers to
function 'func', rather than the generic 'value'.

Finally, rename the global handler variable from
'lapic_thermal_function_ptr' to the shorter 'lapic_thermal_function'
(dynamic functions can be referenced only through a pointer).

MFC with:       87ba088fa310 ("x86/local_apic.c: Add support for installing a thermal interrupt handler")
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit e1f4a8cb8656e64a1fe2b1ab519821b14c4985a0)
DeltaFile
+11-11sys/x86/x86/local_apic.c
+4-2sys/x86/include/apicvar.h
+15-132 files

FreeBSD/src 387646csys/conf files.arm64 files.riscv

files: riscv, arm64: Remove redundant 'ofw_cpu.c'

Should have been removed when that line was moved from 'files.arm' to
'files'.

Fixes:          14e1a2cd295d ("Move ofw_cpu file to the main files conf file.")
MFC after:      2 weeks
Event:          Halifax Hackathon 202606
Location:       Seat 36K in AC667, over Maine near Canadian border
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 10213f01773f22ab948ec1e87c880b1d19a1fc45)
DeltaFile
+0-1sys/conf/files.arm64
+0-1sys/conf/files.riscv
+0-22 files

FreeBSD/src 272c6a3sys/amd64/amd64 apic_vector.S, sys/x86/include apicvar.h

x86/local_apic.c: Add support for installing a thermal interrupt handler

The thermal interrupt is initially masked.

Thermal interrupt handling is enabled by calling lapic_enable_thermal(),
which installs a (single) handler.

[olce: Wrote the commit message.]

Reviewed by:    kib, olce
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D44454

(cherry picked from commit 87ba088fa3108dd180008a04f25760ec71476c87)
DeltaFile
+72-2sys/x86/x86/local_apic.c
+8-4sys/x86/include/apicvar.h
+9-0sys/amd64/amd64/apic_vector.S
+89-63 files

FreeBSD/src 952eb3dbin/ps ps.1

ps.1: Fix broken comment line

While here, remove the long-unused dash in the first line.

Reviewed by:    ziaee, olce
Fixes:          ddf144a04b53 ("ps.1: Revamp: Explain general principles, update to match reality")
MFC after:      1 day
Differential Revision:  https://reviews.freebsd.org/D58038

(cherry picked from commit 759ce9a2b38e1de70c14c81dee7e245bf0bc6b94)
DeltaFile
+2-2bin/ps/ps.1
+2-21 files

FreeBSD/src f7b8a6fsys/dev/acpica acpi_hpet.c, sys/x86/include init.h

acpi_hpet(4): Remove unused 'acpi_hpet_disabled' boolean

Same reason as for the previous commit to acpi_cpu(4).  This boolean is
not used anywhere.  Disabling acpi_hpet(4) can be done through the
regular ACPI disable mechanism (using the 'debug.acpi.disabled' tunable,
see acpi_disabled()).

Reviewed by:    emaste (implicit)
Fixes:          ac3ede5371af ("x86/xen: remove PVHv1 code")
MFC after:      3 days
Event:          Halifax Hackathon 202606
Location:       Dalhousie CS Faculty building
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 25df388574ac1d295f4014825de0df1d65cbdc53)
DeltaFile
+1-4sys/dev/acpica/acpi_hpet.c
+0-3sys/x86/include/init.h
+1-72 files