aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* mpi3mr: Add NVData Parameter for Host Timestamp SynchronizationChandrakanth patil2025-04-283-2/+362
| | | | | | | | | | | | The driver now retrieves the Time Stamp value from Driver Page 1 during load and after controller reset. If the value is valid, it is used to enable periodic host timestamp synchronization. This adds a tunable NVData parameter to control the behavior of host time sync, enhancing flexibility and platform-specific control. Reviewed by: ssaxena, imp Differential Revision: https://reviews.freebsd.org/D49748
* mpi3mr: Handle Insufficient Power Fault CodeChandrakanth patil2025-04-281-11/+39
| | | | | | | | | | | | | | | The driver now checks for insufficient power faults during the load phase and immediately fails initialization instead of retrying. Additionally, if an insufficient power fault is detected by the watchdog after the controller is up, the controller is marked as unrecoverable instead of triggering a reset. This improves fault handling and avoids unnecessary recovery attempts in low-power conditions. Reviewed by: ssaxena, imp Differential Revision: https://reviews.freebsd.org/D49747
* mpi3mr: Enhance Controller Enable Retry Logic in Host DriversChandrakanth patil2025-04-281-98/+118
| | | | | | | | | | | | | | | This patch improves the retry logic during the IOC enable process. If a controller faults or if the reset history bit is detected during the ready status check, the driver will retry initialization up to three times or until 510 seconds have passed. A soft reset will also be issued if the controller is detected while waiting for the ready status. This enhances reliability during controller initialization. Reviewed by: ssaxena, imp Differential Revision: https://reviews.freebsd.org/D49746
* mpi3mr: Set Driver Capability for OS Exposure in IOCInitChandrakanth patil2025-04-281-1/+1
| | | | | | | | | This patch updates the driver to set the OSExposure field in DriverCapability during IOCInit to MPI3_IOCINIT_DRIVERCAP_OSEXPOSURE_NO_SPECIAL(0x1), aligning with the latest MPI specification version 36. Reviewed by: ssaxena, imp Differential Revision: https://reviews.freebsd.org/D49745
* mpi3mr: Update MPI Header to Version 36Chandrakanth patil2025-04-2812-46/+336
| | | | | | | | | Updated the MPI header files to version 36 to align with the latest MPI specification. This includes updated structures, field definitions, and constants required for compatibility with updated firmware. Reviewed by: ssaxena, imp Differential Revision: https://reviews.freebsd.org/D49743
* e6000sw: add support for 88E6190XAdrian Chadd2025-04-272-11/+31
| | | | | | | | | | | | | | | | | | | | This adds the minimum support required to probe/attach the 88E6190X. I've tested this against an AT&T ATT-150 OCP device (Silicom i3000) with local changes to export MDIO via ixge(4). Hints are required to probe/attach/configure the switch on amd64, but with the mentioned diffs, it does work. Thanks to Stas Alekseev <stas@alekseev.us> for the pull request and Stas / Jason Hensler <omegadraconis@gmail.com> for chasing down information about the chipset, linux stuff and AT&T OCP hardware information. PR: kern/281211 Pull Request: https://github.com/freebsd/freebsd-src/pull/1408 Differential Revision: https://reviews.freebsd.org/D50044 Reviewed by: imp
* e6000sw: schedule e6000sw_tick() to occur once a secondAdrian Chadd2025-04-271-0/+12
| | | | | | | | | | | | | | | Although all the machinery is present, the tick routine only ran once. It was never rescheduled. So, reschedule it. However in practice I've discovered that the tick routine is running whilst a bunch of phys are actually being probe/attached on each per-port MII bus being created and probed off of the switch itself. Until that's debugged (and likely the whole PHY management stuff is cleaned up here), just add a NULL check and thus don't panic. Differential Revision: https://reviews.freebsd.org/D50031 Reviewed by: imp
* e6000sw: stop / drain the taskqueue (and tick) during detachAdrian Chadd2025-04-271-3/+15
| | | | | | | | | | | | Although the tick isn't running every hz right now, when it /is/ running at hz, the shutdown path will race with an existing running tick routine, causing unpredictable panics. * Introduce a shutdown flag which will abort doing the tick work if set * set the shutdown flag and start cancel/draining the taskqueue during detach. Differential Revision: https://reviews.freebsd.org/D50030
* e6000sw: unlock the driver lock in the error path during attachAdrian Chadd2025-04-271-0/+1
| | | | | | | | The driver sleep lock was being held during most of the error paths, and not unlocking it will panic the kernel during detach. So, fix it. Differential Revision: https://reviews.freebsd.org/D50029 Reviewed by: imp
* e6000sw: correctly depend upon etherswitchAdrian Chadd2025-04-271-1/+1
| | | | | | | | This fixes the driver to load correctly as a module when etherswitch is also a module. Differential Revision: https://reviews.freebsd.org/D50027 Reviewed by: imp
* miiproxy: add missing dependency on mdioAdrian Chadd2025-04-271-0/+1
| | | | | | | This is required for it to be a module Differential Revision: https://reviews.freebsd.org/D50024 Reviewed by: imp
* hidraw(4): Force switch to hidraw mode on HIDIOCGRDESC ioctlVladimir Kondratyev2025-04-271-0/+3
| | | | | | | | To match documentation. Reported by: Ihor Dutchak <ihor.youw@gmail.com> PR: 286155 MFC after: 3 days
* hidraw(4): Return actual length of read data from HIDIOCG* ioctlsVladimir Kondratyev2025-04-271-2/+8
| | | | | | To match Linux. MFC after: 3 days
* hidraw(4): Return length of written data from HIDIOCS* ioctlsVladimir Kondratyev2025-04-271-1/+4
| | | | | | To match Linux. MFC after: 3 days
* hidraw(4): Add additional hidraw input/output report ioctlsVladimir Kondratyev2025-04-273-5/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to Linux hidraw compatibility API. Respective Linux commit f43d3870cafa made by Dean Camera message is: Currently the hidraw module can only read and write feature HID reports on demand, via dedicated ioctls. Input reports are read from the device through the read() interface, while output reports are written through the write interface(). This is insufficient; it is desirable in many situations to be able to read and write input and output reports through the control interface to cover additional scenarios: - Reading an input report by its report ID, to get initial state - Writing an input report, to set initial input state in the device - Reading an output report by its report ID, to obtain current state - Writing an output report by its report ID, out of band This patch adds these missing ioctl requests to read and write the remaining HID report types. Note that not all HID backends will neccesarily support this (e.g. while the USB link layer supports setting Input reports, others may not). FreeBSD native uhid(4) compatible API already has similar ioctls. MFC after: 3 days
* agp: Drop a needless iterator resetDoug Moore2025-04-261-1/+0
| | | | | Reported by: alc Fixes: e1f3f15192c1 ("agp: use iterators to speed up lookups")
* Revert "sound: Access softc through si_drv1 in dsp cdev methods"Christos Margiolis2025-04-251-11/+13
| | | | | | Committed by accident. This reverts commit facccfc8c7e1463c3139a74d746b715c4f3a02a0.
* Revert "sound: Create a dsp_close() helper function"Christos Margiolis2025-04-251-54/+73
| | | | | | Committed by accident. This reverts commit 532b45fe103c623855bf1004d5de2fd41e2885e4.
* sound: Create a dsp_close() helper functionChristos Margiolis2025-04-251-73/+54
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D49805
* sound: Access softc through si_drv1 in dsp cdev methodsChristos Margiolis2025-04-251-13/+11
| | | | | | | | | No functional change. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D49804
* sound: Retire SD_F_PRIO_*Christos Margiolis2025-04-252-23/+18
| | | | | | | | | | | | | | | | The SD_F_* flags are supposed to be softc flags, but SD_F_PRIO_RD and SD_F_PRIO_WR are just generic flags and are only used with dsp_lock_chans() and dsp_unlock_chans(). Since we already have the DSP_F_READ() and DSP_F_WRITE() macros, we can re-use them instead. I am aware the FREAD and FWRITE flags are meant to be used with open(), but I think their use here is clear enough to not cause confusion. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49978
* sound: Export hardware and software buffer sample rate in sndstat nvlistChristos Margiolis2025-04-251-0/+4
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49983
* sound: Make sndstat PVCHAN and RVCHAN nvlist parameters boolChristos Margiolis2025-04-251-2/+4
| | | | | | | | | | | | | | Prior to 02d4eeabfd73 ("sound: Allocate vchans on-demand"), the play.vchans and rec.vchans sysctls corresponded to the value of d->pvchancount and d->rvchancount respectively, which is also what we are exporting through SNDST_DSPS_SOUND4_PVCHAN and SNDST_DSPS_SOUND4_RVCHAN respectively. Since that commit, the sysctls mentioned have been modified to show whether play/rec vchans are enabled or not. Modify the sndstat nvlist parameters accordingly. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49980
* asmc: Add support for macmini 6,1 and 6,2 (late 2012) modelsHrant Dadivanyan2025-04-252-0/+80
| | | | | | | This adds the ASMC support for the macmini 6,1 and 6,2. PR: kern/268141 Differential Revision: https://reviews.freebsd.org/D49929
* mpi3mr: configure larger max I/O size if the HBA firmware supports itChuck Silvers2025-04-234-10/+41
| | | | | | | | | | | | | | The max I/O size that an mpi3mr HBA supports is reported in the IOCFacts structure (with 0 representing the legacy max I/O size of 1 MB). By default, set the max I/O size of devices attached to mpi3mr controllers to the smaller of the HBA's max I/O size and the kernel's maxphys. Allow this default to be overriden by a global tunable "hw.mpi3mr.max_sgl_entries" or by a per-controller tunable "dev.mpi3mr.N.max_sgl_entries". Sponsored by: Netflix Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49090
* bnxt_en: Thor2 Ring counters not incrementing during trafficSreekanth Reddy2025-04-231-1/+4
| | | | | | | | | The ctx_hw_stats_ext DMA address was not correctly passed to the firmware during the HWRM_STAT_CTX_ALLOC allocation, causing stats to not populate for Thor2. Passing the correct DMA length resolved the issue MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49732
* bnxt_en: Unhandled async event type 76Sreekanth Reddy2025-04-231-6/+6
| | | | | | | | | The completion event type 76 is not supported by the driver. Instead of flooding the dmesg with "Unknown event type" messages when this event occurs, move the print under debug level. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49731
* bnxt_en: Thor2 Specific Doorbell related changesSreekanth Reddy2025-04-233-32/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doorbell offset : For Thor controllers doorbell offset was always hardcoded to 0x10000 for PF devices where as for Thor2 controllers doorbell offset will be legacy_l2_db_size_kb value provided by firmware through hwrm_func_qcfg command. CQ Toggle & Epoch bits support : In order to handle out of order doorbell handling as part of Dropped Doorbell Recovery, HW expects two changes in the driver in data path. - First change is the epoch bit changes while updating the producer indexes of Tx. This epoch bit is toggled by the driver, each time the queue is wrapped for that specific doorbell. - The second change is to add a toggle bit pair to each ARM type doorbell. This includes the CQ_ARMALL, CQ_ARMSE, CQ_ARMENA doorbells. The toggle bit pair in context is incremented by the chip each time a new NQE completion is generated by the chip. To keep the driver in-sync, the toggle bit pair will be passed in the NQE to the host completion. This will be the toggle bit pair value that the host must use to setup the next NQE operation. The driver will pass that latest toggle bit pair value into the ARM type doorbells it generates to the chip. The doorbell clients will compare the toggle bit pair in each doorbell with the value in context. If the values match, the doorbell will be honored. If the values do not match, the doorbell will be discarded. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49730
* bnxt_en: 400G speed supportSreekanth Reddy2025-04-233-135/+441
| | | | | | | Added 400G speed module support. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49729
* if_bnxt: add support for RX completion record type V3Sreekanth Reddy2025-04-232-0/+5
| | | | | | | | Added support for RX V3 completion record types- CMPL_BASE_TYPE_RX_TPA_START_V3 and CMPL_BASE_TYPE_RX_L2_V3. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49728
* bnxt_en: Add backing store V2 supportSreekanth Reddy2025-04-233-18/+153
| | | | | | | | | Add backing store V2 support. Thor2 controllers supports only the V2 support. MFC-After: 3 days Reviewed-by: Warner Losh <imp@FreeBSD.org> Differential-Revision: https://reviews.freebsd.org/D49727
* bnxt_en: Update HSI headerSreekanth Reddy2025-04-232-169/+2082
| | | | | | | Update HSI header to support Thor2 controllers. MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49726
* bnxt_en: Add 5760X (Thor2) PCI IDs supportSreekanth Reddy2025-04-235-60/+93
| | | | | | | | | Add Thor2 PCI IDs. Reviewed-by: Warner Losh <imp@FreeBSD.org> Reviewed-by: Sumit Saxena <sumit.saxena@broadcom.com> MFC-After: 3 days Differential-Revision: https://reviews.freebsd.org/D49725
* pci: Add hw.pci.intx_reroute sysctl/tunableColin Percival2025-04-231-1/+6
| | | | | | | | | | | | | | | | | | | INTRng can leak resources when INTx interrupts are re-routed, which is typically harmless but can be fatal when devices are (repeatedly) hot plugged into PCI buses on INTRng systems. Re-routing INTx interrupts is nonetheless still necessary on some systems, and identifying whether the re-routing should be enabled or disabled seems to be nontrivial. Add a hw.pci.intx_reroute sysctl/tunable so systems which don't want legacy PCI interrupt re-routing can turn it off. This is probably not the best fix but it's something which can be safely included in FreeBSD 14.3. Co-Authored-by: jhb Reviewed by: bz, jhb MFC after: 3 days Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D49849
* rtwn: don't treat UDP/TCP checksum failure as permanent failureAdrian Chadd2025-04-231-1/+9
| | | | | | | | | | | | | | | jrtc27@freebsd.org reported that DHCP wasn't working on some networks. She dug into it and found that the RTL8812AU/RTL8812AU NICs seem to be failing UDP frames w/ a zero checksum, which is a valid "there's no checksum" checksum. So, just pass those frames up the stack and let the IP stack deal with it. If the hardware claims the frames did pass TCP/UDP checksum then still mark those frames with the checksum offload bits. PR: kern/285387 Differential Revision: https://reviews.freebsd.org/D49628
* rtwn: enable reception of BAR framesJessica Clarke2025-04-231-0/+8
| | | | | | | | | | | | The RX filter wasn't enabling BAR frames, so we weren't receiving them during normal operation. Jessica noticed we WERE getting BAR frames, but only when promisc mode is active. Which is a different set of bugs, but it did highlight the differences here. Differential Revision: https://reviews.freebsd.org/D49596 PR: kern/285822
* axidma(4): add local data cache flushes.Ruslan Bukin2025-04-221-1/+8
| | | | | | | | | As axidma(4) does not support busdma(9) then add local cache flushes, and map descriptors using default memory attribute (cacheable type). This fixes operation on Codasip X730. Sponsored by: UKRI
* pcib: Clear any pending slot status events during attachJohn Baldwin2025-04-221-0/+1
| | | | | | | | | Any events left over from boot firmware, etc. are not meaningful so clear pending events during attach. If they are still pending they should remain asserted when the slot status register is re-read. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49950
* pcib: Ignore power fault detected if a power controller is not presentJohn Baldwin2025-04-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | At least some PCI-express bridges exposed by Intel Volume Management Devices report bogus power faults in their slot status register. As a workaround, ignore the power fault detected flag if the slot capability register does not indicate support for a power controller. While the PCI-e spec does not explicitly state that the PFD flag should always be zero if a power controller is not present, parts of the spec do seem to assume this. For example, the flag is included in the "Power Controller Registers" register group in 6.7.2.4, and the definition of the value for this flag seems to presume the presence of a power controller: If a Power Controller that supports power fault detection is implemented, this bit is Set when the Power Controller detects a power fault at this slot. Note that, depending on hardware capability, it is possible that a power fault can be detected at any time, independent of the Power Controller Control setting or the occupancy of the slot. If power fault detection is not supported, this bit must not be Set. PR: 285993 Reported by: Jim Long <freebsd-bugzilla@umpquanet.com> Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D49949
* gpioaei: mark the AEI ithread as sleepableAhmad Khalifa2025-04-211-2/+3
| | | | | | | | | | | We call an ACPICA function in the interrupt handler which may attempt to lock a mutex. If this is done while another instance of the handler already holds the lock, it would cause a kernel panic since sleeping isn't allowed. Reviewed-by: Warner Losh <imp@FreeBSD.org> Pull-request: https://github.com/freebsd/freebsd-src/pull/1667 Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
* acpi_gpiobus: mask pin flags for GPIOBUS_PIN_SETFLAGSAhmad Khalifa2025-04-211-1/+2
| | | | | | | | | GPIOBUS_PIN_SETFLAGS calls GPIO_PIN_SETFLAGS, which doesn't accept interrupt flags. Reviewed-by: Warner Losh <imp@FreeBSD.org> Pull-request: https://github.com/freebsd/freebsd-src/pull/1667 Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
* gpio: don't misuse pin->flagsAhmad Khalifa2025-04-213-23/+11
| | | | | | | | | | | | The flags member of gpio_pin_t was only meant for pin flags acquired via the FDT. Instead, make an accessor so gpioaei can still access the flags and remove the now unused gpio_pin_get_by_acpi_index. Reviewed-by: Warner Losh <imp@FreeBSD.org> Pull-request: https://github.com/freebsd/freebsd-src/pull/1667 Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
* acpi_gpiobus: clarify error messageAhmad Khalifa2025-04-211-1/+1
| | | | | | | | | | This message was identical to another a few lines up, making it hard to tell where the error occurred. Reviewed-by: Ed Maste <emaste@FreeBSD.org> Reviewed-by: Warner Losh <imp@FreeBSD.org> Pull-request: https://github.com/freebsd/freebsd-src/pull/1667 Signed-off-by: Ahmad Khalifa <ahmadkhalifa570@gmail.com>
* usb: if_ure: stop touching the mbuf accounting on rxq insertionKyle Evans2025-04-202-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | uether_rxmbuf() assumes the uether_newbuf() model where the caller has just set m_len to the entire size of the mbuf, and passed the final size into uether_rxmbuf() for finalization. In if_ure we're creating our own mbuf chains, and the accounting is all already accurate. uether_rxmbuf's logic won't work at all for a chain, so let's add an assertion to that effect (but I think the other callers were all OK). This fixes a panic on my Windows DevKit when undergoing any kind of network stress that surfaces after the bogus mbuf is injected into the network stack (usually observed in `m_dup`). markj and I had spent some time investigating it and decided there's some kind of buffer underrun happening; the rx packet descriptor reports a length longer than what's actually available. We discard the rest of the transfer, but then we end up fetching it in a subsequent transfer and end up casting packet data to a `struct ure_rxpkt` incorrectly. It would be better to fix the underlying root cause, but this is a reasonable mitigation in the interim. Reviewed by: markj Fixes: 7d5522e16a ("A major update to the ure driver.") Differential Revision: https://reviews.freebsd.org/D43465
* agp: use iterators to speed up lookupsDoug Moore2025-04-191-4/+9
| | | | | | | | | agp_generic_bind_memory and agp_generic_unbind_memory do pctrie lookups for ranges of consecutive pages. Use iterators to improved the expected performance of those searches. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49917
* wg: Improve wg_peer_alloc() to simplify the callingAaron LI2025-04-181-16/+26
| | | | | | | | | | | | Move the necessary extra logics (i.e., noise_remote_enable() and TAILQ_INSERT_TAIL()) from wg_ioctl_set() to wg_peer_alloc(), and thus make it easier to be called. Actually, the updated version is more asymmetric to wg_peer_destroy() and thus less likely to be misused. Meanwhile, rename it to wg_peer_create() to look more consistent with wg_peer_destroy(). Reviewed by: aly_aaronly.me (diff), markj Obtained from: DragonflyBSD 902964ab24ba (with some changes)
* iwx: Remove debug logging codeTom Jones2025-04-143-346/+177
| | | | | | | | | | | | | | | This debugging code was added this log as part of an effort to diagnose firmware crashes in an earlier version of the driver. It hasn't been used for a while and I'm not sure how useful it is for this compared to other methods. While reorganisation move strings for print mappings into if_iwx_debug.c to reduce their scope. Suggested by: bz Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49783
* iwx: Use subdevice for comparisonTom Jones2025-04-141-3/+2
| | | | | | | | | | | | | | | iwx goes through a couple of steps to match devices to firmware. There is a default match of pcie device and subdevices and then a secondary pass to find a template configuration struct. Previously we were looking up the device not the subdevice and that led to ax210 cards in some devices (Framework 13) from being matched to the correct firmware. PR: 285905 Reviewed by: bz, adrian Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49759
* mmc: SPI-mode support for SD cards.Ruslan Bukin2025-04-091-0/+2378
| | | | | | | | | | | | | | | | | | | | | | | Introduce SPI-mode support which allows an SD card to communicate with a host system using SPI protocol, as described in the SD Card Specification. This feature is useful for low-end, FPGA or RISC-V research systems when a SoC is limited in terms of peripherals available (e.g. lack of a dedicated MMC controller in hardware). Examples of such systems include Codasip, lowRISC and CVA6. Project timeline: 2007: Warner first discussed SPI operational mode in his MMC presentation: https://people.freebsd.org/~imp/bsdcan2007.pdf 2012: Patrick Kelsey engineered the support. 2025: Ruslan cleaned up, tested on Codasip X730 platform (RISC-V FPGA) and put the patch to review. 2025: Patrick Kelsey reviewed the patch and aligned with the current MMC code. Reviewed by: pkelsey Sponsored by: UKRI Differential Revision: https://reviews.freebsd.org/D49248
* mmc: support for SPI bus typeRuslan Bukin2025-04-095-0/+28
| | | | | | | | | | | - Introduce the bus_type accessor, which allows to skip card selection and timing settings in SPI mode; - Add MMC_CMD_IS_APP flag for commands followed by the APP command, which is required by the upcoming MMCSPI driver. Reviewed by: pkelsey Sponsored by: UKRI Differential Revision: https://reviews.freebsd.org/D49249