Commit graph

39364 commits

Author SHA1 Message Date
Alexander Motin
b7da472979 APEI: Improve multiple error sources handling.
Some AMD systems I have report 8 NMI and 3591 polled error sources.
Previous code could handle only one NMI source and used separate
callout for each polled source.  New code can handle multiple NMIs
and groups polled sources by power of 2 of the polling period.

MFC after:	2 weeks

(cherry picked from commit 2dfc1f7355)
2021-12-15 21:32:36 -05:00
Kornel Duleba
77b3cf989f pci: Don't try to read cfg registers of non-existing devices
Instead of returning 0xffs some controllers, such as Layerscape generate
an external exception when someone attempts to read any register
of config space of a non-existing device other than PCIR_VENDOR.
This causes a kernel panic.
Fix it by bailing during device enumeration if a device vendor register
returns invalid value. (0xffff)
Use this opportunity to replace some hardcoded values with a macro.

I believe that this change won't have any unintended side-effects since
it is safe to assume that vendor == 0xffff -> hdr_type == 0xffff.

Sponsored by:		Alstom
Obtained from:		Semihalf
Reviewed by:		jhb
MFC after:		2 weeks
Differential revision:	https://reviews.freebsd.org/D33059

(cherry picked from commit 68cbe189fd)
2021-12-15 11:46:46 +01:00
Andreas Wetzel
99e934e6f1 rtwn/usb: add product ID for Asus USB N10 Nano Rev. B1
According to information found on the internet the following products
use exactly the same hardware but probably different USB IDs:
- Edimax EW-7811Un V2 (v2)
- Edimax EW-7811GLN 2.0A (v2)
I am not adding them as I cannot verify.

PR:		254280

(cherry picked from commit cd6f0b4769)
2021-12-13 08:35:49 +02:00
Alexander Motin
1fb199ffa6 xhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.
MFC after:	2 weeks

(cherry picked from commit cfb0e4d76c)
2021-12-12 22:16:28 -05:00
Ed Maste
2f2988a3c7 bxe: tag files to skip clang-format formatting
bxe contains three files which are sets of constants or other data, and
might be auto-generated or have an upstream.  They are rather large
files and clang-format takes quite some time when run against them, so
just skip formatting.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27806

(cherry picked from commit c3295781fd)
2021-12-12 17:18:31 -05:00
Alexander Motin
155748c1e7 xhci: Add PCI IDs from recent Intel CPUs.
MFC after:	2 weeks

(cherry picked from commit 83d7b2f335)
2021-12-11 00:17:16 -05:00
Mitchell Horne
06dc4eab74 ucom: s/sio/ucom/
Seems like a copy-paste error, or at least this made more sense when the
sio(4) driver still existed. This modifies the debug port name displayed
at boot, but otherwise has no functional change.

Reviewed by:	hselasky
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D33278

(cherry picked from commit e43d081f35)
2021-12-10 14:31:20 -04:00
Andriy Gapon
0f048f199e twsi: unify error handling, explicitly handle more conditions
twsi_error() is a new function that stops the current transfer and sets
up softc when an error condition is detected.
TWSI_STATUS_DATA_WR_NACK, TWSI_STATUS_BUS_ERROR and
TWSI_STATUS_ARBITRATION_LOST are now handled explicitly rather than
via the catch-all unknown status.

Also, twsi_intr() now calls wakeup() in a single place when the
transfer is finished.

(cherry picked from commit a4fe892208)
2021-12-10 14:30:12 +02:00
Andriy Gapon
22989451b4 twsi: improve a handful of debug messages
- use 0x prefix for hex values
- print indexes and counts as decimals
- break too long lines

(cherry picked from commit 578707ed4e)
2021-12-10 14:30:12 +02:00
Andriy Gapon
5efa75707b twsi: do not attempt transfer if bus is not idle
(cherry picked from commit cb167e1ae9)
2021-12-10 14:30:12 +02:00
Andriy Gapon
bb8fac1ee1 twsi: remove redundant enabling of the controller
(cherry picked from commit bc02583c4d)
2021-12-10 14:30:12 +02:00
Andriy Gapon
109000c32d twsi: protect interaction between twsi_transfer and twsi_intr
All accesses to softc are now done under a mutex to prevent data races
between the open context and the interrupt handler.
Additionally, the wait time in twsi_transfer is bounded now.
Previously we could get stuck there forever if an interrupt got lost.

(cherry picked from commit 69cfa60ddd)
2021-12-10 14:30:12 +02:00
Michael Tuexen
42cb69e147 Hyper-V: hn: Enter network epoch when required
PR:				254695
(cherry picked from commit 26d79d40a7)
2021-12-10 11:50:01 +01:00
Alexander Motin
f8aedfec5d ig4: Add PCI IDs for Intel Alder Lake I2C controller.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks

(cherry picked from commit e8e8d2290e)
2021-12-08 20:37:28 -05:00
Alexander Motin
447d2569d6 APEI: Fix Generic Error Data Entry revision 3.0 handling.
Since revision 3.0 this structure grown another field, breaking access
to the following data structures.  This change fixes the PCIe errors
decoding on newer systems.

MFC after:	2 weeks

(cherry picked from commit ba83762a62)
2021-12-08 20:35:21 -05:00
Alexander Motin
9e41bccace ichsmb: Add PCI IDs for Intel Alder Lake SMBus controller
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks

(cherry picked from commit f29f6b2e1f)
2021-12-07 23:08:51 -05:00
Warner Losh
de8bb30885 mpr: fix freeze / release mismatch in timeout code
So, if we're processing a timeout, and we've sent an ABORT to the
firmware for that timeout, but not yet received the response from the
firmware, AND we get another timeout, we queue the timeout and freeze
the queue. However, when we've finally processed them all, we only
release the queue once. This causes all I/O to halt as the devq remains
frozen forever.

Instead, only freeze the queue when we start the process (eg set INRESET
on the target). This will allow the release when all the timed out I/Os
have finished ABORTing.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D33054

(cherry picked from commit a8837c77ef)
2021-12-06 08:56:00 -07:00
Elyes HAOUAS
27fceea98c Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
(cherry picked from commit 9097ac9af4)
2021-12-06 08:55:55 -07:00
Colin Percival
d03a8d181c randomdev: Remove 100 ms sleep from write routine
This was introduced in 2014 along with the comment (which has since
been deleted):
	/* Introduce an annoying delay to stop swamping */

Modern cryptographic random number generators can ingest arbitrarily
large amounts of non-random (or even maliciously selected) input
without losing their security.

Depending on the number of "boot entropy files" present on the system,
this can speed up the boot process by up to 1 second.

Reviewed by:	cem
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D32984

(cherry picked from commit 1580afcd6e)
2021-12-05 10:27:01 -08:00
Gordon Bergling
8460767ded mlx5: Correct a typo in a sysctl description
- s/parameteres/parameters/

(cherry picked from commit c937fb286f)
2021-12-05 10:08:07 +01:00
Gordon Bergling
abc50fc549 bce(4): Fix a typo in a sysctl description
- s/duirng/during/

(cherry picked from commit 25d0ccbe10)
2021-12-05 10:07:52 +01:00
Gordon Bergling
f51048b535 if_hn: Fix a few typos in comments and a sysctl description
- s/segement/segment/

(cherry picked from commit b15a632c41)
2021-12-03 16:54:11 +01:00
Gordon Bergling
d4c648f779 xen(4): Fix two typos in source code comments
- s/segement/segment/

(cherry picked from commit e3080a9cca)
2021-12-03 16:52:44 +01:00
Gordon Bergling
3f9dc7b20b mpr(4): Fix a typo in a source code comment
- s/segement/segment/

(cherry picked from commit ddeb702f7b)
2021-12-03 16:52:17 +01:00
Gordon Bergling
022814e08b nvme(4): Correct a typo in a sysctl description
- s/printting/printing/

(cherry picked from commit 5f8ccf6515)
2021-12-03 16:51:46 +01:00
Andriy Gapon
a138038f69 twsi: compile in support for debug messages, disabled by default
Debug messages can now be enabled per driver instance via a new sysctl.
Also, debug messages in TWSI_READ and TWSI_WRITE require debug level
greater than 1 as they are mostly redundant because callers of those
functions already log most interesting results.

NB: the twsi drivers call their device iichb, so the new sysctl will
appear under dev.iichb.N.

(cherry picked from commit a2793d6182)
2021-12-03 09:24:22 +02:00
Andriy Gapon
c141cad41d twsi: remove write-only softc field
(cherry picked from commit f00bc54f62)
2021-12-03 09:24:11 +02:00
Andriy Gapon
3b7478a7c4 twsi: add more of status definitions
For completeness and for future use.

(cherry picked from commit de86f339cd)
2021-12-03 09:23:58 +02:00
Andriy Gapon
bab53d3532 twsi: sort headers, remove unneeded
(cherry picked from commit 26559dd177)
2021-12-03 09:21:36 +02:00
Hans Petter Selasky
9e89269ee7 usb/u3g: Add support for Quectel EM05.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/565
Sponsored by:	NVIDIA Networking

(cherry picked from commit 0229172a65)
2021-12-02 15:51:46 +01:00
Mark Johnston
aa5664c0f5 safexcel: Fix -Wunused-but-set-variable warnings
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 60c95f3163)
2021-12-01 07:40:49 -05:00
John Baldwin
1097f2f40d evdev: Add parentheses around '-' expression in operand of '&'.
This fixes a -Wparentheses error with GCC 9.

Reviewed by:	wulf
Differential Revision:	https://reviews.freebsd.org/D31947

(cherry picked from commit d99c87c8d5)
2021-12-01 00:45:30 +03:00
Wei Hu
d11e9de955 Hyper-V: vPCI: Prepopulate device bars
In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by:	khng@freebsd.org
Tested by:	khng@freebsd.org
MFC after:	2 weeks
Sponsored by:	Microsoft

(cherry picked from commit 75412a521f)
2021-11-30 07:43:32 +00:00
Gordon Bergling
18e627e9c7 ppbus(4): Fix a typo in source code comment
- s/quering/querying/

Obtained from:	NetBSD

(cherry picked from commit 975e2e3f84)
2021-11-28 12:43:11 +01:00
Gordon Bergling
7125ea0f15 firewire(4): Fix a typo in a source code comment
- s/unavailabe/unavailable/

(cherry picked from commit 3e5ddef0fd)
2021-11-28 12:42:33 +01:00
Gordon Bergling
f9236943e1 ixl(4): Fix a typo in a sysctl description
(cherry picked from commit d7125850f0)
2021-11-28 12:42:14 +01:00
Gordon Bergling
197f36e000 iscsi(4): Fix a typo in a source code comment
- s/conditon/condition/

(cherry picked from commit 5e21882bb4)
2021-11-28 12:41:52 +01:00
Andriy Gapon
f537b30564 icee: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 01e3492337)
2021-11-27 10:47:25 +02:00
Andriy Gapon
83f68b84c2 ds1307: allow configuration via hints on FDT-based systems
On-board devices should be configured via the FDT and overlays.
Hints are primarily useful for external and temporarily attached devices.
Adding hints is much easier and faster than writing and compiling
an overlay.

(cherry picked from commit 27645265c4)
2021-11-27 10:44:16 +02:00
Alfredo Dal'Ava Junior
c41d129485 ofwfb: fix vga/hdmi console with ASMEDIA during boot on powerpc64(le)
On recent OpenBMC firmware, the onboard ASMEDIA video card framebuffer
address was removed from device tree for security purposes (value is set
to zero to avoid leaking the address).

This patch works around the problem by taking framebuffer base address
from the "ranges" property of a parent node.

Reviewed by:	luporl, jhibbits (on IRC)
MFC after:	2 weeks
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D30626

(cherry picked from commit b042d10cdc)
2021-11-26 20:50:55 -03:00
Ed Maste
c433c96d86 Update deprecation version for drivers removed in main
Removal of the amr, esp, iir, mly and twa drivers was planned before
FreeBSD 13, but did not happen before the branch.  Update the
depreciation notices to indicate that they are gone in FreeBSD 14.

Sponsored by:	The FreeBSD Foundation
2021-11-25 11:54:12 -05:00
Ka Ho Ng
35f26bdf59 iser: Remove redundant linuxkpi MODULE_DEPEND
Since ibcore depends on linuxkpi, there is no need to pull in the
linuxkpi dependency in iser.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	trasz
Differential Revision:	https://reviews.freebsd.org/D32977

(cherry picked from commit f7523c8a19)
2021-11-24 15:17:26 -05:00
Andriy Gapon
f1d2f22b34 pca954x: driver for PCA954x / TCA954x I2C switches
At the moment only PCA9548A is supported and has been tested.

(cherry picked from commit c0525ab1d1)
2021-11-24 16:19:09 +02:00
John Baldwin
d8feb950a6 Move the ICL_CONN_*LOCK* macros to <dev/iscsi/icl.h>.
These macros are not backend-specific but reference a
backend-independent field in struct icl_conn.

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

(cherry picked from commit e900338c09)
2021-11-23 15:11:53 -08:00
John Baldwin
412a8b92d9 Further refine the ExpDataSN checks for SCSI Response PDUs.
According to 11.4.8 in RFC 7143, ExpDataSN MUST be 0 if the response
code is not Command Completed, but we were requiring it to always be
the count of DataIn PDUs regardless of the response code.

In addition, at least one target (OCI Oracle iSCSI block device)
returns an ExpDataSN of 0 when returning a valid completion with an
error status (Check Condition) in response to a SCSI Inquiry.  As a
workaround for this target, only warn without resetting the connection
for a 0 ExpDataSN for responses with a non-zero error status.

PR:		259152
Reported by:	dch
Reviewed by:	dch, mav, emaste
Fixes:		4f0f5bf995 iscsi: Validate DataSN values in Data-In PDUs in the initiator.
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32650

(cherry picked from commit cdbc4a074b)
2021-11-23 15:11:44 -08:00
John Baldwin
9811763b41 iscsi: Validate DataSN values in Data-In PDUs in the initiator.
As is done in the target, require that DataSN values are consecutive
and in-order.  If an out of order Data-In PDU is received, force a
session reconnect.  In addition, when a SCSI Response PDU is received,
verify that the ExpDataSN field matches the count of Data-In PDUs
received for this command.  If not, force a session reconnect.

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

(cherry picked from commit 4f0f5bf995)
2021-11-23 15:11:44 -08:00
John Baldwin
ff590791ff cxgbe: Only run ktls_tick when NIC TLS is enabled.
Previously the body of ktls_tick was a nop when NIC TLS was disabled,
but the callout was still scheduled consuming power on otherwise-idle
systems with Chelsio T6 adapters.  Now the callout only runs while NIC
TLS is enabled on at least one interface of an adapter.

Reported by:	mav
Reviewed by:	np, mav
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D32491

(cherry picked from commit ef3f98ae47)
2021-11-23 15:11:43 -08:00
Mark Johnston
200d473202 hyperv: Register the MSR-based timecounter during SI_SUB_HYPERVISOR
This reverts commit 9ef7df022a ("hyperv: Register hyperv_timecounter
later during boot") and adds a comment explaining why the timecounter
needs to be registered as early as it is.

PR:		259878
Fixes:	9ef7df022a ("hyperv: Register hyperv_timecounter later during boot")
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ed6a9452be)
2021-11-22 08:45:34 -05:00
Andriy Gapon
ee82e15cd9 pcf8574: driver for 8-pin quasi-bidirectional GPIO over I2C
(cherry picked from commit 6354154ef5)
2021-11-21 11:59:34 +02:00
Warner Losh
706f4f705b vt: fix git mismerge
I made a mistaking in merging the final commits for the devctl changes. This
adds the 'hushed' variable and has the correct dates for the manuals.

Pointy hat to: imp

(cherry picked from commit 80f21bb039)
2021-11-18 22:10:07 -07:00