aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* acpi_spmc: Simplify constraint freeingAymeric Wibo40 hours1-7/+3
| | | | | | We don't need to check for NULL before calling free(). Sponsored by: The FreeBSD Foundation
* acpi: Print sysctl name in deprecated sleep type warningAymeric Wibo42 hours1-3/+3
| | | | | | | Reported by: markj Fixes: 97d152698f48 ("acpi: Use sleep types defined in sys/power.h") Event: AsiaBSDCon 2026 Sponsored by: The FreeBSD Foundation
* tpm: fix multi-threaded access with per-open stateChuck Silvers2 days5-100/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TPM driver currently has a single buffer per instance to hold the result of a command, and does not allow subsequent commands to be sent until the current result is read by the same OS thread that sent the command, with a timeout to throw away the result after a while if the result is not read in a timely fashion. This has a couple problems: - The timeout code has a bug which causes all subsequent commands to hang forever if a different OS thread tries to read the result before the OS thread which sent the command, and the OS thread which sent the command never tries to read the result. - Even if the first problem is fixed, applications expect to be able to read the result from a different OS thread than the OS thread which sent the command. The particular case that we saw was a go application where the go runtime scheduled the goroutine which read the result to a different OS thread from one where the goroutine that sent the command ran, and there's no way to force these to always run on the same OS thread. Fix all of this by replacing the global result buffer with a per-open result buffer via devfs_set_cdevpriv(), so that we no longer need to block subsequent commands until the results of a previous command are retrieved or care about which OS thread is reading the result of a command. Sponsored by: Netflix Reviewed by: olivier, imp Differential Revision: https://reviews.freebsd.org/D52328
* cxgbe(4): decode the T7 MC interrupt correctlyNavdeep Parhar4 days1-0/+10
| | | | | | | The layout for the main INT_CAUSE is a bit different for T7. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): adjustments to the output of the slow interrupt handlerNavdeep Parhar4 days1-4/+5
| | | | | | | | | | - Display an appropriate alert character instead of a question mark for unknown bits. - Display all fatal bits for a register and not just the ones that are currently set. MFC after: 1 week Sponsored by: Chelsio Communications
* virtio: Ensure power-of-two alignment for indirect queueSarah Walker5 days1-1/+1
| | | | | | | | | | | Some platforms enforce power-of-two alignment for bus_dma tags. Rounding up the natural size may result in over-alignment, but should be safe. PR: 293770 Reviewed by: andrew Fixes: c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55843
* libpmc: Query hwpmc for capsAli Mashtizadeh6 days2-0/+60
| | | | | | | | | | | | | This change allows for fine-grained capabilities per counter index. This is particularly useful for AMD where subclasses are not exposed to the general PMC code, but other architectures also have asymmetric behaviors when it comes to specific counter indices. A new PMC_OP_GETCAPS op is added to the hwpmc(4) ioctl interface. Reviewed by: mhorne Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/2058
* nvme: Replace bus_space_[read|write]_4 with bus_[read|write]_4Matt Delco6 days4-20/+9
| | | | | | | | | | The goal this change is to remove the use of the tag and handle needed by bus_space_[read|write]_4. Fixes: b3d9e5013f3e5 (Don't active memory space) Requested by: jhb Reviewed by: gallatin, imp, jhb, jrtc27 Differential Revision: https://reviews.freebsd.org/D55818
* nvme: Removed unused 'regs' variableMatt Delco6 days3-4/+0
| | | | | | | | | | The private struct has a 'regs' member that's only written to and otherwise unused. This change removes it. Fixes: b3d9e5013f3e5 (Don't active memory space) Requested by: jhb Reviewed by: imp, jhb, jrtc27 Differential Revision: https://reviews.freebsd.org/D55817
* ure(4): Fix spurious link flaps from MIIRafael Kitover6 days1-3/+66
| | | | | | | | | | | | | A race condition in the MII layer causes spurious link down events. In `statchg`, on link down, check if the PHY reports the link as actually down using the BMSR register, if not, force the status of the link to back up and restart TX. Do the same in a MII `linkchg` handler. On actual link up, restart TX in case it went idle and down. PR: 252165 Signed-off-by: Rafael Kitover <rkitover@gmail.com> Reviewed by: pouria Differential Revision: https://reviews.freebsd.org/D55682
* rge: use C style comments instead of C++Christos Longros7 days2-6/+2
| | | | | | | | | | | | | FreeBSD style(9) mandates C style comments. The initial import from OpenBSD left several C++ style // comments in if_rge.c and if_rgevar.h. Replace them with proper /* */ comments. Also fix a malformed comment that mixed // with a closing */. Signed-off-by: Christos Longros <chris.longros@gmail.com> Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D55743
* acpi_system76: Improve sysctl namesPouria Mousavizadeh Tehrani8 days1-10/+11
| | | | | | | | | | | * Improve sysctl descriptions. * Rename battery charging-threshold sysctl for clarity. * Fix mis-spelled words. * Style: sort headers. Reported by: olce, jhb Reviewed by: olce Differential Revision: https://reviews.freebsd.org/D55848
* i6300esbwd: Set error appropriately on eventJustin Hibbits9 days1-1/+2
| | | | | | | | Per the watchdog driver contract, if the driver successfully arms the watchdog it must set error to 0, and if it's unable to arm the watchdog it must leave error alone. Sponsored by: Hewlett Packard Enterprise
* irdma(4): update irdma to version 1.3.56-kBartosz Sobczak9 days29-1005/+1923
| | | | | | | | | | | | | | | | Update Intel irdma driver to version 1.3.56-k Notable changes: - adding E830 support - adding E835 support Signed-off-by: Sobczak, Bartosz <bartosz.sobczak@intel.com> Reviewed by: Andrew Zhu <anzhu@netapp.com> Tested by: Mateusz Moga <mateusz.moga@intel.com> MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D55479
* ix(4): Add EEE support for E610 adaptersKrzysztof Galazka9 days3-27/+112
| | | | | | | | | | | | | | | | | | | | | | The ix driver now supports Energy Efficient Ethernet (EEE) on Intel E610 devices. EEE allows the network interface to enter low-power states during periods of low link utilization, reducing power consumption while maintaining full performance when needed. E610 adapters provide EEE support through BASE-T PHY functionality. Due to this PHY-based implementation, EEE is supported only on 2.5Gb speeds and above. Signed-off-by: Yogesh Bhosale <yogesh.bhosale@intel.com> Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com> Authored-by: Yogesh Bhosale <yogesh.bhosale@intel.com> Approved by: kbowling (mentor) Tested by: Mateusz Moga <mateusz.moga@intel.com> MFC after: 2 weeks Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D55304
* sound: enforce MASTER volume mute during playbackSean Farley10 days1-1/+10
| | | | | | | | | | | | | | | | | | | MASTER mute (vol.mute) works while audio is playing. However, if a stream is stopped and restarted (PCMTRIG_STOP -> PCMTRIG_START), the audio will resume even though the mixer shows the MASTER volume as muted. Other streams that are already playing remain silent. New streams may also start playing audio regardless of the MASTER mute state. The volume feeder now considers the MASTER mute when determining whether a channel should be muted. This ensures MASTER mute is consistently enforced for all streams and removes the dependency on trigger-driven state propagation. Tested with Creative Labs CA0132 card. MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D55605
* hwpmc_amd: fix amd_get_msr() MSR offset for newer counter basesPaulo Fragoso10 days1-3/+33
| | | | | | | | | | | | | | | | | | | | | | The previous code subtracted AMD_PMC_PERFCTR_0 (0xC0010004) from all perfctr MSR addresses to compute a relative offset. This is incorrect for counters using AMD_PMC_CORE_BASE (0xC0010200), AMD_PMC_L3_BASE (0xC0010230), and AMD_PMC_DF_BASE (0xC0010240), producing wrong offsets. Fix by promoting amd_core_npmcs, amd_l3_npmcs, and amd_df_npmcs to static module-level variables and computing the correct flat RDPMC index per AMD BKDG 24594 page 440: ECX 0-5: Core counters 0-5 ECX 6-9: DF counters 0-3 ECX 10-15: L3 Cache counters 0-5 ECX 16-27: DF counters 4-15 ECX > 27: Reserved, returns EINVAL Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne Sponsored by: NLINK (https://nlink.com.br), Recife, Brazil Fixes: 37bba2ad92d8 ("hwpmc_amd: Add support for additional counters") Differential Revision: https://reviews.freebsd.org/D55607
* ena: Update driver version to v2.8.2Arthur Kiyanovski12 days1-1/+1
| | | | | | | | | | | | | | | Bug Fixes: * Verify that an ENA ring is in netmap only in native mode Minor Changes: * Move parenthesis to correct place in switch * Add comment * Reorder define MFC after: 2 weeks Sponsored by: Amazon, Inc. Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D55698
* ena: Verify that an ENA ring is in netmap only in native modeDavid Arinzon12 days1-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netmap operates in two modes: 1) Emulated - netmap handling is done by the network stack, the NIC driver operates transparently to netmap. 2) Native - netmap management is done by the NIC driver. When checking whether a specific ENA ring is running in netmap mode, only the following checks were done: 1. IFCAP_NETMAP - Check whether netmap capability is enabled on the device. 2. NKR_NETMAP_ON - Check whether netmap is actively using this ring. The above checks implied that the netmap mode is native and the ENA driver needs to handle the netmap logic. The code was missing an explicit check on whether native mode is actually on (NAF_NATIVE). This led to a case where though emulated mode was used and a netmap application was turned on, the ENA driver still managed netmap logic partially and caused missing buffers and lack of refill as part of the datapath. Note: Enabling netmap emulated mode is insufficient and there's a need to load a netmap program in order to trigger this use-case. Add an explicit check of whether NAF_NATIVE mode is set. The issue was reported in [1]. [1]: https://github.com/amzn/amzn-drivers/issues/361 Fixes: 358bcc4c6cde ("Add support for ENA NETMAP partial initialization") MFC after: 2 weeks Sponsored by: Amazon, Inc. Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D55697
* ena: Minor changesArthur Kiyanovski12 days2-5/+3
| | | | | | | | | | | 1. Move parenthesis to correct place in switch and fix include order 2. Add comment at the end of an ifdef for clarity 3. Change include order. MFC after: 2 weeks Sponsored by: Amazon, Inc. Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D55696
* virtio: Restore mb() callsSarah Walker12 days1-0/+6
| | | | | | | | | | Until an issue seen on amd64 can be investigated restore two mb() calls to virtio. Reviewed by: andrew Fixes: c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55766
* Revert "virtio: Restore mb() calls"Andrew Turner12 days1-6/+0
| | | | This reverts commit d99e725c26a7745aa349eab01ae56ca630b6d0f5.
* virtio: Restore mb() callsAndrew Turner12 days1-0/+6
| | | | | | | | | | Until an issue seen on amd64 can be investigated restore two mb() calls to virtio. Reviewed by: andrew Fixes: c499ad6f997c ("virtio: Use bus_dma for ring and indirect buffer allocations") Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55766
* pci: Export bus numbers for bridge devices in struct pci_confJohn Baldwin12 days2-1/+34
| | | | | | | | | | | This exports bus information about bridges to userspace via the less-privileged PCIOCGETCONF ioctl. Previously if userspace wished to query this information, it had to use direct PCI config register access which requires higher privilege. Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D55771
* usb: umass: add SCSIEJECT quirk and fix RTW8821CU_CD (USB mode switch)Bjoern A. Zeeb13 days2-2/+57
| | | | | | | | | | | | | | | | | | | | | Several Realtek (and lots other) USB dongles present themselves as CDROM device first. Upon eject they do a mode switch and suddenly are a different kind of device (sometimes even with different IDs), e.g., a wireless dongle. In order to avoid the CDROM stage and rather than adding the quirk handling to more drivers, add support to umass and if enabled automatically eject the "CDROM" to make it the real device. Longer-term some other drivers could stop using their hand-rolled support for this. It is unclear as-to how much we need the list of (eject) quirks from u3g here, or if these are very specific to that kind of devices. Sponsored by: The FreeBSD Foundation Fixes: b3b6a959c85a, 9c0cce328363 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D54901
* acpi_system76: Add backlight(9) support for keyboardPouria Mousavizadeh Tehrani13 days1-0/+145
| | | | | Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D55716
* acpi_system76: Add support for battary charge thresholdsPouria Mousavizadeh Tehrani13 days1-31/+116
| | | | | Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D55710
* cxgbe(4): minor changes in code dealing with ncoresNavdeep Parhar14 days2-12/+12
| | | | | | | | | 1. ncores and devlog information is read as a combination so it makes sense to validate them in the same routine (and nowhere else). 2. ncores is never 0 and idx % ncores is always a valid coreid. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe: Shrink the size of csum_typesNavdeep Parhar2026-03-081-1/+1
| | | | | | | The checksum types fit in 4b and don't need a full 32b int. MFC after: 1 week Sponsored by: Chelsio Communications
* acpi_system76: unbreak LINTPouria Mousavizadeh Tehrani2026-03-071-0/+2
| | | | | | Reported by: tinderbox Fixes: cdad55809ef5 ("acpi_system76: Support for ...") Differential Revision: https://reviews.freebsd.org/D55694
* acpi_system76: Support for acpi-controlled buttons on System76Pouria Mousavizadeh Tehrani2026-03-071-0/+359
| | | | | | | | Add acpi_system76 for handling acpi-controlled buttons on System76 Laptops. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55694
* Add ASMC support for Macbook Pro 8,3tslight2026-03-072-0/+39
| | | | | | Signed-off-by: tslight <tslight@pm.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1992
* use ASMC_FAN_FUNCS2 to avoid trying to read non-existent keystslight2026-03-071-1/+1
| | | | | | Signed-off-by: tslight <tslight@pm.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2051
* nvme: Don't active memory space until all BARs are configuredMatt Delco2026-03-061-7/+37
| | | | | | | | | | | | | | | In the current current behavior the 2nd and 3rd BARs can be activated when they're configured with address zero. This change defers the activation of all BARs until after they've all been configured with an address. This enables FreeBSD on Google Compute Engine C4-LSSD Machines. Sponsored by: Google Tested by: NetApp (previous version) Reviewed by: gallatin, imp Discussed with: jrtc27 (improved error reporting) Differential Revision: https://reviews.freebsd.org/D55541
* iwx: Re-activate the 32-bit boundary cross check on 64-bit architecturesOlivier Certner2026-03-061-3/+3
| | | | | | | | | | __SIZEOF_*__ is in bytes, not in bits... Reported by: brooks Fixes: 35da55c28dbb ("iwx: Fix 32-bit compilation") MFC after: 1 minute MFC to: stable/15 Sponsored by: The FreeBSD Foundation
* iwx: Fix 32-bit compilationOlivier Certner2026-03-051-6/+17
| | | | | | | | | | | | | | - Avoid shifts wider than integer types, by wrapping the corresponding checks into '#if __SIZEOF_SIZE_T__ > 32' blocks. 'bus_addr_t' currently has the same width as 'size_t' on all architectures (and this is not going to change for 32-bit architectures). - Use appropriate printf(3) format for 'wk_keytsc'. Reviewed by: adrian MFC after: 1 minute MFC to: stable/15 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55667
* acpi: Don't attach a "wake" sysctl node to devices without the ACPI flags IVARJohn Baldwin2026-03-051-1/+1
| | | | | | | | | | | | | Not all bus drivers for ACPI-aware devices implement the ACPI flags IVAR used by the acpi_wake_set_sysctl handler. In some cases this may be a feature as some new-bus devices share the same ACPI handle (e.g. a pcibX device and its child pciY device) which can lead to confusing results (e.g. setting the sysctl on pciY changes the behavior of the parent pcibX device, but the "wake" sysctl for pcibX won't reflect the new behavior, or reflect the device's state). Reviewed by: obiwac, ngie, imp Differential Revision: https://reviews.freebsd.org/D55562
* static dtb: add BTI noteRuslan Bukin2026-03-051-0/+7
| | | | | | | | | | | Add BTI note to fdt_static_dtb.o - resolves "Branch Target Exception" panic on FDT systems with static DTB due to missing landing pads (bti note has to be in all object files used for linkage) - also required by bti_report linker feature Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D55636
* hid: Fix 'strenght' typo in hpen.cMajed Alkhaleefah2026-03-041-3/+3
| | | | | | | Reviewed by: wulf, obiwac Approved by: wulf, obiwac Fixes: d97d5c0ce89d ("hid: Import hidmap-based drivers written by Greg V") Differential Revision: https://reviews.freebsd.org/D55626
* acpi: Treat ACPI_IVAR_FLAGS as a global IVARJohn Baldwin2026-03-041-2/+2
| | | | | | | | | | | The ACPI bus uses the flags IVAR for any device with a _PRW method including devices such as PCI bridges/devices that are not direct children of acpi0. Reported by: ngie Reviewed by: ngie Fixes: 0bb867e9f565 ("acpi: Split ACPI IVARs into global and private sets") Differential Revision: https://reviews.freebsd.org/D55561
* amdsmu: Sleep entry/exit hints for PMFWAymeric Wibo2026-03-043-3/+57
| | | | | | | | | | | | | | | amdsmu_suspend() and amdsmu_resume() for sending hints to the AMD SMU power management firmware (PMFW) that we are entering and exiting s2idle. We also dump sleep metrics once we tell it we're exiting sleep, so the relevant metrics are updated. Register these as acpi_post_dev_suspend and acpi_post_dev_resume eventhandlers. Reviewed by: olce Approved by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48721
* acpi_spmc: fix revision check reading name as integerOlivier Cochard2026-03-031-2/+2
| | | | | | | | | | | | | | | In acpi_spmc_get_constraints_spec(), the revision of the device constraint detail package was mistakenly read from constraint_obj->Package.Elements[0], which is the device name (a string), instead of from the detail sub-package's first element. Move the initialisation of 'detail' before the revision check and read the revision from detail->Package.Elements[0] as the comment already states Approved by: obiwac Differential Revision: https://reviews.freebsd.org/D55639 Sponsored by: Netflix
* nvme_sim: Fix a cut and paste errorWarner Losh2026-03-031-1/+1
| | | | | | | | Fix the error message in nvme_sim_ns_removed that was cut and pasted from nvme_sim_ns_changed to reflect its new home. No functional change. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D55522
* virtio_blk: Use bus_dma for command/ack buffer allocationsSarah Walker2026-03-031-39/+182
| | | | | | | | | | | | | While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew, br Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54960
* virtio: Use bus_dma for ring and indirect buffer allocationsSarah Walker2026-03-032-34/+209
| | | | | | | | | | | | | While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54959
* sound: Notify devd when no devices are connectedChristos Margiolis2026-03-031-0/+2
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55531
* sound: Notify devd on hw.snd.default_unit changeChristos Margiolis2026-03-031-0/+7
| | | | | | | | | | | | | | | If we have virtual_oss running, this devd notification will make sure to automatically transfer sound to the new default unit, while also making sure that we switch to it only for the supported directions (recording and/or playback). For more information, please refer to 2ffaca551eaf ("snd_hda: Implement automatic redirection between associations"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D55530
* sys: Retire le(4)Ed Maste2026-03-0211-4337/+0
| | | | | | | | | | | | | | | | We retired most obsolete 10 and 10/100 Ethernet NIC drivers in 2019 -- see commits following ebcf740a32ae ("FCP-101: remove obsolete 10 and 10/100 Ethernet drivers.). le(4) was retained with with the note "Emulated by QEMU, alternatives don't yet work for mips64." MIPS has since been removed from the tree and emulators and virtual machines offer many other, more suitable devices. Reviewed by: brooks Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D55516
* virtio: add loader tunables to sysctlTimo Völker2026-03-023-2/+16
| | | | | | | | | | virtio_pci uses two loader tunables that should be more visible. This patch adds these loader tunables to sysctl and describes them in the virtio(4) man page. Reviewed by: imp (erlier version), tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D55533
* asmc: output the SMC firmware revision on attachEnji Cooper2026-03-012-2/+12
| | | | | | | | | | | | | | | | The SMC firmware revision can prove helpful when determining why the behavior of a given controller varies from the maintainers' expected behavior. This should be a sysctl (eventually), but for now dumping out the information via `device_printf(..)` suffices, given that only one asmc(4) compatible device can exist in an Apple platform at any given point in time. This will become a sysctl in the future after additional improvements are incorporated from OpenBSD and NetBSD. MFC after: 1 week Obtained from: https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064) Differential Revision: https://reviews.freebsd.org/D55577