aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* ofw: convert boolean_t to boolMitchell Horne2024-06-265-12/+12
| | | | | | | | | | | Most of these already treat it as a proper bool, i.e. using true/false. Also fix-up callers of OF_install(). No functional change intended. Reviewed by: andrew, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45733
* cxgbe: replace a loop with rounddown_pow_of_twoDoug Moore2024-06-261-3/+1
| | | | | | | Replace a loop with a function call. Reviewed by: np, alc Differential Revision: https://reviews.freebsd.org/D45716
* isp: fix ISPCTL_ABORT_CMD switch caseMariusz Zaborski2024-06-251-0/+1
| | | | | | | | | | Prevent kernel panic by not running ISPCTL_FCLINK_TEST after a failed ISPCTL_ABORT_CMD. Reviewed by: mav Tested by: Arne Steinkamm <arne@steinkamm.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45718
* hwpmc/arm64: Support the kernel booting to VHEAndrew Turner2024-06-251-0/+13
| | | | | | | | | When booting to VHE we need to handle using the PMU at either EL1 or EL2. WE already support EL1 so add support for EL2. Reviewed by: mhorne Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45527
* hwpmc/arm64: fix the type for pm_arm64_evselAndrew Turner2024-06-252-4/+5
| | | | | | | | It holds a 64-bit register, use a uint64_t. Reviewed by: mhorne Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45526
* tpm: Fix acpi attachmentWarner Losh2024-06-251-1/+1
| | | | | | | | | The third arg of the DRIVER_MODULE arg is the driver to use. We want to use the acpi bus version rather than the generic one. Otherwise, the ACPI specific probe and attach functions aren't used and we don't see the device. Sponsored by: Netflix
* p9fs: use M_WAITOK where appropriateEd Maste2024-06-251-6/+1
| | | | | | | | | | | device_attach routines are allowed to sleep, and this routine already has other M_WAITOK allocations. Reported by: markj Reviewed by: markj Fixes: 1efd69f933b6 ("p9fs: move NULL check immediately after alloc...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45721
* Add an isp(4) tunable to default to ispfw(4) firmware.Kenneth D. Merry2024-06-243-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ispfw(4) recently gained firmware for Qlogic 27XX and 28XX FC controllers, and isp(4) now selects the newer of firmware in flash or in ispfw(4) to load for those controllers. This differs from the previous behavior (which remains for older controllers), which was to always load the ispfw(4) firmware if it is available. This adds a loader tunable, hint.isp.N.fwload_force to default to loading the ispfw(4) firmware, whether or not it is newer than the firmware in flash. This allows the user to always use the known firmware version included with the kernel. Note that there is an existing fwload_disable tunable that tells the driver to always load the firmware from flash and ignore ispfw(4). If fwload_disable is set, fwload_force will be ignored. So users with existing fwload_disable tunables will have the same behavior. If a user specifies both fwload_force and fwload_disable for the same controller, the isp(4) driver prints a warning message, and fwload_disable will be honored. The user can see which firmware is active through the dev.isp.N.fw_version* sysctl variables. share/man/man4/isp.4: Document the new loader tunable. sys/dev/isp/isp.c: In isp_load_risc_flash(), changet the decision logic to also consider ISP_CFG_FWLOAD_ONLY. Load the flash firmware and get the version, so the user knows what it is, but if the user set fwload_force, honor that. If the user didn't set fwload_force, the behavior remains to select the newer firmware version. sys/dev/isp/isp_pci.c: Add a new fwload_force tunable. Print out a warning if the user sets both fwload_disable and fwload_force. sys/dev/isp/ispvar.h: Add a new ISP_CFG_FWLOAD_FORCE configuration bit. Reviewed by: mav MFC after: 1 week Sponsored by: Spectra Logic Differential Revision: <https://reviews.freebsd.org/D45688>
* Fix the isp(4) driver with 9.x firmware.Kenneth D. Merry2024-06-242-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isp(4) driver (and ispfw(4) firmware) previously only included firmware for Qlogic controllers up to 8Gb. It recently gained firmware for the 27XX and 28XX series controllers along with improved firmware loading capabilities. The 9.x firmware available for the 27XX and 28XX controllers in ispfw(4) adds login state for NVMe devices in the top nibble of the login state in the port database (isp_pdb_24xx_t in ispmbox.h). This breaks the check at the end of isp_getpdb() to make sure the device is in the right login state. As a result, it breaks device discovery for many (perhaps all?) FC devices. In my testing with IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they don't show up when they are directly connected (and in loop mode) or connected via a switch (and in fabric mode). So, mask off the top bits of of the login state before checking it. This shouldn't break anything, because all of the existing login states defined in ispmbox.h are in the low nibble. sys/dev/isp/ispmbox.h: Add a FCP login state mask define, and a NVMe login state shift. sys/dev/isp/isp.c: In isp_getpdb(), make sure we're only looking at the FCP login state bits when we try to determine whether a device is in the right login state. MFC after: 1 week Sponsored by: Spectra Logic Reviewed by: mav Differential Revision: <https://reviews.freebsd.org/D45660>
* p9fs: move NULL check immediately after allocationEd Maste2024-06-241-6/+5
| | | | | | | Reported by: Shawn Webb (HardenedBSD) Reviewed by: dfr Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45719
* mlx5: use roundup_pow_of_twoDoug Moore2024-06-241-1/+1
| | | | | | | Use roundup_pow_of_two in place of an expression. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* irdma: Use round{up,down}_pow_of_twoDoug Moore2024-06-241-2/+2
| | | | | | | Use roundup_pow_of_two and rounddown_pow_of_two in place of expressions. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* cxgbe: use order_base_2Doug Moore2024-06-241-1/+1
| | | | | | | Use order_base_2 in place of an expression. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* cxgb: use rounddown_pow_of_twoDoug Moore2024-06-241-2/+2
| | | | | | | In two places, use the rounddown_pow_of_two macro in place of expressions. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* aic7xxx: use rounddown_pow_of_twoDoug Moore2024-06-241-1/+1
| | | | | | | Use the roundown_pow_of_two macro in place of an expression. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* log2: move log2 functions from linuxkpi to libkernDoug Moore2024-06-243-37/+0
| | | | | | | | | | | | | | | | | | | | | Linux has a header file that defines an ilog2 function and some simple functions/macros that use it: roundup_pow_of_two, is_power_of_2, rounddown_pow_of_two, and order_base_2. This change moves three of those simple functions (all but is_power_of_2) from linuxkpi to libkern. It also deletes a few implementations of these functions that have previously been copied into code for various device drivers, so that they can use the libkern version. The is_power_of_2 macro was not moved because powerof2 in param.h provides almost the same service already (except that they disagree about whether 0 is a power of two). Since the linux definitions of these functions were copied into FreeBSD 11 years ago, linux has improved them, and this change provides those improvements. In particular, a giant table of log values for evaluating ilog2 for constant values is no longer necessary. Reviewed by: alc, markj (previous version) Differential Revision: https://reviews.freebsd.org/D45536
* dev/mana: replace power2 functionDoug Moore2024-06-241-1/+1
| | | | | | | | | Replace is_power_of_2(length) with power2(length). When length != 0, as in this case, they produce the same result. This will allow an implementation of is_power_of_two to be dropped. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* acpi_timer: remove leftovers from Garbage-collect ACPI-safe timer and friendsBaptiste Daroussin2024-06-211-11/+1
| | | | | Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D45669
* acpi_timer: remove unused variableBaptiste Daroussin2024-06-211-1/+1
| | | | the fixes kernel building after 00d061855deb
* Garbage-collect ACPI-safe timer and friendsColin Percival2024-06-211-123/+3
| | | | | | | | | | | | | | | | | | | | | In 2001 when the ACPI timer was introduced, it included code to check for a bug present in some Pentium II and Pentium III chipsets; if the bug was found to be present, ACPI-safe (which was slower but had a workaround for the bug) would be used rather than ACPI-fast (which read the same timer but without the workaround). In a8b89dff6ac0 (September 2021) I disabled this check by default, with a loader tunable available to re-enable it; I announced at the time that it would go away in FreeBSD 15 if I didn't receive any reports of problems. I have received no such problems, so this code is now going away. The debug.acpi.timer_test loader variable triggered a lengthy (in fact, infinitely long) test of the ACPI timer and appears to have been introduced as part of the process of writing the ACPI timer (and the associated ACPI-safe workaround) in 2001; since we are dropping support for systems with this ACPI bug, there is no need to keep that test code either.
* Add an implementation of the 9P filesystemDoug Rabson2024-06-192-0/+550
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is derived from swills@ fork of the Juniper virtfs with many changes by me including bug fixes, style improvements, clearer layering and more consistent logging. The filesystem is renamed to p9fs to better reflect its function and to prevent possible future confusion with virtio-fs. Several updates and fixes from Juniper have been integrated into this version by Val Packett and these contributions along with the original Juniper authors are credited below. To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. The bhyve virtio-9p device allows access from the guest to files on the host by mapping a 'sharename' to a host path. It is possible to use p9fs as a root filesystem by adding this to /boot/loader.conf: vfs.root.mountfrom="p9fs:sharename" for non-root filesystems add something like this to /etc/fstab: sharename /mnt p9fs rw 0 0 In both examples, substitute the share name used on the bhyve command line. The 9P filesystem protocol relies on stateful file opens which map protocol-level FIDs to host file descriptors. The FreeBSD vnode interface doesn't really support this and we use heuristics to guess the right FID to use for file operations. This can be confused by privilege lowering and does not guarantee that the FID created for a given file open is always used for file operations, even if the calling process is using the file descriptor from the original open call. Improving this would involve changes to the vnode interface which is out-of-scope for this import. Differential Revision: https://reviews.freebsd.org/D41844 Reviewed by: kib, emaste, dch MFC after: 3 months Co-authored-by: Val Packett <val@packett.cool> Co-authored-by: Ka Ho Ng <kahon@juniper.net> Co-authored-by: joyu <joyul@juniper.net> Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
* sound: Remove outdated comment in dsp_oss_engineinfo()Christos Margiolis2024-06-181-7/+1
| | | | | | | | | | | Since we e07f9178502b ("sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO") support more than mono/stereo. Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45605
* sound: Fix oss_audioinfo's card_number, port_number and legacy_deviceChristos Margiolis2024-06-181-5/+5
| | | | | | | | | | Although the docs advise against using them, it doesn't hurt to fill them out correctly. Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45604
* sound: Support oss_audioinfo->cmdChristos Margiolis2024-06-181-7/+3
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45603
* gve: Make gve_free_qpls idempotentShailend Chand2024-06-181-0/+1
| | | | | | | | This fixes a panic caused by double free. PR: kern/279410 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45489
* cxgbe: handle vlan PF restrictionsKristof Provost2024-06-172-7/+37
| | | | | | | Co-Authored-by: Navdeep Parhar <np@FreeBSD.org> MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D45428
* cxgbev(4): Pay attention to the VLAN configuration for the VF.Navdeep Parhar2024-06-173-5/+18
| | | | | | | | | | | | | | | Make sure that the transmit traffic is tagged correctly or else the firmware will refuse to transmit and will report an ACL violation. On receive the hardware will make sure that tagged traffic is delivered to the appropriate VM. The driver only asserts that the VLAN id that was extracted from the wire traffic matches the VF's configuration. All this works when associating a specific VLAN id with a VF. The 'trunk' setting likely needs more work. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbev(4): Shared code for the VF driver to query a VF's VLAN config.Navdeep Parhar2024-06-172-0/+28
| | | | | MFC after: 1 week Sponsored by: Chelsio Communications
* mlx5: handle vlan PF restrictionsKristof Provost2024-06-171-0/+26
| | | | | | | Reviewed by: kib MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D45427
* iovctl: allow vlan restrictions to be passed to the driverKristof Provost2024-06-171-0/+61
| | | | | | | | | Allow iovctl to create VFs that are restricted to specific VLAN IDs. Reviewed by: kib, np MFC after: 2 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D45402
* cxgbe(4): New knob to limit driver to the specified types of doorbells.Navdeep Parhar2024-06-173-0/+26
| | | | | | | | | | | hw.cxgbe.doorbells_allowed="0xf" The adapter's doorbells bitmap is clipped to the value specified in the tunable, which is meant for debug and workarounds only. There is no change in default behavior. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): Do not issue an L1CFG command from a VF.Navdeep Parhar2024-06-171-17/+19
| | | | | | | | | | | It is pointless to attempt an operation that is not permitted. It spams the firmware devlog with "insufficient caps" errors that distract from real errors. 78 2463625358 ERR CORE insufficient caps to process mailbox cmd: pfn 0x0 vfn 0x1; r_caps 0x86 wx_caps 0x82 required r_caps 0x81 w_caps 0x5 MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbev(4): Use the correct source pf for T6 in the VF driver.Navdeep Parhar2024-06-171-1/+4
| | | | | MFC after: 1 week Sponsored by: Chelsio Communications
* jedec_dimm: Use device_set_descf()Mark Johnston2024-06-161-16/+1
| | | | | | | | | | | Note that it is ok to use device_get_desc() as one of the format string parameters because it is set using device_set_desc() (not device_set_desc_copy()) and so won't be freed when the description is updated. No functional change intended. MFC after: 1 week
* mana: Use device_set_desc()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week
* oce: Use device_set_descf()Mark Johnston2024-06-161-4/+3
| | | | | | No functional change intended. MFC after: 1 week
* cfi: Use device_set_descf()Mark Johnston2024-06-161-4/+1
| | | | | | No functional change intended. MFC after: 1 week
* superio: Use device_set_descf()Mark Johnston2024-06-161-4/+1
| | | | | | No functional change intended. MFC after: 1 week
* hidbus: Use device_set_descf()Mark Johnston2024-06-161-5/+3
| | | | | | No functional change intended. MFC after: 1 week
* bxe: Use device_set_descf()Mark Johnston2024-06-161-10/+1
| | | | | | No functional change intended. MFC after: 1 week
* bge: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week
* bce: Use device_set_descf()Mark Johnston2024-06-161-11/+1
| | | | | | No functional change intended. MFC after: 1 week
* liquidio: Use device_set_descf()Mark Johnston2024-06-161-4/+2
| | | | | | No functional change intended. MFC after: 1 week
* msk: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week
* wbwd: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | No functional change intended.
* iicbus: Use device_set_descf()Mark Johnston2024-06-161-5/+2
| | | | | | No functional change intended. MFC after: 1 week
* nvmf: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week
* netmap: Use device_set_descf()Mark Johnston2024-06-161-5/+1
| | | | | | No functional change intended. MFC after: 1 week
* amdsmn: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week
* amdsbwd: Use device_set_descf()Mark Johnston2024-06-161-3/+1
| | | | | | No functional change intended. MFC after: 1 week