Commit graph

42869 commits

Author SHA1 Message Date
Dmitry Salychev
795e9c9b55
dpaa2: Fix kernel built with ACPI_DEBUG
PR:			282800
Reported by:		phk
Tested by:		bz
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D47666

(cherry picked from commit c2dd2be344)
2024-12-13 21:05:53 +01:00
Bartosz Fabianowski
3c59c4453f ACPI: Treat all 20-element _BIX entires as revision 0
Some Fujitsu Lifebooks return an invalid _BIX object. The first element
of _BIX is a revision number, which indicates what elements will follow:
* ACPI 4.0 defined _BIX revision 0 with 20 elements.
* ACPI 6.0 introduced _BIX revision 1 with 21 elements.
The problem is that the offending Lifebooks have the a non-zero _BIX
revision, but provide 20 fields only.

The ACPICA parser chokes on this [1], but that seems to be
inconsequential. More importantly, our own battery info handling code
also verifies that for revision > 0, there are at least 21 fields - and
refuses to process the invalid _BIX. One workaround would be to
introduce special case / quirk handling for Fujitsu Lifebooks. A better
one is to relax the requirements check: If there are only 20 elements,
treat the _BIX as revision 0, no matter what revision number was
provided by the device.

Linux doesn't run into this problem by the way because it only supports
the 20 fields defined in the ACPI 4.0 spec [3]. It never looks at the
revision number or the 21st field added in ACPI 6.0.

[1] https://cgit.freebsd.org/src/tree/sys/contrib/dev/acpica/components/namespace/nsprepkg.c#n815
[2] https://cgit.freebsd.org/src/tree/sys/dev/acpica/acpi_cmbat.c#n371
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/acpi/battery.c#n418

PR: 252030
Reviewed by: imp
MFC After: 2 weeks

(cherry picked from commit cd8c3af747)
2024-12-06 17:11:27 -07:00
Navdeep Parhar
ada9196f35 cxgbe/t4_tom: Change stid allocation strategy to be more IPv6 friendly.
A hardware IPv6 server needs 2 consecutive stids (server tids) starting
from a 2-aligned stid whereas an IPv4 server needs only 1 stid without
any constraint.  The allocator used to grab the first free stid(s) for
both but this can fragment the stid space leaving nothing suitable for
IPv6 even when lots of stids are available.  Change the allocator to
prefer stids for IPv4 from the ones that cannot be used for IPv6.

Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D47042

(cherry picked from commit f48fb131c2)
2024-12-06 12:34:28 -08:00
Navdeep Parhar
6ae8e077ae cxgbe(4): Fix the name of the 2 x 10/25 OCP card.
Reported by:	Sony Arpita Das @ Chelsio
Fixes:	5c15094916 cxgbe(4): Update the board names of the T6 OCP cards.
Sponsored by:	Chelsio Communications

(cherry picked from commit 878413d559)
2024-12-06 10:23:10 -08:00
Navdeep Parhar
61d74539eb cxgbe(4): Update the board names of the T6 OCP cards.
Sponsored by:	Chelsio Communications

(cherry picked from commit 5c15094916)
2024-12-06 10:22:36 -08:00
Zhenlei Huang
1f6936723e ena: Remove \n from sysctl description
sysctl(8) prints a newline after the description, no need for this extra
newline.

MFC after:	1 week

(cherry picked from commit f2233ac33a)
2024-12-06 21:51:41 +08:00
Augustin Cavalier
d2c306da0e rtwn: Add device ID for TPLink RTL8192CU
(cherry picked from commit 7dfaf23856)
2024-12-04 13:35:12 -05:00
Christos Margiolis
134a275eea sound: Do not access cv_waiters
Remove uses of cv_waiters in PCM_RELEASE and CHN_BROADCAST, and also use
a counter around cv_timedwait_sig() in chn_sleep(), which is checked in
pcm_killchans(), as opposed to reading cv_waiters directly, which is a
layering violation.

While here, move CHN_BROADCAST below the channel lock operations.

Reported by:	avg, jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, avg
Differential Revision:	https://reviews.freebsd.org/D47780

(cherry picked from commit 46a97b9cd6)
2024-12-04 13:03:36 +01:00
Christos Margiolis
63979e82e5 sound: Fix mis-sorted CHN_F_BITS line
Fixes:		5317480967 ("sound: Remove CHN_F_SLEEPING")
Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	jhb, emaste
Differential Revision:	https://reviews.freebsd.org/D47781

(cherry picked from commit 29ba0cc4d9)
2024-12-04 13:03:36 +01:00
Christos Margiolis
2c17a7d8f6 sound: Merge pcm/matrix_map.h with pcm/matrix.h
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47737

(cherry picked from commit 5a217a8d7d)
2024-12-04 13:03:36 +01:00
Christos Margiolis
1b4b19841c sound: Dissolve pcm/intpcm.h
Part of a series of patches to cleanup/simplify pcm/.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47736

(cherry picked from commit 88eaa1504d)
2024-12-04 13:03:36 +01:00
Christos Margiolis
732bb2807d sound: Remove unused code from pcm/g711.h
These routines are already implemented in pcm/intpcm.h.

No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47734

(cherry picked from commit b882251204)
2024-12-04 13:03:36 +01:00
Christos Margiolis
03241eb780 sound: Remove dead code from pcm/
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47733

(cherry picked from commit 00731aaaed)
2024-12-04 13:03:36 +01:00
Christos Margiolis
01f650cb8d sound: Merge ac97 and ac97_patch
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D47732

(cherry picked from commit 0b4e329125)
2024-12-04 13:03:36 +01:00
Kevin Bowling
edf50670e2 e1000: Remove old itr sysctl handler
This implementation had various bugs.  bde@ reported that the unit
conversion/scaling is wrong, and it also does not handle 82574L or
igb(4) devices correctly.

With the new AIM code, it is expected most users will not need to
manually tune this.

If you do need static control:
hw.em.enable_aim=0 for all interfaces at boot or dev.em.X.enable_aim=0
for individual interfaces at runtime and they will track the
hw.em.max_interrupt_rate tunable.  That codepath has been bugfixed for
all supported chipsets.

You may view the current rate with dev.em.X.queue_rx_0.interrupt_rate
which has been bugfixed for all supported chipsets.

If you need to set different rates per interface for some reason let me
know and I will rethink how to add this back.  Otherwise you can leave
AIM on for general purpose interfaces and disable it at runtime on
special purpose low or high latency interfaces that would track
hw.em.max_interrupt_rate if you have a mix of concerns.

PR:		235031
Reported by:	Bruce Evans <bde@FreeBSD.org>
Relnotes:	yes
Sponsored by:	BBOX.io

(cherry picked from commit 4020351325)
2024-12-02 21:01:14 -07:00
Mark Johnston
48155c983c kern: Make fileops and filterops tables const where possible
No functional change intended.

MFC after:	1 week

(cherry picked from commit ef9ffb8594)
2024-12-03 01:03:42 +00:00
Mark Johnston
a5c39c4448 mii_fdt: Search for the "ethernet-ports" subnode
This is a more common name for the parent of the port nodes.

PR:		280770
MFC after:	2 weeks
Reported by:	Mike Belanger <mibelanger@qnx.com>

(cherry picked from commit d6b692835e)
2024-12-03 01:01:59 +00:00
Konstantin Belousov
f16b81e620 mlx5en: only enable to toggle offload caps if they are supported
(cherry picked from commit 4cc5d081d8)
2024-12-03 02:39:23 +02:00
Konstantin Belousov
2657d38625 mlx5en: move runtime capabilities checks into helper functions
(cherry picked from commit cca0dc49e0)
2024-12-03 02:39:23 +02:00
Gleb Smirnoff
7211ab584e mlx5e tls: use non-sleeping malloc flag is it was intended
(cherry picked from commit 67f9307907)
2024-12-03 02:39:23 +02:00
Konstantin Belousov
e6bcfb14f2 mlx5en: fix the sign of mlx5e_tls_st_init() error, convert from Linux to BSD
(cherry picked from commit 0d38b0bc8f)
2024-12-03 02:39:23 +02:00
Konstantin Belousov
75cba37ccf mlx5_en: style function prototype
(cherry picked from commit 64bf5a431c)
2024-12-03 02:39:23 +02:00
Andrew Gallatin
9ff300614b mlx5e tls: Ensure all allocated tags have a hw context associated
(cherry picked from commit 81b38bce07)
2024-12-03 02:39:22 +02:00
Andrew Gallatin
5cd87fd6df mlx5e: Use M_WAITOK when allocating TLS tags
(cherry picked from commit 49597c3e84)
2024-12-03 02:39:22 +02:00
Andrew Gallatin
468d647a5a mlx5e: Immediately initialize TLS send tags
(cherry picked from commit 81dbc22ce8)
2024-12-03 02:39:22 +02:00
Konstantin Belousov
dc75bb8264 acpica: add domain ivar
(cherry picked from commit 7dd1f0dcd1)
2024-12-03 02:39:22 +02:00
Konstantin Belousov
ebe9a47c00 acpica: rename acpi_parse_pxm() to acpi_pxm_parse() and make it non-static
(cherry picked from commit 6f423295f1)
2024-12-03 02:39:22 +02:00
John Baldwin
44eaee18f8 vga_pci: Use bus_generic_* directly instead of wrappers
Differential Revision:	https://reviews.freebsd.org/D47375

(cherry picked from commit c7d29adcb3)
2024-11-30 21:46:08 -05:00
John Baldwin
fa95268aeb Remove bogus detach routines
These drivers are not bus drivers, and would need proper detach
routines that tore down state stored in the softc.  Better to just
fail detach outright instead of an incorrect success.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47389

(cherry picked from commit 7ebc7d1ab7)
2024-11-30 21:46:07 -05:00
John Baldwin
35c71ac2b6 spibus: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47373

(cherry picked from commit 84553ccd0c)
2024-11-30 21:46:07 -05:00
John Baldwin
87bb96bb47 smbus: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47372

(cherry picked from commit 03f641f9b1)
2024-11-30 21:46:07 -05:00
John Baldwin
69cfc0c25d miibus: Use a bus_child_deleted method to free ivars for children
If a device was detached (e.g. via devctl) and then re-attached, the
ivars would be freed by the previous bus_child_detached method during
detach, but device_get_ivars during the subsequent attach would return
a stale pointer resulting in a use after free.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47371

(cherry picked from commit dc569c8942)
2024-11-30 21:46:07 -05:00
John Baldwin
af26e45173 iicbus: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47370

(cherry picked from commit 9c99ba9a06)
2024-11-30 21:46:06 -05:00
John Baldwin
9daf43bd45 gpiobus: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47369

(cherry picked from commit c9e880c0ce)
2024-11-30 21:46:06 -05:00
John Baldwin
bfe10b7712 superio: Use a bus_child_deleted method to free ivars for children
Previously these ivars were leaked.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47367

(cherry picked from commit 2520675d3f)
2024-11-30 21:46:06 -05:00
John Baldwin
8f1c955292 msk/sk: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47365

(cherry picked from commit 2ff5c85027)
2024-11-30 21:46:06 -05:00
John Baldwin
75da188161 ow: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47364

(cherry picked from commit 79dfe2b761)
2024-11-30 21:46:06 -05:00
John Baldwin
02905fab22 nvdimm: Use a bus_child_deleted method to free ivars for children
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47363

(cherry picked from commit 5c7af84925)
2024-11-30 21:46:06 -05:00
John Baldwin
e09c819e6a vf_i2c: Don't hold a mutex across bus_generic_detach
This was also leaking the lock if bus_generic_detach failed.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47221

(cherry picked from commit 13a1dbfed5)
2024-11-30 21:46:05 -05:00
John Baldwin
82ee73e713 ignore_pci: Add a proper stub attach routine
This isn't a bus driver, so an empty attach routine is more appropriate.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47220

(cherry picked from commit f2e50ce0a3)
2024-11-30 21:46:05 -05:00
John Baldwin
1f398acbc9 fixup_pci: Remove unused attach DEVMETHOD
The probe routine always fails, so the attach routine is unused.
However, this weird driver is really a quirk system for PCI and should
be turned into PCI quirks instead.  The Natoma quirk is also broken as
it should be doing a runtime check either on mp_ncpus (or more likely
to see if it is using APIC) instead of #ifdef.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47219

(cherry picked from commit 1cddce89ce)
2024-11-30 21:46:05 -05:00
John Baldwin
b8b100db9f csa: Use pci_find_device to simplify clkrun_hack
Reviewed by:	christos, imp
Differential Revision:	https://reviews.freebsd.org/D47222

(cherry picked from commit f0bc751d6f)
2024-11-30 21:46:05 -05:00
John Baldwin
081207e22c Use bus_delayed_attach_children instead of its inline implementation
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47186

(cherry picked from commit 5201decc8b)
2024-11-30 21:46:05 -05:00
Alexander Motin
7589f9bb75 hwpmc: Restore line lost in previous commit
MFC after:	3 days

(cherry picked from commit de852d78ff)
2024-11-30 19:56:10 -05:00
John Baldwin
367fe30818 cxgbe: Remove most uses of sysctl_wire_old_buffer
Most of these sysctls don't call sbuf_* while holding any locks.  Of
the ones that do hold locks, all but one can be fixed to drop the lock
before calling sbuf_*.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45186

(cherry picked from commit 61089df814)
2024-11-30 08:55:57 -05:00
John Baldwin
13e770f1f0 uio: Use switch statements when handling UIO_READ vs UIO_WRITE
This is mostly to reduce the diff with CheriBSD which adds additional
constants to enum uio_rw, but also matches the normal style used for
uio_segflg.

Reviewed by:	kib, emaste
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D45142

(cherry picked from commit 473c90ac04)
2024-11-30 08:55:57 -05:00
John Baldwin
1fd57c5735 md: Merge two switch statements in mdstart_vnode
While here, use bp->bio_cmd instead of auio.uio_rw to drive read vs
write behavior.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45155

(cherry picked from commit f75764fea3)
2024-11-30 08:55:57 -05:00
John Baldwin
8bebcb2676 speaker: Use standard C bool
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43717

(cherry picked from commit c83d83206a)
2024-11-30 08:55:57 -05:00
Ariel Ehrenberg
b0b932804b mlx5: Fix handling of port_module_event
(cherry picked from commit 253a1fa16b)
2024-11-30 02:34:54 +02:00
Christos Margiolis
0f6a6b2e42 sound: Remove unused CHN_F_SILENCE
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47664

(cherry picked from commit 6d77827b96)
2024-11-29 13:28:07 +01:00