Commit graph

39805 commits

Author SHA1 Message Date
Emmanuel Vadot
f379ab270c twsi: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 4f118605ad)
2022-05-16 15:15:44 +02:00
Emmanuel Vadot
3485ff9587 if_dwc: Plug set but not used variable
Sponsored by:	Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 79778f8692)
2022-05-16 15:15:44 +02:00
Emmanuel Vadot
8d672e8449 ofw_cpu: Make ext_resources non-optional for arm* and riscv
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
For RISC-V it was always enabled.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33835

(cherry picked from commit 02398e581d)
2022-05-16 13:45:38 +02:00
Emmanuel Vadot
c9fab04640 uart_dev_snps: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33828

(cherry picked from commit 5c00765bf2)
2022-05-16 13:45:37 +02:00
Emmanuel Vadot
0c7209c263 usb: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33827

(cherry picked from commit fb6cebd8bd)
2022-05-16 13:45:36 +02:00
Emmanuel Vadot
5e1a684c4c uart_dev_imx: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33826

(cherry picked from commit 4f64df4e32)
2022-05-16 13:45:36 +02:00
Emmanuel Vadot
65ae10de64 if_cgem: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33825

(cherry picked from commit d46fd9e855)
2022-05-16 13:45:36 +02:00
Emmanuel Vadot
69b0498ff8 sdhci: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33824

(cherry picked from commit a813b0965d)
2022-05-16 13:45:35 +02:00
Emmanuel Vadot
354beb15b7 twsi: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33823

(cherry picked from commit 36498b1408)
2022-05-16 13:45:35 +02:00
Emmanuel Vadot
be92a2d12c dwmmc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33822

(cherry picked from commit b4cc0f7d28)
2022-05-16 13:45:35 +02:00
Emmanuel Vadot
3766f99c48 mmc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:      1 month
Differential Revision:	https://reviews.freebsd.org/D33821

(cherry picked from commit 78f8b4aafa)
2022-05-16 13:45:35 +02:00
Emmanuel Vadot
57766bd637 dwc: Make ext_resources non-optional
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D33820

(cherry picked from commit a5339ba3ff)
2022-05-16 13:45:34 +02:00
Emmanuel Vadot
40d62bb4f9 dwmmc: Properly implement power_off/power_up
Write to the PWREN register should be done in update_ios based
on the power_mode value in the ios struct.
Also none of the manual (RockChip and Altera) and Linux talks about
the needed for an inverted PWREN value so just remove this.
This fixes eMMC (and possibly SD) when u-boot didn't setup the controller.

Reported by:	avg
Tested-on:	Rock64, RockPro64

(cherry picked from commit af32e2cc32)
2022-05-16 11:33:42 +02:00
Emmanuel Vadot
1be298a0bf dwmmc: Remove dwmmc_setup_bus call from start_cmd
There is no need to re-setup the bus before each commands.
Tested-on:  Rock64, RockPro64
Reported by:	    avg

(cherry picked from commit 559f60214b)
2022-05-16 11:33:41 +02:00
Emmanuel Vadot
c8dbee973e dwmmc: Fix MMCCAM block size support
When using SDIO the block size if per function and most of the time
not equal to MMC_SECTOR_SIZE, fix sdio on dwmmc by setting the correct
block size in the mmc registers.

MFC after:    1 month
Sponsored by:	Diablotin Systems

(cherry picked from commit 990a1dbf6f)
2022-05-16 11:33:41 +02:00
Kevin Bowling
3f8306cf8e e1000: Increase rx_buffer_size to 32b
Extend the size of the local rx_buffer_size variable to account for
larger buffer sizes possible on 82580, i350 chips.

From i350 datasheet, 6.2.10 Initialization Control 4 (LAN Base Address
+ Offset 0x13):
When 4 ports are enabled maximum buffer size is 36 KB. When 2 ports are
enabled maximum buffer size is 72 KB. When only a single port is
enabled maximum buffer size is 144 KB.

and 8.3:
The overall available internal buffer size in the I350 for all ports is
144 KB for receive buffers and 80 KB for transmit Buffers. Disabled
ports memory can be shared between active ports and sharing can be
asymmetric. The default buffer size for each port is loaded from the
EEPROM on initialization.

From the reporter:
But for I350 when only 2 ports are used PBA size can be set as 72KB
(see datasheet RXPbsize or e1000_rxpbs_adjust_82580 function in
e1000_82575.c). In this case calculating the rx_buffer_size overflows
as 0x0048 << 10 = 73728 or 0x12000 pushed into u16. It is then set as
0x2000 or 8192.

PR:		263896
Reported by:	hannula@gmail.com
Tested by:	hannula@gmail.com
Approved by:	markj
Differential Revision:	https://reviews.freebsd.org/D35167

(cherry picked from commit 6987c47569)
2022-05-15 10:04:00 -07:00
Scott Long
c16cbd2e91 Default to always accepting the PHY that's present. Linux did
something similar a while back, and there are devices in the wild
that otherwise won't attach.  This patch is temporary until the
PHY code is further cleared up.

Obtained from: grehan

(cherry picked from commit 6f3c0d2764)
2022-05-15 12:29:57 -04:00
John Baldwin
d32888f4fe ix: Remove cpu_id and related code from ixgbe_if_msix_intr_assign.
Reviewed by:	erj
Differential Revision:	https://reviews.freebsd.org/D34828

(cherry picked from commit c0a42a0451)
2022-05-13 13:14:07 -07:00
John Baldwin
eb9716f41b powermac_nvram: Actually return EBUSY on error from open.
(cherry picked from commit 124b6786e4)
2022-05-13 13:13:33 -07:00
John Baldwin
2cb2e6691f ce,cp: Remove pointless checks for <sys/cdefs.h>
Both of these headers check for _SYS_CDEFS_H_ after including
<sys/param.h> which itself includes <sys/cdefs.h>.

PR:		263102 (exp-run)
Reviewed by:	brooks, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D34795

(cherry picked from commit 17554af4e8)
2022-05-13 13:11:30 -07:00
John Baldwin
d7cd104458 sbni: Use memset to clear flags structure in attach.
NFC, just less nausea-inducing.

(cherry picked from commit 9c11e6af89)
2022-05-13 10:44:36 -07:00
John Baldwin
6aca4e6127 rtwn: Restore RF_ENV control type after initializing RF.
Both rwlwifi in Linux and rtwn in OpenBSD restore this register,
and the existing code was saving the value and not using it.

Reported by:	-Wunused-but-set-variable
Reviewed by:	imp
Obtained from:	OpenBSD
Differential Revision:	https://reviews.freebsd.org/D34838

(cherry picked from commit 50e3b6aa48)
2022-05-13 10:44:10 -07:00
John Baldwin
872428acea qlnx: Return error from qlnxr_mod_load if it fails.
Fix qlnx_rdma_register_if return ENXIO rather than -1 on error and
propagate that error to the caller in qlnxr_mod_load.

(cherry picked from commit ee07d71213)
2022-05-13 10:43:38 -07:00
John Baldwin
3fc514f4a7 otus: Return computed error value instead of ENXIO from otus_raw_xmit.
(cherry picked from commit c0ca75b0db)
2022-05-13 10:43:31 -07:00
John Baldwin
e994b6f6d3 mlx5: Pass the correct data pointer to the add_dst_cb instead of NULL.
Reported by:	-Wunused-but-set-variable
Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D34812

(cherry picked from commit ebb16d5e93)
2022-05-13 10:43:25 -07:00
John Baldwin
6dcb516ba6 bnhd: Write out updated resource dependencies from the table.
The driver parsed the table to update the relevant resource map
registers, but failed to write the new register value after computing
it.

Reported by:	-Wunused-but-set-variable
Reviewed by:	landonf, imp
Differential Revision:	https://reviews.freebsd.org/D34814

(cherry picked from commit 3cebca152b)
2022-05-13 10:43:14 -07:00
John Baldwin
ad17102e4e isci: Propagate error from bus_dma_tag_create.
Return error from isci_controller_allocate_memory if bus_dma_tag_create
fails instead of ignoring the error.

(cherry picked from commit bbfec32d15)
2022-05-13 10:43:02 -07:00
John Baldwin
1db9d7b775 cxgbei: Support unmapped I/O requests.
- Add icl_pdu_append_bio and icl_pdu_get_bio methods.

- Add new page pod routines for allocating and writing page pods for
  unmapped bio requests.  Use these new routines for setting up DDP
  for iSCSI tasks with a SCSI I/O CCB which uses CAM_DATA_BIO.

- When ICL_NOCOPY is used to append data from an unmapped I/O request
  to a PDU, construct unmapped mbufs from the relevant pages backing
  the struct bio.  This also requires changes in the t4_push_pdus path
  to support unmapped mbufs.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34383

(cherry picked from commit 2beaefe884)
2022-05-11 13:52:48 -07:00
John Baldwin
34185c0a1a icl_soft: Use PHYS_TO_DMAP instead of pmap_map_io_transient.
The latter API is not actually MI but is only supported on amd64,
arm64, and RISC-V.

Sponsored by:	Chelsio Communications

(cherry picked from commit 832acea92f)
2022-05-11 13:52:41 -07:00
John Baldwin
5ee84b311e iscsi: Support unmapped I/O requests in the default initiator.
- Add icl_pdu_append_bio and icl_pdu_get_bio methods.

- When ICL_NOCOPY is used to append data from an unmapped I/O request
  to a PDU, construct unmapped mbufs from the relevant pages backing
  the struct bio.

- Use m_apply with a helper to compute crc32 digests on mbuf chains
  to handle unmapped mbufs.  Since m_apply requires PMAP_HAS_DMAP
  for unmapped mbufs, only support unmapped requests when PMAP_HAS_DMAP
  is true.

Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D34406

(cherry picked from commit 530e725d8e)
2022-05-11 13:52:33 -07:00
John Baldwin
156e41c4b7 iscsi: Handle unmapped I/O requests.
Don't assume that csio->data_ptr is pointer to a data buffer that can
be passed to icl_get_pdu_data and icl_append_data.  For unmapped I/O
requests, csio->data_ptr is instead a pointer to a struct bio as
indicated by CAM_DATA_BIO.  To support these requests, add
icl_pdu_append_bio and icl_pdu_get_bio methods which pass a pointer to
the bio and an offset and length relative to the bio's buffer.

Note that only backends supporting unmapped requests need to implement
these hooks.

Implement simple no-op hooks for the iser backend.

Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34382

(cherry picked from commit 7aab9c14a4)
2022-05-11 13:52:17 -07:00
John Baldwin
08b090d767 iser: Fix check for opcodes in iser_conn_pdu_append_data.
Reviewed by:	mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34487

(cherry picked from commit c6a43f7f10)
2022-05-11 13:50:40 -07:00
John Baldwin
94b27fc812 iscsi: Use ICL_NOCOPY for SCSI command immediate data and R2T.
The associated csio ccb will not be completed via xpt_done() until
after the associated PDUs are transmitted to the other side and either
the original PDU is acked with a SCSI response, or a response is
received for a subsequent abort CCB (which means the earlier PDU has
also been sent since it would have been sent before the abort PDU).

This does assume that once an I/O request has been aborted, no further
PDUs with data payload are queued for that I/O request.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D34405

(cherry picked from commit 9c7a4875bc)
2022-05-11 13:50:26 -07:00
Henri Hennebert
d6a32773ea rtsx: Number of tweaks for RTS5260.
MFC after:	2 weeks

(cherry picked from commit 8290c14420)
2022-05-10 20:56:53 -04:00
John Baldwin
95303c0646 hyperv storvsc: Don't abuse struct sglist to hold virtual addresses.
struct sglist is intended for holding S/G lists of physical address
ranges, not virtual address ranges.  GCC 9.x issues several warnings
due to casts between pointers and integers of different sizes as a
result (vm_paddr_t is 64-bits on i386).  Instead, add a local 'struct
hv_sglist' which uses an array of 'struct iovec' to hold the S/G list
of virtual address ranges.

Differential Revision:	https://reviews.freebsd.org/D31933

(cherry picked from commit 53e938e408)
2022-05-10 17:03:58 -07:00
Hans Petter Selasky
75a5bdd453 xhci(4): Tweak USB port speed checks to allow newer super speed generations.
This allows setting the U1 and U2 port timeout values.

Sponsored by:	NVIDIA Networking

(cherry picked from commit a1c0442b41)
2022-05-10 10:05:32 +02:00
Hans Petter Selasky
a11ac66f1c xhci(4): Properly define all basic USB port speeds.
Sponsored by:	NVIDIA Networking

(cherry picked from commit d730333c80)
2022-05-10 10:05:29 +02:00
Hans Petter Selasky
51a9a42f0c mlx5en(4): Use hard-coded 4K page size for RQ/SQ/CQ.
The page size specified for RQ, SQ and CQ is always in units of 4KBytes.
Make sure we subtract MLX5_ADAPTER_PAGE_SHIFT, 12, instead of PAGE_SHIFT
which may vary. This fixes support for using the mlx5en driver on systems
having non-4K page size.

Linux commit:
68cdf5d6e91068c98d6091b193dc7a5ab7dcf5eb

Sponsored by:	NVIDIA Networking

(cherry picked from commit d735d604f0)
2022-05-10 10:02:28 +02:00
Alex Richardson
299d5e2b64 Add missing const after 6c4f95161d
I accidentally didn't include hunk in the committed patch.

Fixes:		6c4f95161d ("virtio: make the write_config buffer argument const")
(cherry picked from commit 9017870541)
2022-05-07 13:09:43 +01:00
Alex Richardson
b7a47939e2 virtio: make the write_config buffer argument const
No functional change intended, but noticed that we could add const here
while adding linuxkpi support for virtio.

Reviewed By:	bryanv, imp
Differential Revision: https://reviews.freebsd.org/D32370

(cherry picked from commit 6c4f95161d)
2022-05-07 13:09:09 +01:00
Hans Petter Selasky
6d8c6b24ee xhci(4): Always add and evaluate the slot context.
Because the maximum number of endpoint contexts is stored there.

Tested by:	ehaupt@
PR:		262882
Approved by:	re (gjb, early MFC)
Sponsored by:	NVIDIA Networking

(cherry picked from commit 09dd1adfa4)
2022-05-03 21:43:13 +02:00
Hans Petter Selasky
610528736f xhci(4): Only drop BULK and INTERRUPT endpoints to reset data toggle.
Only drop BULK and INTERRUPT endpoints, to reset the data toggle,
because for other endpoint types this is not critical.

While at it fix some whitespace.

Tested by:	ehaupt@
PR:		262882
Approved by:	re (gjb, early MFC)
Sponsored by:	NVIDIA Networking

(cherry picked from commit e276d28150)
2022-05-03 21:41:51 +02:00
Ed Maste
5e017a8474 teken: color #3 is yellow not brown - use TC_YELLOW as the name
The console escape code standard (ECMA-48) specifies color #3 (escape
code 33) as yellow.  A brown console color is an artifact of the VGA
palette, which replaces dim (but not bright) yellow with brown.

Reviewed by:	adrian, imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34531

(cherry picked from commit cf8880d52b)
2022-05-03 14:20:44 -04:00
John Baldwin
62acf8a36a cxgbe tom: Compile fix for disabled KTR trace.
Sponsored by:	Chelsio Communications

(cherry picked from commit bca6e339ac)
2022-04-29 16:10:58 -07:00
John Baldwin
3b29ee793e cxgbe tom: Use VM_PAGE_TO_PHYS().
Sponsored by:	Chelsio Communications

(cherry picked from commit 87b0e7711f)
2022-04-29 16:10:43 -07:00
John Baldwin
64d35ef56a cxgbe tom: Use be64toh instead of htobe64 to convert to host order.
This is a no-op but more accurately conveys intent.

Sponsored by:	Chelsio Communications

(cherry picked from commit 44e7472d0e)
2022-04-29 16:10:34 -07:00
John Baldwin
05da0093a6 cxgbe tom: Use vm_paddr_t for physical addresses in page pod routines.
Sponsored by:	Chelsio Communications

(cherry picked from commit de414339c9)
2022-04-29 16:10:27 -07:00
John Baldwin
04e7565968 cxgbe: Move page pods KTR traces under VERBOSE_TRACES.
(cherry picked from commit 2753997438)
2022-04-29 16:09:53 -07:00
John Baldwin
ca0ad465d1 cxgbei: Replace worker thread pools with per-connection kthreads.
Having a single pool of worker threads adds extra complexity and
overhead.  The software backend also uses per-connection kthreads.

Sponsored by:	Chelsio Communications

(cherry picked from commit 511b83b167)
2022-04-29 16:09:02 -07:00
John Baldwin
17c0d2d43a cxgbei: Dispatch sent PDUs to the NIC asynchronously.
Previously the driver was called to send PDUs to the NIC synchronously
from the icl_conn_pdu_queue_cb callback.  However, this performed a
fair bit of work while holding the icl connection lock.  Instead,
change the callback to add sent PDUs to a STAILQ and defer dispatching
of PDUs to the NIC to a helper thread similar to the scheme used in
the TCP iSCSI backend.

- Replace rx_flags int and the sole RXF_ACTIVE flag with a simple
  rx_active bool.

- Add a pool of transmit worker threads for cxgbei.

- Fix worker thread exit to depend on the wakeup in kthread_exit()
  to fix a race with module unload.

Reported by:	mav
Sponsored by:	Chelsio Communications

(cherry picked from commit fd8f61d6e9)
2022-04-29 16:08:35 -07:00