Commit graph

42375 commits

Author SHA1 Message Date
Robert Wing
d9b3bba2f3 mpr: endianess fix for set/get dpm page0
Reviewed by:	oshogbo, imp
Sponsored by:   Klara, Inc.
Sponsored by:   Datazap
Differential Revision:	https://reviews.freebsd.org/D43505
2024-01-31 17:33:05 -09:00
Bryan Venteicher
e6b8c1d780 virtio: Add more device IDs from the specification 2024-01-30 23:08:12 -06:00
John Baldwin
a5a965d759 cxgbe tom: Enable ULP_MODE_TCPDDP on demand
Most ULP modes in cxgbe's TOE are enabled on the fly when a protocol
is needed (e.g. ULP_MODE_ISCSI is enabled by cxgbei when offloading a
connection using iSCSI, and ULP_MODE_TLS is enabled when RX TLS keys
are programmed for a TOE connection).  The one exception to this is
ULP_MODE_TCPDDP.

Currently the cxgbe driver enables ULP_MODE_TCPDDP when a TOE
connection is first created.  However, since DDP connections cannot be
converted to other connection types, this requires some special
handling in the driver.  For example, iSCSI daemons use the SO_NO_DDP
socket option to ensure TOE connections use ULP_MODE_NONE so they can
be converted to ULP_MODE_ISCSI.  Similarly, using TLS receive offload
(ULP_MODE_TLS) requires disabling TCP DDP for new connections by
default.

This commit changes cxgbe to instead switch a connection from
ULP_MODE_NONE to ULP_MODE_TCPDDP when a connection first attempts to
use TCP DDP via aio_read(2).  This permits connections to always start
as ULP_MODE_NONE and switch to a protocol-specific mode as needed.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43670
2024-01-30 16:41:43 -08:00
John Baldwin
afaefb7737 cxgbe tom: Limit TOE connections to 2 reassembly islands always
Previously this was only limited on T6 cards to support switching from
ULP_MODE_NONE to ULP_MODE_TLS.  To support switching to
ULP_MODE_TCPDDP, enable this for all adapters.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43669
2024-01-30 16:41:23 -08:00
John Baldwin
c3d4aea6c5 cxgbe: Add counters for POSIX async I/O requests handled by the driver
Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43668
2024-01-30 16:40:31 -08:00
Florian Walpen
6c892b79de snd_hdspe(4): Per device sysctl for sample rate.
Some hardware setups require a specific sample rate due to devices being
connected to digital ports (AES, S/PDIF, ADAT). Add a per device sysctl
"sample_rate" to let the user override sample rate requests from the pcm
infrastructure, when needed.

Differential Revision:	https://reviews.freebsd.org/D43659
2024-01-30 15:07:57 +00:00
John Baldwin
5650bd3fe8 nvme: Use the NVMEF macro to construct fields
Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43605
2024-01-29 11:01:13 -08:00
John Baldwin
3a477a9b70 nvme: Add NVMEF helper macro as the inverse of NVMEV
This macro accepts a field name and a value for the field and
constructs the shifted field value.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43604
2024-01-29 11:00:57 -08:00
John Baldwin
8488fc417f nvme: Use the NVMEM macro instead of expanded versions
A few of these omitted a shift of 0, but this is more consistent.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43602
2024-01-29 10:59:37 -08:00
John Baldwin
1dade1f255 nvme: Rename NVMEB helper macro to NVMEM
The current macro always builds a full mask for a named field, so use
the M suffix for mask.

Reviewed by:	chuck, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43601
2024-01-29 10:58:28 -08:00
John Baldwin
479680f235 nvme: Use the NVMEV macro instead of expanded versions
Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43595
2024-01-29 10:30:54 -08:00
Warner Losh
3be59adbb5 vtnet: Adjust for ethernet alignment.
If the header that we add to the packet's size is 0 % 4 and we're
strictly aligning, then we need to adjust where we store the header so
the packet that follows will have it's struct ip header properly
aligned.  We do this on allocation (and when we check the length of the
mbufs in the lro_nomrg case). We can't just adjust the clustersz in the
softc, because it's also used to allocate the mbufs and it needs to be
the proper size for that. Since we otherwise use the size of the mbuf
(or sometimes the smaller size of the received packet) to compute how
much we can buffer, this ensures no overflows. The 2 byte adjustment
also does not affect how many packets we can receive in the lro_nomrg
case.

PR:			271288
Sponsored by:		Netflix
Reviewed by:		bryanv
Differential Revision:	https://reviews.freebsd.org/D43224
2024-01-28 22:08:55 -07:00
Warner Losh
34f0a01b6b mpi3mr: Fix confusion over | and &
Use sc->mpi3mr_debug & MPI3MR_IOT over the | version to test if a bit is
set.

CID: 1529718
Sponsored by:		Netflix
2024-01-28 21:43:56 -07:00
Florian Walpen
fb87726303 snd_hdspe(4): Per device sysctl for period.
Let the user choose a period (interrupt cadence in samples), in the
official RME drivers this setting is available as "Buffer Size".
Override the period propagated through blocksize by pcm channel latency
settings (see sound(4)), since these are unreliable and differ between
playback and recording channels.

Differential Revision: https://reviews.freebsd.org/D43527
2024-01-28 20:20:26 +00:00
Gordon Bergling
551921a757 if_eqos: Fix a typo in a kernel error message
- s/errer/error/

MFC after:	5 days
2024-01-28 16:42:12 +01:00
Andriy Gapon
c053a56c0f hdaa_pcmchannel_setup: do not advertise AC3 8+0
The rest of the sound system supports 7+1 maximum and is not aware of 8+0.

I believe that these messages are caused by 8+0:
kernel: feeder_init(0xfffff801f935d680) on feeder_matrix returned 22
kernel: pcm0: feeder_build_matrix(): can't add feeder_matrix
2024-01-28 15:18:55 +02:00
Andriy Gapon
9cdf326b4f run acpi_shutdown_final later to give other handlers a chance
For example, shutdown_panic wants to produce some output and maybe take
some input before a system is actually reset.

The change should only make difference for the case of system reset
(reboot), poweroff and halt should not be affected.

The change makes difference only if hw.acpi.handle_reboot is set.  It
used to default to zero until r213755 / ac731af567.
2024-01-28 15:04:55 +02:00
Andriy Gapon
cbf7c81b60 ichsmb: fix block read operation
First of all and unlike I2C, it's not the master that dictates how many
bytes to read in block read operation.  It's the device that informs the
master how many bytes it's sending back.

Thus, for ichsmb_bread() the count parameter is purely an output
parameter.  The code has been changed to reflect that.
The sanity checking of the response length is now done once it (the
first byte of the response) is received.

While here, handling of ICH_HST_STA_FAILED status bit has been added.
Plus some code style improvements and some new code comments in the
vicinity of the changed code.
2024-01-28 14:54:19 +02:00
Andriy Gapon
8fdb261601 change ipmi watchdog to awlays stop when system is halted
That is, wd_shutdown_countdown value is ignored when halting.

A halted system should remain halted for as long as needed until
a power cycle, so the watchdog should not reset the system.
2024-01-28 14:45:16 +02:00
Andriy Gapon
90dc788982 fix signature of ipmi_shutdown_event
The function had a signature of watchdog_fn while in fact it is used as
shutdown_fn.
2024-01-28 14:44:13 +02:00
Andriy Gapon
43ca38eb59 mmc_fdt_parse: remove redundant bootverbose check 2024-01-28 13:39:03 +02:00
Andriy Gapon
ea7f45d3d8 dwmmc: fix a typo 2024-01-28 13:37:57 +02:00
Andriy Gapon
b587cb69f3 audio_soc: set "status" as being at simplebus
This is more true and less confusing than previous "at EXPERIMENT".
2024-01-28 13:32:38 +02:00
Andriy Gapon
320e4beb97 gpiopower: trigger low, high and both edges
Power off or reset may be activated either by low or high signal or by an
edge.  So, try everything.

Also, the driver now supports DTS properties for timings.

Finally, the driver does not change the pin configuration during attach.
It is assumed that the pin is already in a state that does not trigger
the power event (otherwise we wouldn't be running).
2024-01-28 13:29:41 +02:00
Andriy Gapon
5b54b6ac8c usbdevs: add Ralink RT7601 aka MT7601
This is a popular USB WiFi chip.
Unfortunately, it's not supported by FreeBSD yet.
2024-01-28 13:10:51 +02:00
Andriy Gapon
34694f3da7 ds1307: restore hints-based configuration on FDT systems
Fall-through to non-FDT probe code if no matching device node is found.
While here, fix indentation of the switch statement.
Also, make the device description for the hints-based attachment the
same as for FDT attachment.

Fixes:	2486b446db ds1307: add support for the EPSON RX-8035SA I2C RTC
2024-01-28 12:45:57 +02:00
Alexander Motin
3883c6fbf2 ntb_hw_plx: Workaround read-only scratchpad registers
On several systems we've noticed that when NTB link goes down, the
Physical Layer User Test Pattern registers we use as additional
scratchpad registers (that is explicitly allowed by the chip specs)
become read-only for about 100us.  I see no explanation for this in
the chip specs, neither why it was not seen before, may be a race.
Since we do need these registers, workaround it by repeating writes
until we succeed or 1ms timeout expire.

MFC after:	1 week
2024-01-27 17:29:01 -05:00
John Baldwin
3cf553288b simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43442
2024-01-23 09:38:25 -08:00
John Baldwin
0b60d7a600 ofw_pcib: Use bus_generic_rman_*
- Implement bus_map/unmap_resource pulling bits from the previous
  ofw_pcib_activate/deactivate_resource.  One difference here is that
  the bus_unmap_resource implementation uses bus_space_unmap instead
  of pmap_unmapdev as a complement to the existing use of bus_space_map.

- Use bus_generic_rman_* in various routines for memory and I/O port
  resources.

- Use pci_domain_* for PCI_RES_BUS in
  ofw_pcib_activate/deactivate_resource.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43441
2024-01-23 09:38:09 -08:00
John Baldwin
9c4effb106 hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources
Specifically for bus_activate/adjust/deactivate_bus methods.

Differential Revision:	https://reviews.freebsd.org/D43431
2024-01-23 09:35:58 -08:00
John Baldwin
e9eb353b32 pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43429
2024-01-23 09:35:36 -08:00
John Baldwin
c2d4fef658 acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43428
2024-01-23 09:35:22 -08:00
John Baldwin
23e3b83ab6 pcib: Add helper routines for [de]activating PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43427
2024-01-23 09:35:08 -08:00
Gordon Bergling
e125371fb6 dwc: Fix two typos in a source code comment
- s/recevied/received/
- s/descriptr/descriptor/

MFC after:	3 days
2024-01-22 22:03:29 +01:00
Gordon Bergling
97a4045aaf virtio(4): Fix a typo in a source code comment
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:59:06 +01:00
Gordon Bergling
d743711016 usb: Fix a typo in a source code comment
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:57:06 +01:00
Gordon Bergling
b2c48aa4d1 vmd(4): Fix typos in source code comments
- s/harwdare/hardware/

MFC after:	3 days
2024-01-22 21:55:33 +01:00
Gordon Bergling
b971c51a4d aic7xxx: Fix two typos in source code comments
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:47:23 +01:00
Aaron LI
43be2d7aaf wg: detach bpf upon destroy as well
bpfattach() is called in wg_clone_create(), but the bpfdetach() is
missing from wg_close_destroy().  Add the missing bpfdetach() to avoid
leaking both the associated bpf bits as well as the ifnet that bpf will
hold a reference to.

PR:		276526
MFC after:	3 days
2024-01-22 10:22:44 -06:00
Christos Margiolis
f7d3d0a4de sound: use device_set_descf() to set device descriptions
Commit 6b6914c1e2 introduced a printf-like version of
device_set_desc(), so use it to simplify device description setting in
the audio stack.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D43467
2024-01-22 11:44:51 +02:00
Gordon Bergling
54e047b13b aic7xxx: Fix a typo in a kernel message
- s/recevied/received/

MFC after:	5 days
2024-01-20 22:01:10 +01:00
Gordon Bergling
e1c0d368d6 bce(4): Fix a typo in a kernel message
- s/adddress/address/

MFC after:	5 days
2024-01-20 20:10:21 +01:00
Gordon Bergling
2b1e4e5be3 atse(4): Fix a typo in a source code comment
- s/addresss/address/

MFC after:	3 days
2024-01-20 17:35:51 +01:00
Gordon Bergling
ced92d000a ciss(4): Fix a typo in a source code comment
- s/strucutre/structure/

MFC after:	3 days
2024-01-20 17:34:25 +01:00
Gordon Bergling
623848af60 vmware: Fix a typo in a source code comment
- s/withing/within/

MFC after:	3 days
2024-01-20 17:33:27 +01:00
Gordon Bergling
f5e3329a5a usb: Fix two typos in source code comments
- s/bascially/basically/
- s/assistence/assistance/

MFC after:	3 days
2024-01-20 17:32:20 +01:00
Chuck Silvers
2f2da21740 mpi3mr: add missing terminator entry to mpi3mr_identifiers array
Reported by:	KASAN
Sponsored by:	Netflix
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43519
2024-01-19 15:58:41 -08:00
Mark Johnston
47a6fb9d5a mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page()
These functions may map more memory for DMA than is actually used, since
the allocator operates on multiples of a 4KB page size.  Thus,
bus_dmamap_sync() can trigger KMSAN reports when the unused portion of
a page is not zero-ed.

Reported by:	KMSAN
Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D43133
2024-01-18 16:52:17 -05:00
Aaron LI
7a4d1d1df0 if_wg: fix access to noise_local->l_has_identity and l_private
These members are protected by the identity lock, so rlock it in
noise_remote_alloc() and then assert that we have it held to some extent
in noise_precompute_ss().

PR:		276392
2024-01-17 17:29:54 -06:00
Aaron LI
b891f61ef5 if_wg: fix erroneous calculation in calculate_padding() for p_mtu == 0
In practice this is harmless; only keepalive packets may realistically have
p_mtu == 0, and they'll also have no payload so the math works out the same
either way.  Still, let's prefer technical accuracy and calculate the amount
of padding needed rather than the padded length...

PR:		276363
2024-01-17 17:29:52 -06:00