Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45967
(cherry picked from commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861)
Assignment taken from dsp_oss_engineinfo().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D46166
(cherry picked from commit bd5bcc848c5764229926ad27a4bd77af4f87d189)
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D46164
(cherry picked from commit a6283717577066b0ff6c62053145470ff4134051)
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D46163
(cherry picked from commit 810530aa2648812860e84d951d9cf96dfd24e595)
At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI
vendor id instead of the Xilinx one. Other HDSPe cards are probably also
affected. Update snd_hdspe(4) to recognize both the old Xilinx and the
new RME vendor ids.
Differential Revision: https://reviews.freebsd.org/D44978
MFC after: 1 day
(cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623)
- Group the request header and I/O buffer in one structure, rather than
assuming that both request structures have the same size.
- Pass a pointer to the whole structure to urndis_ctrl_query() and
urndis_ctrl_set() rather than just the header. Otherwise, on CHERI
platforms, these functions violate subobject bounds since they modify
the buffer following the header.
While here, there is no apparent reason for the request structure used
in urndis_attach() to be allocated statically. Change it so that it's
allocated on the stack.
No functional change intended.
Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D45866
(cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e)
Commit 9a7bf07ccd from 2016 introduced a workaround for some broken
BIOSes that specified active-lo instead of active-hi polarity for ISA
IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs
on x86 should always be active-hi. However, some recent AMD systems
actually use active-lo edge-sensitive ISA IRQs (and not just for
UARTs, but also for the keyboard and PS/2 mouse devices) and the
override causes interrupts to be dropped resulting in boot time hangs,
non-working keyboards, etc.
Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl
post-boot) to control this quirk. It can be set to 1 to force enable
the override and 0 to disable it. The log of original message
mentions an Intel motherboard as the sample case, so default the
tunable to 1 on systems with an Intel CPU and 0 otherwise.
Special thanks to Matthias Lanter <freebsd@lanter-it.ch> for tracking
down boot time issues on recent AMD systems to mismatched interrupt
polarity.
PR: 270707
Reported by: aixdroix_OSS@protonmail.com, Michael Dexter
Reported by: mfw_burn@pm.me, Hannes Hfauswedell <h2+fbsdports@fsfe.org>
Reported by: Matthias Lanter <freebsd@lanter-it.ch>
Reported by: William Bulley <web@umich.edu>
Reviewed by: imp, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45554
(cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5)
This fixes a panic when multiple VIs are configured on an interface and
only the non-primary VI is up at the time of driver detach. The problem
was that the driver would queue a link state change notification for an
interface about to be freed.
To reproduce the panic, add "hw.cxgbe.num_vis=2" to loader.conf and
# kldload if_cxgbe
# ifconfig vcc0 up
# devctl detach t6nex0
trap 0x9, rip = 0xffffffff8107db70, rsp = 0xfffffe0055263d60, rbp = 0xfffffe0055263dd0
taskqueue_run_locked() at taskqueue_run_locked+0x2a0/frame 0xfffffe0055263dd0
taskqueue_run() at taskqueue_run+0x72/frame 0xfffffe0055263df0
taskqueue_swi_run() at taskqueue_swi_run+0x18/frame 0xfffffe0055263e10
intr_event_execute_handlers() at intr_event_execute_handlers+0x249/frame 0xfffffe0055263e50
ithread_execute_handlers() at ithread_execute_handlers+0x9e/frame 0xfffffe0055263e70
Reviewed by: jhb
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45864
(cherry picked from commit dc20d49aa939caea365cbdf0341b00de69253be4)
This affects TOE operation when multiple rx c-channels are in use for
offload, which is an unusual configuration.
Sponsored by: Chelsio Communications
(cherry picked from commit c6c6d4aff90da83a292b4c2bbbe1f4d6e01cd82e)
It is the equivalent of tx_chan but for receive so rx_chan is a better
name. Initialize both using helper functions and make sure both are
displayed in the sysctl MIB.
Sponsored by: Chelsio Communications
(cherry picked from commit 480ff89c67b25113515018cdcd13179229b4a0d3)
PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.
Sponsored by: Chelsio Communications
(cherry picked from commit 4d1362cdc7375984a48f5f0048b1fe909524d21d)
All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.
Sponsored by: Chelsio Communications
(cherry picked from commit 857d74b6340e418396d79a46b264ce0eedd760e4)
Avoid a magic constant while here. No functional change intended.
Sponsored by: Chelsio Communications
(cherry picked from commit 43f6f08488046788b0ad66e9a5119f36e5de71ab)
The firmware clears the interrupts already and it has a better idea of
exactly what to clear for which generation of the ASIC. There is no
need for the driver to get involved.
Sponsored by: Chelsio Communications
(cherry picked from commit 1c7f9c8b4673abf3723be09afed4443261e0d186)
These register blocks are at different locations in different chips.
Sponsored by: Chelsio Communications
(cherry picked from commit b59c5d97edf17525405d95b1f5746c4a79a9c7c4)
The driver always uses the same modulation queue as the channel and the
table is unnecessary.
Sponsored by: Chelsio Communications
(cherry picked from commit f76effed14b25bfa0c47b10f6d8a076104c48d94)
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>
(cherry picked from commit 31354813f3c6e87532189be77c2f10a017c55472)
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>
(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
Add braces to the dmc620 MD4 macro to fix the GCC build.
Reviewed by: brooks, imp, jhb
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45266
(cherry picked from commit 131c1718c6331e87f139b42b4ad0e57b6a71ea44)
In pci_host_generic_acpi.c we loop over pci_acpi_quirks to check if
we need to handle any quirks. GCC doesn't like the terminatin as it
sets a fixed width string to 0.
As this the array is only ever used in this file change to use nitems
to find when to stop the loop.
Reviewed by: brooks, imp, jhb, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D45265
(cherry picked from commit f55e866488ba2d8bb5b79659ee84bec1fe7808fb)
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44913
(cherry picked from commit f91e9401c2098ba56f43093ef9747d0b1f60f8eb)
Change 4787572d05 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().
No functional change intended.
Reviewed by: kp, imp, glebius, stevek
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D45740
(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
In sndstat_build_sound4_nvlist(), if we have INVARIANTS or
SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call
CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop
for good measure.
Fixes: bbca3a75bb41 ("sound: Include sound(4) channel information in sndstat nvlist")
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45898
(cherry picked from commit e850bd36dfda98608432d2459800627d16119fec)
If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45876
(cherry picked from commit 1a768ea9db3d66941b0dc5340ac028ef548808b8)
The current implementation of sndstat_get_caps() does not work properly
when VCHANs are enabled, as it skips all information about physical
channels, and also assigns the min/max rates and channels to same
values, which is usually not the case. A device either supports any
sample rate within the [feeder_rate_min, feeder_rate_max] range, or
[hw_rate_min, hw_rate_max] range when the device is opened in exclusive
or bitperfect mode. The number of channels can also vary and is not
always the same for both min and max.
Refactor the whole function to resemble the way we handle fetching of
these values in dsp_oss_audioinfo() and dsp_oss_engineinfo().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45872
(cherry picked from commit 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b)
Since we allow feeding of any rate within the [feeder_rate_min,
feeder_rate_max] range, report this as the min/max rate as well. Only
exceptions are when we the device is opened in exclusive or bitperfect
mode.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45862
(cherry picked from commit 86585210fd5657542884b22eb52b21e960b7be6c)
midistat_lock is used outside midi/midi.c as well, so implement lock,
unlock and lockassert functions in order not to expose the lock in the
header file.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D45857
(cherry picked from commit 2d6fc24673ccc97020c94094f97ee015f1db9702)
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D45831
(cherry picked from commit a9f08df3e9004f431e98f67afc1ac2b2f773ec14)
No reason to have this as a macro.
While here, change the second case to an "else if" as there is no reason
to check it if the open flags are invalid.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj, emaste
Differential Revision: https://reviews.freebsd.org/D45776
(cherry picked from commit adc1713fb13f89a6eb33f5de840c981d0e17e4b7)
If we are in simplex mode, make sure we do not open in both directions
(read/write) and also that we do not open in a direction opposite of
what is already opened. For example, if the device is already doing
playback, we cannot open the device for recording at the same time, and
vice-versa.
While here, remove dsp_cdevpriv->simplex as it's no longer needed.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45835
(cherry picked from commit be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af)
Remove all special handling for SIMPLEX, since we can just fetch the
channel directly.
While here:
- Get rid of a no-op getchns() call in dsp_ioctl().
- Rename getchns() to dsp_lock_chans(), and relchns() to
dsp_unlock_chans().
- Simplify DSP_FIXUP_ERROR(), as we do not longer assign SD_F_PRIO*
flags to the softc.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45775
(cherry picked from commit 46e92a41cb539e327dd059d571fa381d0fbe779c)
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D45772
(cherry picked from commit 8b9e1b628064daba3650d04fa83cf79808877981)
No good reason to have this. It only makes things harder to read.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45773
(cherry picked from commit 526bd1d87ec997e1c090262da6f2d9b6da0e8f89)
This information is also printed to dmesg(8) on attach.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D45771
(cherry picked from commit 3402d474ceb8541d07689bad6960f90739129997)
Opening /dev/sequencer after a clean reboot yields:
lock order reversal: (sleepable after non-sleepable)
1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754
2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478
lock order seqflq -> midistat lock attempted at:
0xffffffff811c9029 at witness_checkorder+0x12b9
0xffffffff810f18a7 at _sx_xlock+0xf7
0xffffffff8417f992 at midimapper_open+0x22
0xffffffff84182770 at mseq_open+0xf0
0xffffffff80e3380f at devfs_open+0x30f
0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57
0xffffffff812da1e7 at vn_open_vnode+0x397
0xffffffff812d96b3 at vn_open_cred+0xb23
0xffffffff812c2c6b at openatfp+0x52b
0xffffffff812c2711 at sys_openat+0x81
0xffffffff84110579 at filemon_wrapper_openat+0x19
0xffffffff81a223ae at amd64_syscall+0x39e
0xffffffff819dd0eb at fast_syscall_common+0xf8
Expose midistat_lock to midi/midi.c so that we can acquire the lock from
mseq_open() before we lock seq_lock, and introduce _locked variants of
midimapper_open() and midimapper_fetch_synth().
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45770
(cherry picked from commit fc76e24e583d45a3a59fd7ad4e603c0679eaf572)
The snd_sb16 driver was removed in 716924cb48 ("Retire snd_sbc ISA
sound card driver").
While here, simplify sample rate assignment a bit.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, markj, emaste
Differential Revision: https://reviews.freebsd.org/D45662
(cherry picked from commit d6d4586b0b7e3b01812e6c26818af78bf9b680a3)
Currently, we are skipping physical channels when servicing
SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX.
However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll
eventually skip all channels, resulting in some of oss_audioinfo's
fields containing wrong information (e.g min/max_channels).
Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical
channels when VCHANs are disabled.
Sponsored by: The FreeBSD Foundation
MFC after: 2 days
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D45722
(cherry picked from commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8)
Commit bf454ca88bdf made wg_transmit() defined only when "device netmap"
is configured, as if_wg's if_transmit implementation should never be
called otherwise, but this breaks a requirement that interfaces
implement both or neither of if_transmit and if_qflush.
Restore the old behaviour of unconditionally defining wg_transmit(). It
contains an assertion that the interface is in netmap mode.
Reported by: peterj
MFC after: 2 weeks
Fixes: bf454ca88bdf ("wg: Add netmap support")
(cherry picked from commit 5515e8874a8d85a8d961fca64c494dfc1bea4bd0)