Commit graph

39357 commits

Author SHA1 Message Date
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
Warner Losh
a82d7aeb3f vt: Add devctl message for bells
Generate VT events when the bell beeps. When coupled with disabling the
bell,this allows custom bells to be rung when we'd otherwise beep.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D32656

(cherry picked from commit 4ac3d08a96)
2021-11-18 21:52:22 -07:00
Warner Losh
534fb4b8ae vt(4): Connect to teken's TP_SETBELLPD
Add the glue needed to listen to TP_SETBELLPD which teken uses to
inform its client drivers about the results of parsing
\e[=<pitch>;<duration>B. It converts these to a Hz value for the
tone/pitch of the bell and a duration in ms. There's some loss of
precision because <pitch> in the escape seuquence is defined to be
(1193182 / pitch) Hz and <duration> is in 10ms units. Also note that
kbdcontrol also parses 'off' but then doesn't send the proper escape
sequence, leading me to wonder if that's another bug since teken
appears to parse that sequence properly and I've added code here to
treat that as the same as quiet or disabled.

In general, Hz from 100 to 2000 is good. Outside that range is possible,
but even at 100Hz the square wave is starting to sound bad and above
2000Hz the speaker may not respond.

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

(cherry picked from commit 2533eca1c2)
2021-11-18 21:52:22 -07:00
Warner Losh
87586bff11 sysbeep: Adjust interface to take a duration as a sbt
Change the 'period' argument to 'duration' and change its type to
sbintime_t so we can more easily express different durations.

Reviewed by:	tsoome, glebius
Differential Revision:	https://reviews.freebsd.org/D32619

(cherry picked from commit 072d5b98c4)
2021-11-18 21:52:22 -07:00
Bjoern A. Zeeb
54aa95f082 mii: update URL for OUIs
Update the URL for OUIs as the old one is 404 not even 301 anymore.

(cherry picked from commit 8e902c1d21)
2021-11-19 00:01:27 +00:00
Dmitry Salychev
151d59e386 Parse named nodes from IORT ACPI on arm64
Add the ability to map named components from IORT to their
SMMU or ITS node in order to setup interrupts.
It is now possible to find a node by its name (substring) and
resource ID similar to PCI nodes.
This is needed by work on a driver for NXP's Second Generation
Data Path Acceleration Architecture (DPAA2).

Reviewed by:	andrew

(cherry picked from commit d178b1f878)
2021-11-19 00:01:27 +00:00
Bjoern A. Zeeb
378083e188 mlx4: rename conflicting netdev_priv() to mlx4_netdev_priv()
netdev_priv() is a LinuxKPI function which was used with the old ifnet
linux/netdevice.h implementation which was not adaptable to modern
Linux drviers unless rewriting them for ifnet in first place which
defeats the purpose.
Rename the netdev_priv() calls in mlx4 to mlx4_netdev_priv()
returning the ifnet softc to avoid conflicting symbol names
with different implementations in the future.

(cherry picked from commit 9d593d5a76)
2021-11-19 00:01:26 +00:00
Bjoern A. Zeeb
6acb9d5f95 net80211/drivers: improve ieee80211_rx_stats for band
While IEEE80211_R_BAND was defined, there was no place to store the
band.  Add a field for that, adjust ieee80211_lookup_channel_rxstatus()
to require it, and update drivers passing "R_{FREQ|IEEE}" in already to
provide the band as well.  For the moment keep the fall-back code
requiring all three fields.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 9a6695532b)
2021-11-19 00:01:25 +00:00