Commit graph

42453 commits

Author SHA1 Message Date
Christos Margiolis
cccdc51d98 snd_uaudio: Remove unused sc_sndstat sbuf
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)
2024-07-10 18:48:12 +02:00
Christos Margiolis
c9d9975cd4 sound: Fix lock order reversals in mseq_open()
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)
2024-07-10 18:48:12 +02:00
Christos Margiolis
de8161712e sound: Get rid of snd_sb16 workaround in vchan_create()
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)
2024-07-10 18:48:12 +02:00
Christos Margiolis
6158fa24ac sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled
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)
2024-07-10 18:48:12 +02:00
Mark Johnston
a9a57c8432 wg: Implement if_transmit unconditionally
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)
2024-07-02 09:19:28 -04:00
Navdeep Parhar
536a452cc4 cxgbev(4): Pay attention to the VLAN configuration for the VF.
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

(cherry picked from commit 2d0a01271223ce623c78f5c8236f8f3f4b6ef104)
2024-07-01 18:08:17 +02:00
Navdeep Parhar
5d49a46b84 cxgbev(4): Shared code for the VF driver to query a VF's VLAN config.
MFC after:	1 week
Sponsored by:	Chelsio Communications

(cherry picked from commit 4471ff11969ec6bd2e5d3c745fc5ba90fda596ed)
2024-07-01 18:08:06 +02:00
Navdeep Parhar
45b7dd0436 cxgbe(4): New knob to limit driver to the specified types of doorbells.
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

(cherry picked from commit ba95b4aea78909bca972239afcbd51538c4b37c1)
2024-07-01 18:07:57 +02:00
Navdeep Parhar
7aa9202bc8 cxgbe(4): Do not issue an L1CFG command from a VF.
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

(cherry picked from commit d72db09005e53160d6c89b5221169efaac74cd55)
2024-07-01 18:07:47 +02:00
Navdeep Parhar
b913bd1606 cxgbev(4): Use the correct source pf for T6 in the VF driver.
MFC after:	1 week
Sponsored by:	Chelsio Communications

(cherry picked from commit d0fdafdb0ef4ec9c5c66f39daf2eca926f14be0d)
2024-07-01 18:07:39 +02:00
Kristof Provost
4064153643 cxgbe: handle vlan PF restrictions
Co-Authored-by:	Navdeep Parhar <np@FreeBSD.org>
MFC after:	2 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D45428

(cherry picked from commit 1389314d53531e06c7ec02406b0addf7d77e7db7)
2024-07-01 18:06:16 +02:00
Kristof Provost
9c86768b14 mlx5: handle vlan PF restrictions
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D45427

(cherry picked from commit 7deadea2eb0aca0b83657d30f895d98795d9d81f)
2024-07-01 18:06:09 +02:00
Kristof Provost
6bba78e6e9 iovctl: allow vlan restrictions to be passed to the driver
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

(cherry picked from commit c57c26179033f64c2011a2d2a904ee3fa62e826a)
2024-07-01 18:06:05 +02:00
Wei Hu
d56a912f2f Hyper-V: move memory alloc call for tlb hypercall out of smp_rendezvous
The allocation call could result in sleep lock violation if it is in
smp_rendezvous. Move it out. Also move the pcpu memory pointer to
vmbus_pcpu_data since it is only used on Hyper-V.

PR:		279738
Reported by:	gbe
Fixes:		2b887687edc25bb4553f0d8a1183f454a85d413d
MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit d0cb4674df97aa638d5d17861c364b1625f79401)
2024-07-01 13:33:08 +00:00
Wei Hu
451941677a Hyper_V: add a boot parameter to tlb flush hypercall
Add boot parameter hw.vmbus.tlb_hcall for tlb flush hypercall.
By default it is set to 1 to allow hyercall tlb flush. It can be
set to 0 in loader.conf to turn off hypercall and use system
provided tlb flush routine.

The change also changes flag in the per cpu contiguous memory
allocation to no wait to avoid panic happened some cases which there
are no enough contiguous memery available at boot time.

Reported by:	gbe
Tested by:	whu
MFC after:	1 week
Fixes:		2b887687edc25bb4553f0d8a1183f454a85d413d
Sponsored by:	Microsoft

(cherry picked from commit e02d20ddff7f9f9509b28095459327bc183dab8a)
2024-07-01 13:32:37 +00:00
Wei Hu
3c1f330088 Hyper-V: remove unused alloc_pcpu_ptr()
Fixes:		2b887687edc25bb4553f0d8a1183f454a85d413d
Sponsored by:	Microsoft

(cherry picked from commit fd911ae609247ef5c91493fb5506e77aa6e497bc)
2024-07-01 13:31:55 +00:00
Souradeep Chakrabarti
7ece5993b7 Hyper-V: TLB flush enlightment using hypercall
Currently FreeBSD uses IPI based TLB flushing for remote
TLB flushing. Hyper-V allows hypercalls to flush local and
remote TLB. The use of Hyper-V hypercalls gives significant
performance improvement in TLB operations.

This patch set during test has shown near to 40 percent
TLB performance improvement.

Also this patch adds rep hypercall implementation as well.

Reviewed by:	whu, kib
Tested by:	whu
Authored-by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Co-Authored-by:	Erni Sri Satya Vennela <ernis@microsoft.com>
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D45521

(cherry picked from commit 2b887687edc25bb4553f0d8a1183f454a85d413d)
2024-07-01 13:21:14 +00:00
Mariusz Zaborski
944827bcf6 isp: fix ISPCTL_ABORT_CMD switch case
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

(cherry picked from commit 8aa9192ce98aec07b24f8279c709237dd2c4421b)
2024-06-28 12:18:23 +02:00
Mark Johnston
0d03585e6b jedec_dimm: Use device_set_descf()
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

(cherry picked from commit 83caa244bc9eef6949a1250a875ad1409775a46e)
2024-06-27 11:27:42 -04:00
Mark Johnston
16cc589d91 mana: Use device_set_desc()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 89848b3445ad52c304e6f9c5036aa9108bedb4c8)
2024-06-27 11:27:41 -04:00
Mark Johnston
ddb9040fc2 oce: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit c704b87ba679563cb8b344da69aa3cb7118a10b0)
2024-06-27 11:27:41 -04:00
Mark Johnston
c07458f193 cfi: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 2ef1f61df2d5961ffff1205d4800e46efadbf5ba)
2024-06-27 11:27:41 -04:00
Mark Johnston
2e382b3bc8 superio: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 76a79178187f5a3ac05733e068c0860b14fd8632)
2024-06-27 11:27:41 -04:00
Mark Johnston
da334b4f54 hidbus: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 3f795763e45326489ab707c369b8daea495f6562)
2024-06-27 11:27:41 -04:00
Mark Johnston
4fcaee7a5f bxe: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 9da1b6dc161bfd7b494ba472cde33af49ef8196f)
2024-06-27 11:27:41 -04:00
Mark Johnston
9f74e5edaf bge: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 50505c853c6cf1a4e8fac54d20c43f0f91ff0c67)
2024-06-27 11:27:41 -04:00
Mark Johnston
14dbc9a4b4 bce: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit c0bd6ec3bb2414d23f3013766b79eed51b31f696)
2024-06-27 11:27:41 -04:00
Mark Johnston
d0983e084b liquidio: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 1794a0a87e0cecee1ef63fcf4f0a8a6cf6945dc8)
2024-06-27 11:27:41 -04:00
Mark Johnston
57d8375451 msk: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 443f33481e461ae1f36e0110537131b972ec6a37)
2024-06-27 11:27:41 -04:00
Mark Johnston
50d188a805 wbwd: Use device_set_descf()
No functional change intended.

(cherry picked from commit eb634b9f4f48c29753e177f3340d03f73a75dbe5)
2024-06-27 11:27:41 -04:00
Mark Johnston
b86ba6cdf1 iicbus: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 48f5a429c95513465327f722a8df52cb48eeb473)
2024-06-27 11:27:41 -04:00
Mark Johnston
e416932e18 netmap: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 44d36c9731c172977ad8a95a09c0d6fbddcc9b2f)
2024-06-27 11:27:41 -04:00
Mark Johnston
b8ddd59d9d amdsmn: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 48ef9cff9c2934d8a13eb8624c02050cd8f00595)
2024-06-27 11:27:41 -04:00
Mark Johnston
55156b1fc3 amdsbwd: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 1878529d2fc861ba2f14ec3c15bf373221883e41)
2024-06-27 11:27:41 -04:00
Mark Johnston
aebd6d5b1f arcmsr: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 4f0ff49fee00dee624e13b2d305cf9dfee395b7d)
2024-06-27 11:27:41 -04:00
Shailend Chand
224e20ceb1 gve: Make gve_free_qpls idempotent
This fixes a panic caused by double free.

PR:	kern/279410
Differential Revision: https://reviews.freebsd.org/D45489

(cherry picked from commit b81cbb12410b000074483899e61e9e767ba3ec1d)
2024-06-20 22:44:34 -07:00
Gordon Bergling
17bcc10aec virtio(4): Fix two typos in KASSERT messages
- s/emtpy/empty/

(cherry picked from commit 018a361f8902d629fca64be372ef9b266fee53ba)
2024-06-21 05:46:51 +02:00
Christos Margiolis
935c5a5554 sound: Remove outdated comment in dsp_oss_engineinfo()
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

(cherry picked from commit 914c2b3314e8f6e31833e33cfdcc4843f88fe31b)
2024-06-19 12:01:34 +02:00
Christos Margiolis
6f090333db sound: Fix oss_audioinfo's card_number, port_number and legacy_device
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

(cherry picked from commit 0f878cdfc5a46cc0dc198e12758f12558dfb1bf6)
2024-06-19 12:01:33 +02:00
Christos Margiolis
f1ee9f5425 sound: Support oss_audioinfo->cmd
Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45603

(cherry picked from commit 8e36d212594b542cb0c57d549e0b57fd0f7e307c)
2024-06-19 12:01:33 +02:00
Alan Somers
35e9830283 md: round-trip the MUSTDEALLOC and RESERVE options
If those options are requested when the device is created, ensure that
they will be reported by MDIOCQUERY.

Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1270

(cherry picked from commit 9d449caddd4f442ba4ebfd2edafa1aef4fcba4c8)
2024-06-15 07:03:23 -06:00
Christos Margiolis
e6ecffccde sound: Include sound(4) channel information in sndstat nvlist
Extend SNDST_DSPS_PROVIDER_INFO for sound(4) to include information
about each channel in a given device, similar to how cat'ing
/dev/sndstat with hw.snd.verbose=2 works.

While here, document all provider_info fields.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45501

(cherry picked from commit bbca3a75bb412f7106a569b82c616404103be084)
2024-06-14 18:57:57 +02:00
Maxime Thiebaut
1296443295 u3g: Add support for SIM7600G
Signed-off-by:	Maxime Thiebaut <maxime+freebsd@thiebaut.dev>
Reviewed by:	kp

(cherry picked from commit b5b90ff9844d1cb780ff777fc42ad393e4683563)
2024-06-12 21:34:25 +02:00
Bjoern A. Zeeb
0c2b2e5bd9 iwn(4): correct debug message: "not" to "no"
Sponosred by:	The FreeBSD Foundation

(cherry picked from commit 9e012a9da5df131b64c2dfd7d9b6645af4ccef0f)
2024-06-12 13:56:52 +00:00
Mark Johnston
3f6fc84ad9 proto: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 542f9494b747079b13f3ed672cd01fa902e98ff2)
2024-06-09 09:37:59 -04:00
Mark Johnston
d73f9fc264 uart: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 66d2d42a1f26a6ef868d7d46f87d6fad0bc099aa)
2024-06-09 09:37:58 -04:00
Mark Johnston
9905677886 mvs: Use device_set_desc(f)()
No functional change intended.

MFC after:	1 week

(cherry picked from commit a3b460d499a995eaf5a79d1b84e22b0d4eda8f2a)
2024-06-09 09:37:57 -04:00
Mark Johnston
ea71ec44e2 virtio: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit de140d60d5282b0dbf79979d04d5b6b11511e25d)
2024-06-09 09:37:56 -04:00
Mark Johnston
54c4a726f5 acpi: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit bad36a49985c3cd7bfcb1b35ce3ae37f007843ce)
2024-06-09 09:37:55 -04:00
Mark Johnston
dd8575e19a qlnx: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 801b12ba89af6377e30c15b9b68443f0d60d50bf)
2024-06-09 09:37:53 -04:00