57 Commits
Author SHA1 Message Date
Abdelkader Boudih 6d5c80aee3 xhci: only set the slot context parent hub fields on xHCI 1.2
The Enhanced SuperSpeed meaning of the slot context parent hub slot ID
and port number fields was introduced in xHCI 1.2. Controllers built to
an earlier revision define them only for a Low- or Full-speed device
behind a High-speed hub.

A SuperSpeed device behind a USB 3.2 hub on an Intel Alpine Ridge
controller, an xHCI 1.1 part, stops responding to Address Device and
loops in uhub_reattach_port until the port is disabled.

Fixes:		20b1998254 ("usb: support SSP and SSPx2 xHCI")

Reviewed by:	aokblast, ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D61278
2026-11-07 09:56:13 +00:00
Abdelkader Boudih 4ce90d56a8 asmc: notify the SMC of shutdown and restart
Nothing tells the SMC that a power off or restart was user requested, so
the T2 keeps rebooting the machine thinking the system is wedged.

Approved-by: ngie (co-mentor)

Reviewed by:	ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D61260
2026-11-07 09:14:28 +00:00
Abdelkader Boudih e6fc1765bd nvme: drop the S3X single-outstanding-I/O quirk
The quirk's 8KB transfer clamp exposed raw character-device I/O to
the oversized-mapping stall fixed earlier, and its single tracker
turned a stranded request into a complete I/O stall. Without it an
S3X controller runs 128 trackers at its MDTS-derived transfer size
with no retries, failures, or timeouts, at about seven times the
serialized throughput.

Reviewed by:	imp, adrian, ngie
Approved by:	ngie (co-mentor)
Differential Revision:	https://reviews.freebsd.org/D59156
2026-11-06 09:59:18 +01:00
Abdelkader Boudih 764761d316 nvme: program the arbitration burst from Identify RAB
The controller's Recommended Arbitration Burst was ignored; the
specification advises matching the Arbitration feature's burst to it
even under plain round robin. Some controllers report unusable
values: programming the Apple S3X with its reported RAB wedged
sustained I/O, so quirked controllers keep their default
configuration. The hw.nvme.arb_burst tunable overrides the
recommendation.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D59155
2026-11-06 09:58:08 +01:00
Abdelkader Boudih b3b50cbd46 jail: return a new descriptor from jail_get(JAIL_USE_DESC | JAIL_GET_DESC)
Prior to this change, `jail_get` when called with `JAIL_USE|JAIL_GET_DESC`
would fail to return a valid descriptor in the positive case because the
`JAIL_USE_DESC` block jumped to `found_prison` before the descriptor was
allocated. This resulted in the returned jail descriptor always being -1,
despite the call being successful.

This change fixes the logic so `jfd_out` is properly initialized in the
aforementioned scenario.

MFC after: 3 days

Reviewed by:	jamie, ngie, adrian
Differential Revision:	https://reviews.freebsd.org/D60984
2026-11-02 21:09:55 +01:00
Abdelkader Boudih 6690cbdc64 intel: add a shared header for the LPSS private registers
The Intel Low Power Subsystem wraps its I2C, SPI and UART functions in a
block of private registers that control the functional clock and the
function and DMA resets.

Refactored to use a single header

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60859
2026-10-19 16:15:09 +01:00
Abdelkader Boudih b37e8ffbd9 uart: support Meteor Lake-P LPSS UART 0
Recognize Intel 8086:7e25 using 32-bit MMIO with a four-byte register
stride. Deassert the LPSS functional resets and program the 100 MHz
reference clock divider for a 44.2368 MHz UART clock before the UART
core claims the register window, and reprogram both on resume.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60858
2026-10-19 16:14:58 +01:00
Abdelkader Boudih 4a059dac78 acpi_apple: make the device mode a typed enum
The two mode values were spelled as bit flags, but a device is exactly
one of the two and the dispatch compared the field for equality.

Turned them into an enum, type the softc field with it, and dispatch with
a switch that lists every value

No functional change.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D60793
2026-10-17 20:49:19 +01:00
Abdelkader Boudih 44ceda0a53 acpi_apple: rename source files to match the driver name
The driver, module, kernel option and manual page are all named
acpi_apple, but the sources lived in sys/dev/apple_acpi/ with an
apple_ prefix. Every other vendor ACPI driver in the tree uses the
acpi_<vendor> form for both the directory and the file names.

No functional change.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D60792
2026-10-17 20:48:49 +01:00
Abdelkader Boudih d7d237ce73 acpi_apple: Apple platform ACPI driver,
handles wake-on-LAN arming and lid state on the PCH
PMC/GMUX platform instance, and panel backlight
control on the PNLF instance, registering with
backlight(9).

Reviewed by:	ziaee, adrian
Differential Revision:	https://reviews.freebsd.org/D58867
2026-10-15 14:03:22 +01:00
Abdelkader Boudih 030e556ff8 acpi_lid: add an in-kernel lid state eventhandler
Lid state changes are only published to userland, via devd and evdev.
Drivers that need to react to the lid in the kernel have no hook, so
they end up installing a second ACPI_DEVICE_NOTIFY handler on the same
lid object and reimplementing the _LID evaluation.

Add acpi_lid_event, invoked from acpi_lid_status_update() alongside the
existing devd notification, carrying the new state (1 open, 0 closed).

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D60704
2026-10-13 19:43:56 +01:00
Abdelkader Boudih e8a7efd921 nvme: set the controller Timestamp feature
Controllers that report ONCS.TIMESTAMP keep a millisecond clock that the
host is expected to seed

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59997
2026-10-04 18:41:17 +01:00
Abdelkader Boudih 0a0490ed55 nvme: do not complete a command when its Abort is not performed
An Abort completion with cdw0 bit 0 set means the controller did not
abort the command; the command can still complete later. The driver
treated this as aborted anyway: it completed the command itself and
freed the CID. When the controller completed the command later,
the CID may already belong to a new command, so the new command
finished with the old command's status, or the unknown-cid assertion
fired on INVARIANTS kernels. The watchdog also kept sending a new
Abort for the same command every half second while the first one was
still pending.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59634
2026-10-04 18:40:52 +01:00
Abdelkader Boudih 22f50379ab nvme: delete the I/O queues in the system shutdown path
A normal shutdown deletes all I/O submission and completion queues
before setting CC.SHN, as the suspend path already does.  The
device_shutdown path went straight to the shutdown notification with
the queues live, which some drives take slowly or record as an
unclean stop. Skipped the deletion for failed, removed, or
never-initialized controllers.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59633
2026-10-04 18:40:29 +01:00
Abdelkader Boudih 22039031a1 nvme: name the reserved Identify Controller fields at bytes 102 through 110
Bytes 102 through 110 of the I/O Command Set Independent Identify
Controller data structure were reserved padding.  Name them: Boot
Partition Capabilities (byte 102), CXL HDM Support Information (byte
103), NVM Subsystem Shutdown Latency (bytes 107:104) and Power Loss
Signaling Information (byte 110).  Bytes 109:108 stay reserved.

CXL HDM Support Information was added in NVM Express Base Specification
2.4, Figure 338; the others appear in 2.3, Figure 328.

Report the new fields from nvmecontrol identify.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60000
2026-09-26 09:22:46 +01:00
Abdelkader Boudih 4bfe52650c nvme: share one routine between Delete I/O CQ and Delete I/O SQ
Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60021
2026-09-25 22:42:42 +01:00
Abdelkader Boudih 8a860e8286 nvme: collapse the per-counter qpair statistic sysctl handlers
A single handler that takes the counter's offset
within struct nvme_qpair in arg2.

No functional change

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60020
2026-09-25 22:42:36 +01:00
Abdelkader Boudih 130739e33a nvmf: factor out the pending request abort loop
The routine is entered with the namespace lock held and drops it before
completing the requests, which preserves the existing locking.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60019
2026-09-25 22:42:23 +01:00
Abdelkader Boudih 92dec9201b nvme: share one handler between the interrupt coalescing sysctls
The int_coal_time and int_coal_threshold handlers differed only in which
controller field they updated before reprogramming the feature.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D60018
2026-09-25 22:42:15 +01:00
Abdelkader Boudih b99595c9c7 nvme: derive CC.CSS from CAP.CSS instead of hardcoding the NVM set
CC.CSS was always writting zero, which is a reserved encoding on a
controller that does not support the NVM command set.
Select 111b on admin-only controllers and 110b when the
I/O command set mechanism is available.

Reviewed by:	ngie, imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59628
2026-09-24 15:20:13 +01:00
Abdelkader Boudih 2c41f7d8a0 nvme: honor FLBAS Format Index Upper when selecting the LBA format
Added nvme_ns_data_format_index() in the nvme, nda, and nvmf
host paths as well as nvmecontrol and camdd.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59627
2026-09-24 15:19:51 +01:00
Abdelkader Boudih 34f131f1de nvme: bound the AER error log byte-swap by the fetched length
The Get Log Page request for the error log is clamped to
NVME_MAX_AER_LOG_SIZE, but the byte-swap loop iterated ELPE + 1
entries. A controller reporting more than 63 entries makes the loop
overrun the 4 KiB log page buffer.

Reviewed by:	ngie, imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59626
2026-09-23 19:02:38 +01:00
Abdelkader Boudih ad57f21266 nvme: do not touch INTMS/INTMC when configured for MSI-X
The single-vector MSI-X fallback installs the shared interrupt
handler, which masks interrupts through INTMS/INTMC around the
completion poll.
INTx and MSI are unaffected. Only MSI-X track the interrupt mode
and skip un/masking

Reviewed by:	ngie, imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59637
2026-09-23 19:01:57 +01:00
Abdelkader Boudih 49bb2143f8 committers-src: add myself (seuros@) with adrian as mentor
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59861
2026-09-20 23:24:00 +01:00
Abdelkader Boudih 6ac71529b2 video(4): add extended controls and remaining V4L2 compat symbols
Add the extended control interface

Values match the reference ABI; the new struct layouts are pinned
with static assertions.

Reported by:	thierry

Reviewed by:	adrian, thierry
Differential Revision:	https://reviews.freebsd.org/D59496
2026-09-15 18:30:49 +01:00
Abdelkader Boudih 8e5e2c3910 intel: add hfsts debug-probe driver for Intel ME/HECI firmware status
Add an amd64-only, Intel-only diagnostic driver that reads ME Host
Firmware Status registers from PCI configuration space without mapping the messaging BAR.

Select the HFS register count per device generation, decode sparse
HFS1 state, mode, and error fields, and expose raw and summarized
status via sysctl. Register an ISA-side hfstsfd probe for supported
RCBA/FD2 generations so firmware-hidden HECI functions can be diagnosed.

Reviewed by:	kbowling, adrian
Differential Revision:	https://reviews.freebsd.org/D58863
2026-09-15 18:30:24 +01:00
Abdelkader Boudih 9a46a1439c acpi_cpu: only report unmapped processor objects enabled in the MADT
Firmware expose a DSDT sized for the largest SKU of the platform,
so a verbose boot prints an "ignored" line for every vacant
processor slot. A vacant slot has no enabled MADT entry; a CPU that
failed to come online does.

Reviewed by:	olce, adrian
Differential Revision:	https://reviews.freebsd.org/D59551
2026-09-13 21:48:26 +01:00
Abdelkader Boudih dd9e49a10b intel/intelpmc: Add Intel PMC Core driver
Add driver for Intel Power Management Controller (PMC) found on Sunrise Point PCH chipsets.
This device exposes S0ix sleep state residency counters and power management status.

Sysctls provided:
  dev.intelpmc.0.slp_s0_residency_us - Time in deepest sleep (us)
  dev.intelpmc.0.ltr_ignore          - LTR ignore mask
  dev.intelpmc.0.pm_cfg              - PM configuration register
  dev.intelpmc.0.pm_sts              - PM status register
  dev.intelpmc.0.access_denied       - Firmware lock status

Supported devices for now:
  - Sunrise Point-LP (0x9D21)
  - Sunrise Point-H (0xA121)

Note: Later PCH generations (Cannon Lake, Tiger Lake, ect.) have different PMC register layouts according to the datasheet and would need per-generation tables.
I avoided adding untested hardware in case they have a quirk.

Reviewed by:	olce, adrian
Differential Revision:	https://reviews.freebsd.org/D54881
2026-09-13 21:36:16 +01:00
Abdelkader Boudih 416611f05c nvme: reject namespaces formatted with metadata
The active LBA format's MS field was never examined. I/O to a
metadata-formatted namespace carries neither interleaved metadata
nor MPTR, so every command is malformed, yet the namespace attaches
as a disk with the wrong sector size.

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59625
2026-09-13 20:54:00 +01:00
Abdelkader Boudih 877294a7a7 bsdinstall: allow ZFS root on GPT under UEFI (amd64)
GPT+ZFS+UEFI boots fine, but the manual guided
wizard prevented it.

MFC after: 3 days

Reviewed by:	imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59603
2026-09-12 21:22:57 +01:00
Abdelkader Boudih 9ae680fcfd libjail, jls(8), jail(8): use the JAIL_PARAM_* constants
Replaced hardcoded jail parameter name strings in the base userland
consumers with the JAIL_PARAM_* constants.

No functional change.

Reviewed by:	jamie, adrian
Differential Revision:	https://reviews.freebsd.org/D59577
2026-09-10 20:55:04 +01:00
Abdelkader Boudih 1256447cbc jail: define well-known parameter names in sys/jail.h
Userland jail managers hardcode jail parameter name strings; nothing
in the headers has ever named them, even when sys/jail.h already
has JAIL_META_PRIVATE/JAIL_META_SHARED for the metadata pair.

Added JAIL_PARAM_* string constants for the static parameters registered
by the base kernel.

No functional change.

MFC After: 1 week

Reviewed by:	jamie, adrian
Differential Revision:	https://reviews.freebsd.org/D59572
2026-09-10 20:03:57 +01:00
Abdelkader Boudih 755b9d5393 ng_hci: build the devd notification in a stack buffer
sbuf_new_auto() sleeps, and ng_hci_default_rcvmsg() can run under the
raw HCI socket pcb mutex held across NG_SEND_MSG_PATH().

Reported by:	WITNESS
Fixes:		ad91d47db3

Reviewed by:	glebius, adrian
Differential Revision:	https://reviews.freebsd.org/D59550
2026-09-10 16:25:16 +01:00
Abdelkader Boudih f195b9f3f6 nvme: limit I/O queue trackers to Identify MAXCMD
MAXCMD is the maximum number of commands the controller processes at
one time for a particular I/O queue. Allocating more trackers than
that only queues commands inside the controller. Controllers
reporting 0 are unaffected.

Approved by: ngie (co-mentor)

Reviewed by:	ngie, imp
Differential Revision:	https://reviews.freebsd.org/D59154
2026-09-08 01:20:53 +01:00
Abdelkader Boudih 82f70a0070 nvme: name the Create I/O queue cdw11 fields, use Medium QPRIO
The Create I/O queue commands carried magic 0x1/0x3 cdw11 values, and
the implicit QPRIO of zero classifies every I/O queue Urgent the
moment weighted round robin arbitration is enabled. No functional
change with the round robin default.

Approved by: ngie (co-mentor)

Reviewed by:	ngie, imp, adrian
Differential Revision:	https://reviews.freebsd.org/D59153
2026-09-08 01:20:16 +01:00
Abdelkader Boudih a14a81016b bce_vhci: fix duplicate endpoint queue registration, ratelimit failure logging
bce_vhci_endpoint_create() was registering both the IN and OUT
submission queues on every call, regardless of which direction
the endpoint actually needed.
The per-stage firmware registration failures weren't rate-limited,
so a stuck registration will spam the console.

Tested on:
MacBookPro15,2
Macmini8,1
MacBookPro15,3
MacBookPro16,2

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58831
2026-09-08 01:19:36 +01:00
Abdelkader Boudih e801894294 apple_bce: initiate IN data phase for control transfers
For IN control transfers, the firmware does
not send TRANSFER_REQUEST for the data phase
the host must send BCE_VHCI_CMD_TRANSFER_REQUEST
with an IN DMA buffer once the setup phase completes.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58872
2026-09-06 20:47:44 +01:00
Abdelkader Boudih c0ec1e0e60 apple_bce: fix C_CONNECT_STATUS during port reset
Only set the port change bit when the corresponding status bit
actually transitioned, instead of unconditionally flagging
C_CONNECT_STATUS on every port change event. Also clear any
flaky C_CONNECT_STATUS that the port change taskqueue may have
set while the bus lock was dropped during a successful port reset.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58875
2026-09-06 20:47:44 +01:00
Abdelkader Boudih 13e9b4e5e2 apple_bce: ignore duplicate TRANSFER_REQUEST in STATUS state
Since the host initiates IN data transfers, the
firmware's own TRANSFER_REQUEST for the same phase arrives after
we've already moved to STATUS state. Ignoring  instead of failing
the transfer with USB_ERR_IOERROR.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58873
2026-09-06 20:47:44 +01:00
Abdelkader Boudih ba28690cc6 apple_bce: fix cold boot panic in mailbox send
Poll mailbox reply registers with DELAY() when the system is still
cold, falling back to the interrupt-driven
sema_timedwait path once timers are available.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58871
2026-09-06 20:47:44 +01:00
Abdelkader Boudih ac5440ec24 apple_bce: kick USB explore thread after VHCI attach
Call usb_needs_explore() after attach so the hub explore thread
enumerates all initially connected ports instead of only the first.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58870
2026-09-06 20:47:44 +01:00
Abdelkader Boudih c6db719a54 asmc: add sleep indicator LED control via sysctl
Add dev.asmc.0.sil sysctl to control the SIL LED via SMC keys
MSLD (duty/brightness) and MSLS (state latch, must be set
before re-enabling).

MFC After: 1 week

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D58865
2026-09-06 20:47:44 +01:00
Abdelkader Boudih 7c73fdb618 video: bump __FreeBSD_version for V4L2 camera class renumbering
The camera control IDs in videoio.h changed numeric values; ports
consuming V4L2 camera controls need to be rebuilt.

Reviewed by:	thierry
Differential Revision:	https://reviews.freebsd.org/D59460
2026-09-05 22:18:39 +01:00
Abdelkader Boudih ea7c31ba9d video(4): fix camera control class ABI and add missing V4L2 constants
Renumbered the camera class to match the reference ABI and added the
constants ported applications expect:

Reviewed by:	thierry
Differential Revision:	https://reviews.freebsd.org/D59459
2026-09-05 22:18:13 +01:00
Abdelkader Boudih 125ec0e307 nvme: limit namespace character-device I/O size
The namespace character device does not initialize si_iosize_max, so
physio falls back to DFLTPHYS and can produce a bio larger than the
qpair payload DMA tag on a controller whose maximum transfer size is
below 64KB. Such a bio fails DMA mapping and is never submitted.

Approved by: ngie (co-mentor)
MFC after:	1 week

Reviewed by:	ngie, imp
Differential Revision:	https://reviews.freebsd.org/D59152
2026-09-03 16:34:11 +01:00
Abdelkader Boudih b90c2b13e9 nvme: complete requests when payload DMA mapping fails
bus_dmamap_load_mem() reports most mapping failures, including EFBIG,
only through its callback and then returns zero. nvme_payload_map()
logged the error without telling the submission path, so the tracker
stayed on the outstanding list with no command submitted and no
timeout armed, stalling all later I/O on the queue behind it.

Approved by: ngie (co-mentor)
MFC after:	1 week

Reviewed by:	ngie, imp
Differential Revision:	https://reviews.freebsd.org/D59151
2026-09-03 16:33:49 +01:00
Abdelkader Boudih 4dcb33ebc8 inetd: only declare and use the mapped-address netconfig under INET6
In a WITHOUT_INET6 build the only assignment to netid2 is compiled out and
the non-INET6 arm returns early, so netid2 is unconditionally NULL and the
rpcb_set() call guarded by it is dead code. clang does not prove it dead
and reports nbuf2 as uninitialized where it is passed as a const pointer,

No functional change.

MFC after:	1 week
Reported by:	clang (-Wuninitialized-const-pointer)
Suggested by:   dim
Approved by: ngie (co-mentor)

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D59277
2026-08-31 19:15:45 +01:00
Abdelkader Boudih cd7541977e gpioled: defer gpio pin writes to a taskqueue
led(4) invoked the led_t callback with its mutex held, including from the
blink callout, so the callback must not sleep.

PR: 251032

MFC After: 1 week

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59263
2026-08-29 19:46:23 +01:00
Abdelkader Boudih 51c30180ea video: bump __FreeBSD_version for V4L2 cropping and overlay symbols
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59208
2026-08-27 20:04:47 +01:00
Abdelkader Boudih d5016a8204 video: add V4L2 cropping, control menu and overlay symbols
Adds missing structs symbols for V4L2.

video(4) capture devices do not crop, expose menu controls or support
overlay, and return ENOTTY for the new ioctls.
Applications enumerate these unconditionally and degrade gracefully
at run time, but fail to build when the declarations are missing.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59203
2026-08-27 20:04:47 +01:00
Abdelkader Boudih f22ffd63aa intelspi: add Nova Lake SPI controller IDs
Add PCI device IDs for Nova Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59013
2026-08-26 18:28:54 +01:00
Abdelkader Boudih 59379461f0 intelspi: add Panther Lake SPI controller IDs
Add PCI device IDs for Panther Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59012
2026-08-26 18:28:40 +01:00
Abdelkader Boudih eeb02a9c24 intelspi: add Wildcat Lake SPI controller IDs
Add PCI device IDs for Wildcat Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D59011
2026-08-26 18:14:11 +01:00
Abdelkader Boudih 417d6470cb nvme: limit visible namespaces on Apple S3X
The Apple S3X controller exposes internal namespaces beyond NSID 1
that aren't meant to be visible to the OS. Added QUIRK_APPLE_S3X_NS1_ONLY
and nvme_ctrlr_num_namespaces()/nvme_ctrlr_nsid_visible() helpers, and
route namespace construction, notification, and AER namespace-changed
handling through them instead of a raw cdata.nn count.

MFC after:	1 week

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D58844
2026-08-24 10:02:46 -07:00
Abdelkader Boudih 68323f0a03 nvme: fix Apple S3X controller panic
Serialize S3X I/O and cap dtransfers while keeping namespace handling.
Select 64/128-byte submission queue entries explicitly and set
CC.IOSQES from the same value used for the software queue stride.

When fatal status is set, wait for pending PCIe transactions and then
force FLR so a wedged controller doesn't panic or timeout.

MFC: 1 week
PR: 296946
Fixes: 5e0ba47aa0

Reviewed by:	ngie, imp
Differential Revision:	https://reviews.freebsd.org/D58821
2026-08-24 10:02:27 -07:00
Abdelkader Boudih 16822dac32 acpi_panasonic: Clear wireless RF_KILL on boot and resume
On Panasonic FZ-Y1 and similar models, the EC latches RF_KILL on
shutdown and suspend when battery is at certain level, causing wireless
to boot with hard block.

Call WLSW.SHRF during attach and resume to clear the block.

Tested on Panasonic FZ-Y1 with Intel Wireless 7265.

Reviewed by:	adrian, obiwac
Approved by:	adrian, obiwac
Differential Revision:	https://reviews.freebsd.org/D55265
2026-02-23 17:11:23 +01:00
Abdelkader Boudih 067ad8b31b thunderbolt: Fix tb_pcib device matching to check PCI class
Light Ridge and earlier Thunderbolt controllers reuse the same device ID
(0x1513) for both the NHI (class 0x088000) and PCI bridges (class
0x060400).

Without checking the PCI class, tb_pcib would incorrectly match NHI
devices, causing a panic when trying to attach bridge code to non-bridge
hardware.

Add PCI class check to tb_pcib_find_ident() to only match actual PCI-PCI
bridges (PCIC_BRIDGE/PCIS_BRIDGE_PCI).

Reviewed by:	obiwac, jhb
Approved by:	obiwac, jhb
Fixes:	2ed9833791 (thunderbolt: Import USB4 code)
Differential Revision:	https://reviews.freebsd.org/D55102
2026-02-06 17:13:12 +01:00