Commit graph

43595 commits

Author SHA1 Message Date
Konstantin Belousov
4c2795340e mlx5 ipsec: fix typo in the message
Sponsored by:	NVidia networking
2025-02-09 02:19:32 +02:00
Tore Amundsen
89d4096950 ixgbe: Add support for 1000BASE-BX SFP modules
Add support for 1Gbit BiDi modules

Signed-off-by:	Tore Amundsen <tore@amundsen.org>
MFC after:	1 week
Relnotes:	yes
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1518
2025-02-08 17:06:33 -07:00
Ahmad Khalifa
d3b1dcb408 acpi_iicbus: install the address space handler by default
Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>

Reviewed by:	wulf
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1583
2025-02-07 18:20:00 +00:00
Bojan Novković
e17e33f997 sdhci: Refactor the generic FDT driver
This patch refactors the 'sdhci_fdt.c' driver by moving all vendor
specific routines into separate files and making the base 'sdhci_fdt'
driver subclassable. The goal is to make adding new FDT-based drivers
easier and more maintainable. No functional change intended.

Reviewed by:	manu, imp
Differential Revision:	https://reviews.freebsd.org/D48527
2025-02-07 10:06:07 +01:00
Gordon Bergling
84e3ffac12 mlx4ib(4): Fix some typos in device messages
- s/availible/available/

MFC after:	5 days
2025-02-05 11:31:12 +01:00
Warner Losh
f52154a204 hptrr: Better error recovery
This bug and https://www.mail-archive.com/freebsd-stable@freebsd.org/msg124458.html
both have this fix. It turns unknown errors into an autosense failure, which causes
us to grab the sense buffer manually. It also sets a condition that we use to retry
timed out commands that jmg reports as being helpful.

I'm torn on committing it. The code seems fine in terms of fixing
things. But this is a 10-year-old bug with few other bugs and a short CC
list for a driver that might go away in 15 anyway. I'm going to commit
and close the bug, and MFC it in a week, unless someone complains (which
seems unliekly, given the age of this hardware, I susepct most of it is
out of service).

Suggested by: jmg, Scott Long
PR: 191135
MFC After: 1 week
Reviewed by: imp
2025-02-04 18:38:02 -07:00
Fuqian Huang
5b900bd26a mpt: replace mpt_prt with mpt_lprt in mpt_cam.c
Replace mpt_prt with mpt_lprt with DEBUG level to print kernel pointers
only at the debug level.

PR: 238662
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: imp
2025-02-04 17:47:21 -07:00
Fuqian Huang
d9beef938a mpt: print req->index rather than the pointer itself in mpt.c
Print req->index instead of printing the pointer itself to avoid kernel
pointer leakage.

PR: 238661
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: imp
2025-02-04 17:47:21 -07:00
Wei Hu
da1deb784d Hyper-V: hn: rewrite hn rsc swtich to avoid sysctl hang
Changing the rsc_switch flag using sysctl to turn rsc on or off
could hang. The orignal code sends request to host to get the
mtu setting. Sometimes the host fails to reply, causing
the thread to sleep forever waiting for the host response.

Use existing cached mtu from hn device instead to avoid calling
host.

Reported by:	whu
Tested by:	whu
MFC after:	1 week
2025-02-04 13:39:14 +00:00
Jesper Schmitz Mouridsen
c14b016242 mt7601U: Importing if_mtw from OpenBSD
Added ht20 mode, based on if_run from FreeBSD, and if_mtw.c
from OpenBSD.

PR: 247545
Approved by:	adrian, wireless
Differential Revision: https://reviews.freebsd.org/D45179
2025-02-03 20:20:52 +01:00
Warner Losh
fdaf7d0fe1 umass: Print quirks with %b
Print the quirks in a more human-readable form. When testing a dozen
different removeable devices, the hex numbers quickly blur...

Sponsored by:		Netflix
2025-02-03 10:25:27 -07:00
Warner Losh
6f659c9a49 pci: Change device to function
It's functions that are placed into D3 for these value, not the device.

PR: 259703
Sponsored by:		Netflix
2025-02-02 10:26:04 -07:00
Warner Losh
d889926162 isci: Remove dead code
This code hasn't compiled for years, so just remove it.

PR: 229954
Sponsored by: Netflix
2025-02-02 10:18:35 -07:00
Warner Losh
5a8caf9bfa bce: make compile with BCE_DEBUG
Builds now with BCE_DEBUG defined. All bets are of as to whether or not
it works though. This is not the default, and likely quite a rare config
given (a) it's been broken for years and (b) this is an old card people
aren't actively debugging anymore. I don't have the hardware to test it,
though I've not changed anything in the BCE_DEBUG undefined case.

Sponsored by:		Netflix
2025-02-02 09:57:01 -07:00
Warner Losh
5deab77bb6 bce: Fix register dumping to skip blank area
When compiling with debug enabled, this produces an always false
warning. It's clear that this was to skip ranges that aren't used when
dumping the registers, so change the && to || to skip things properly.

PR: 200984
Sponsored by:		Netflix
2025-02-02 09:49:15 -07:00
Svyatoslav
ead758a67a pms: Fix always true condition
Although this is vendor code, and apparently abandoned vendor code at
that, this is clearly a mistake and always true. It's unclear how to
contribute back to the upstream at this point, alas.

PR: 217745
Reviewed by: imp
2025-02-02 09:35:51 -07:00
Dmitry Luhtionov
64dcfa2593 ig4(4): Add Intel ACPI HID
MFC after:	1 month
2025-02-02 10:25:18 +03:00
Bjoern A. Zeeb
95ea57c856 LinnuxKPI: drm2: retire timespec_to_jiffies()
Linux has removed timespec_to_jiffies() half a decade ago [1].
I cannot find any use of it anymore in recent drm-kmod branches
or in the tree so retire it.

While here also retire it from drm2.

Reported by:	emaste (D48318) [1].
Sponsored by:	The freeBSD Foundation
MFC after:	2 weeks
Reviewed by:	emaste, dumbbell (tested all drm-kmod versions, thanks!)
Differential Revision: https://reviews.freebsd.org/D48379
2025-02-01 00:47:30 +00:00
John Baldwin
38e1083940 nvmf: Add NVMF_CONNECTION_STATUS ioctl
This returns an nvlist indicating if a Fabrics host is connected and
the time of the most recent disconnection.

Reviewed by:	imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D48219
2025-01-31 15:47:58 -05:00
John Baldwin
4298ce72f6 nvme/nvmf: Add NVME_GET_CONTROLLER_DATA ioctl to fetch cached cdata
Both nvme and nvmf cache a copy of the controller's identify data in
the softc.  Add an ioctl to fetch this copy of the cdata.  This is
primarily useful for allowing commands like 'nvmecontrol devlist' to
work against a disconnected Fabrics host.

Reviewed by:	dab, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D48218
2025-01-31 15:46:49 -05:00
John Baldwin
17b7a0c595 nvmft: Don't offline a port being removed if it is already offline
This is generally harmless but can trigger spurious warnings on the
console due to duplicate attempts to disable LUNs.

Sponsored by:	Chelsio Communications
2025-01-31 15:13:52 -05:00
Jean-Sébastien Pédron
c118e4da12
pci: Add pci_find_base_class_from()
[Why]
linuxkpi needs to export `pci_get_base_class()` for DRM drivers from
Linux 6.7.

[How]
This new function searches a PCI device with the given base class and
returns it, regardless of its subclass.

The behavior is the same as `pci_find_class_from()` but the subclass is
ignored.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48745
2025-01-31 17:00:47 +01:00
Andrew Gallatin
36fdc42c6a mlx5en: Fix SIOCSIFCAPNV
In 4cc5d081d8, a change was introduced that manipulated
drv_ioctl_data->reqcap using IFCAP2 bits.  This was noticed
when creating a mixed lagg with mce0 and ixl0 caused the
interfaces' txcsum caps to be disabled.

Fixes: 4cc5d081d8
Reviewed by: glebius
Sponsored by: Netflix
MFC After: 7 days
2025-01-30 20:57:35 -05:00
John Baldwin
c06b504def simplebus: Stop accepting SYS_RES_IOPORT resources
Child devices handling I/O port resources (such as PCI-e bridges)
should map those to a memory resource and pass up a request for the
translated memory resource.

Differential Revision:	https://reviews.freebsd.org/D48501
2025-01-29 10:03:37 -05:00
Warner Losh
c64b3f32a5 umass: Add comment for ASC/ASCQ 24h/00h INVALID FIELD IN CDB
Add a comment for what this asc/ascq combo means. Very few people have
this memorized.

Sponsored by:		Netflix
2025-01-28 13:08:51 -07:00
Ed Maste
8b012980b8 Revert "oce(4): deprecate"
These are reportedly still in fairly wide use.

We strongly encourage folks with this hardware to post a dmesg on
dmesgd.nycbug.org.

This reverts commit 4591322980.

Discussed with:	brooks
Sponsored by:	The FreeBSD Foundation
2025-01-27 12:06:21 -05:00
Gordon Bergling
b0c318efdd smartpqi(4): Fix a typo in a source code comment
- s/isnt/isn’t/

MFC after:	3 days
2025-01-26 13:09:34 +01:00
Gordon Bergling
6fbf8502a5 ath(4): Fix a typo in a source code comment
- s/isnt/isn’t/

MFC after: 3 days
2025-01-26 13:08:23 +01:00
Brian Poole
b2a49e88d1 intpm: use MMIO for AMD EFCH CPUs
Recent AMD CPUs (SMBus PCI revision ID >= 0x51) can disable port-mapped
IO and only support memory-mapped IO. In practice this was observed on a
Zen 3 CPU where PMIO reads all returned 0xff. Update the driver to use
MMIO for these processors while continuing to use PMIO by default.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1437
2025-01-24 14:42:40 -07:00
Ahmad Khalifa
b72ae900d4 sys: make the kernel metadata pointer global
The way we got the kernel metadata pointer was by calling
preload_search_by_type with one of the following three: "elf kernel",
"elf32 kernel" and "elf64 kernel". Which one(s) we used wasn't
consistent though. Sometimes we would only try "elf kernel", and other
times we would try one of the latter two if the first failed. However,
the loader only ever sets "elf kernel" as the kernel type.

Now, the kmdp is a global, preload_kmdp, and it's initialized using
preload_initkmdp in machdep.c (or machdep_boot.c on arm/64).
preload_initkmdp takes a single boolean argument that tells us whether
not finding the kmdp is fatal or not.

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
2025-01-24 14:25:51 -07:00
Krzysztof Galazka
3ad01642fe iflib(4): Replace admin taskqueue group with per-interface taskqueues
Using one taskqueue group with single thread to execute all admin
tasks may lead to unexpected timeouts when long running task (e.g.
handling a reset after FW update) for one interface prevents
tasks from other interfaces being executed. Taskqueue group API
doesn't let to dynamically add threads, and pre-allocating thread
for each CPU as it's done for traffic queues would be a waste
of resources on systems with small number of interfaces. Replace
global taskqueue group for admin tasks with taskqueue allocated
for each interface to allow independent execution.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1336
2025-01-24 14:08:12 -07:00
FUKAUMI Naoki
dc273058cb ure(4): Add support for ELECOM EDC-QUA3C
ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter.
This also works as a cdce(4) device by:

usbconfig -d X.Y set_config 1
  or
usbconfig -d X.Y set_config 2

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1578
2025-01-24 19:25:11 +00:00
Andrew Turner
dbedcc169f acpi: Mark the GED ithread as sleepable
We need to complete calling the ACPI method before marking the interrupt
as complete. If two threads are inspecting the ACPI tables at the same
time they may both try to lock the ACPI mutex causing one to sleep. If
this is the ithread it will panic the kernel as this is not allowed.

Update the ged ithread to allow sleeping as it is expected this lock
will be uncommon enough any sleep will be short.

PR:		283103
Reviewed by:	markj (earlier version)
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48284
2025-01-24 15:08:09 +00:00
John Baldwin
8bba2c0f89 nvmf: Refactor reconnection support
Save more data associated with a new association including the network
address of the remote controller.  This permits reconnecting an
association without providing the address or other details.  To use
this new mode, provide only an existing device ID to nvmecontrol's
reconnect command.  An address can still be provided to request a
different address or other different settings for the new association.

The saved data includes an entire Discovery Log page entry to aim to
be compatible with other transports in the future.  When a remote
controller is connected to via a Discovery Log page entry (nvmecontrol
connect-all), the raw entry is used.  When a remote controller is
connected to via an explicit address, an entry is synthesized from the
parameters.

Note that this is a pseudo-ABI break for the ioctls used by nvmf(4) in
that the nvlists for handoff and reconnect now use a slightly
different set of elements.  Since this is only present in main I did
not bother implementing compatability shims.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D48214
2025-01-24 09:43:19 -05:00
Andrew Turner
0c333f8c6e psci: Support the arm64 Errata ABI
Add support for the Arm Errata Management Firmware Interface (Errata
ABI) [1]. This provides an interface for the kernel to query the status
of an erratum workaround.

Some errata may be mitigated depending on the other hardware in a SoC,
e.g. Cortex-A78 erratum 2712571 is not affected in systems that use
an Arm interconnect. As there may not be a way for the kernel to know
if this is the case then it would have to implement the workaround
even when not needed.

There are other cases where the needed workaround is implemented in
firmware and if not implemented then the kernel may decide to not use
a feature. In this case we can query the firmware before deciding if
we should use a feature or now.

There is a known issue with some firmware implementations of the Errata
ABI that incorrectly returns a status indicating the erratum is fully
mitigated by the firmware, however there is a kernel component needed,
e.g. Neoverse-N1 erratum 1542419. To handle this case we tell the
caller there is some workaround implemented in the firmware and it can
decide how to handle it. If this is fixed in a way we can detect we can
add a new erratum status value to indicate this.

[1] https://developer.arm.com/documentation/den0100/latest/

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48055
2025-01-24 12:09:28 +00:00
Mitchell Horne
5884fab461 pci: cleanup __PCI_REROUTE_INTERRUPTS
This flag was used as a transition for differing pcib implementations.
Today it is defined for all supported architectures, and can be removed.

Reviewed by:	imp, jhb
Differential Revision:	https://reviews.freebsd.org/D48485
2025-01-23 16:30:31 -04:00
Cristian Marussi
e6d0edd2fe scmi: Add sysctl transport properties
Expose as read-only the configured transport properties.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47428
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:27 +00:00
Cristian Marussi
984f9fb81a scmi: Add SDT traces to the core stack
Add a few basic traces to track SCMI messages lifecycle.

Tested on:      Arm Morello Board
Reviewed by:	Andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47427
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:27 +00:00
Cristian Marussi
b802926b7b scmi: Add optional asynchronous handling of replies
Add the core logic to handle the replies to pending command in an
asynchronous manner.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47426
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:27 +00:00
Cristian Marussi
341d8fd90f scmi: Refactor scmi_request internal logic
Split scmi_request internals into a TX and an RX phase, which will be
called, anyway, in sequence as before when a normal transmission is
requested.

No functional change.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47425
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:27 +00:00
Cristian Marussi
c508841dfc scmi: Add scmi_token_reserve helper
During normal operation, the SCMI stack, upon each transmission attempt,
takes care to automatically pick an appropriate, monotonically increasing,
sequence number to fill-in the token field in the egressing message.

This does not cope well with the alternative scenario in which, instead,
a complete and fully formed message is provided upfront: in such a case the
SCMI stack will have to use the already provided sequence number, embedded
in the message, to track such transaction.

Add a method to attempt to reserve a specific sequence number to be used
when a fully firmed (raw) message is handled.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D47424
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:27 +00:00
Cristian Marussi
e887179d4b scmi: Add helper to manipulate scmi_msg descriptors
Refactor allocation logic for scmi_req and introduce new helpers to be able
to obtain an scmi_msg reference to a freshly allocated request.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47423
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Cristian Marussi
103ea03e67 scmi: Add devicetree transport properties
SCMI transport characteristics can be optionally described in the
devicetree to override the default build-time values.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47422
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Cristian Marussi
f021623949 scmi: Redefine max message payload size
The defined maximum payload size should not include header and status
field. Fix the definition accordingly, so that it matches the
definitions as can be found in the Linux SCMI stack.
The semantic of this define is important since it will then be possible
to override such values from devicetree, like in Linux.

Tested on:	Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47421
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Cristian Marussi
9342829d57 scmi: Make transports report the effective length of the received messages
Once a message is received that fits into the RX buffer, update the
msg.rx_len field with the effective length of the message received.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Pull Request:	https://reviews.freebsd.org/D47420
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Cristian Marussi
c56e586f0f scmi: Fix race on timed out transmissions
When a waited-for outstanding request is determined to have timed out,
mark such request immediately as such, so as to avoid any possible race on
the IRQ path with code path evaluating that same timed out condition.

Tested on:      Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47419
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Cristian Marussi
00b77e631b scmi: Fix token bitmask
By the SCMI specification the message sequence number field is 10-bit long.
Fix accordingly the used bitmask.

Fixes: d220b1cf02 ("scmi: Extend and refactor SCMI shmem support")
Tested on:	Arm Morello Board
Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D47418
Signed-off-by:	Cristian Marussi <cristian.marussi@arm.com>
2025-01-23 17:26:26 +00:00
Andrew Turner
23f025e24b scmi: Fix the scmi_shmem module name
This fixes the "module scmi already present" message on boot.

Sponsored by:	Arm Ltd
2025-01-23 17:26:24 +00:00
Adrian Chadd
043d6a24b2 rtwn: add workaround sleep in r92e_set_chan()
It /looks/ like there's some weirdness in initial frame send after
the chip programming / channel change.  Linux rtl8xxxu has no sleeps
here, instead it just retries the auth frame a few times.

My guess is there's some sequencing going on here between finishing
the programming, doing a calibration run and then sending the initial
frame.

Instead of doing sleeps on every write during the RF channel change,
this 10ms sleep at the end is enough to reliably associate in my
test environment (12-core intel laptop, USB-3 port.)  It's not
required for an earlier 2-core haswell laptop w/ USB-3.

See the PR for more information.

PR:		kern/247528
Differential Revision:	https://reviews.freebsd.org/D48517
2025-01-22 13:46:57 -08:00
Adrian Chadd
5f9a2eec33 rtwn: bring the RTL8192EU RF read/write routines in line with rtl8xxxu
The Linux rtl8xxxu driver has more delays in the RF read and write
path.

It looks like for writes it's ensuring the hardware is out of
power save and that the transition has properly occured.

And it looks for reads that it wants a delay after some bit setting,
likely some shifting into the RF register space is occuring with
a bit set/clear to trigger a load.

See rtl8xxxu_write_rfreg() and rtl8xxxu_read_rfreg() for more
information.

Differential Revision:	https://reviews.freebsd.org/D48512
Obtained from:	Linux rtl8xxxu
2025-01-22 13:46:57 -08:00