Commit graph

39438 commits

Author SHA1 Message Date
Michal Meloun
d6529c0d12 pci_dw_mv: Don't enable unhandled interrupts.
Mainly link errors interrupts should only be activated on fully linked port,
otherwise noise on lanes can cause livelock. But we don't have error
counters yet, so leave these interrupts disabled.

(cherry picked from commit ce5a4083de)
2022-01-20 11:35:51 +01:00
Michal Meloun
139afdb172 simple_mfd: switch to controllable locking for syscon provider.
MFC after	3 weeks

(cherry picked from commit f97f57b518)
2022-01-20 11:34:28 +01:00
Michal Meloun
f277be277d extres/clk: Add a method to detect the HW state of the clock gate.
- add method to read gate enable/disable staust from HW
- show gate status in sysctl clock dump

MFC after:	1 week

(cherry picked from commit 1a74d77f85)
2022-01-20 11:14:22 +01:00
Michal Meloun
3d4b9e5fa1 extres/clk: Improve sysctl dump of clocks.
Always recalculate the frequency, the cache is lazily initialized so it is not always up to date.
While I'm in mark sysctl as MPSAFE.

Discussed with:	manu, adrian
MFC after:	1 week

(cherry picked from commit 72a2f3b5e2)
2022-01-20 11:14:04 +01:00
Michal Meloun
a5e76683b2 dwmmc: Calculate the maximum transaction length correctly.
We should reserve two descriptors (not MMC_SECTORS) for potentially
unaligned (so bounced) buffer fragments, one for the starting fragment
and one for the ending fragment.

Submitted by:	kjopek@gmail.com
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D30387

(cherry picked from commit dfb7360222)
2022-01-20 11:11:17 +01:00
Michal Meloun
57dd17dd60 Fix error value returned by ofw_bus_gen_get_node().
By definition ofw_bus_get_node() should  consistently return -1 when there
is no associated OF node.

MFC after:	4 weeks
Discussed with:	nwhitehorn
Analyzed in: 	https://reviews.freebsd.org/D30761

(cherry picked from commit 3eae4e106a)
2022-01-20 11:00:55 +01:00
Stefan Eßer
dc4114875e Make CPU_SET macros compliant with other implementations
(cherry picked from commit e2650af157)
2022-01-14 18:17:30 +02:00
Greg V
ae4067ce94 efifb,vbefb: implement vd_fini
This removes the pmap entry when switching away to e.g. drm fb.

Differential Revision:	https://reviews.freebsd.org/D29020
MFC After:	1 month

(cherry picked from commit 8ebda6e44b)
2022-01-14 16:55:23 +01:00
Mark Johnston
4905ce27b8 mvneta: Unconditionally print an error message if mii_attach() fails
The error message is useful for diagnosing mvneta_attach() failures.

(cherry picked from commit ed166a0173)
2022-01-11 09:28:33 -05:00
Alexander Motin
4ee9fbcd85 acpi_support: Remove CTLFLAG_NEEDGIANT from sysctls.
MFC after:	2 weeks

(cherry picked from commit 6237a1cc2d)
2022-01-09 19:30:14 -05:00
Alexander Motin
1b1f80ae1c sound: Remove CTLFLAG_NEEDGIANT from some sysctls.
While there, remove some dead code.

MFC after:	2 weeks

(cherry picked from commit 3b4c543322)
2022-01-09 19:29:59 -05:00
Alexander Motin
f39bf9a217 acpica: Remove CTLFLAG_NEEDGIANT from most sysctls.
MFC after:	2 weeks

(cherry picked from commit 3e68d2c52b)
2022-01-09 19:29:55 -05:00
Alexander Motin
6bc8606fca pccbb: Remove Giant mention in comments.
MFC after:	2 weeks

(cherry picked from commit 22405bb2e4)
2022-01-08 20:24:13 -05:00
Alexander Motin
2a36679b74 amdtemp: Remove CTLFLAG_NEEDGIANT from sysctls.
It seems to be needed only to serialize very old K8 registers access.
Introduce separate lock for that and remove Giant dependency.

MFC after:	2 weeks

(cherry picked from commit 6c101ed7a3)
2022-01-08 20:24:07 -05:00
Alexander Motin
cd9fe8d81d uart: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit c214c2c004)
2022-01-08 20:24:01 -05:00
Alexander Motin
7518562484 hwpmc: Remove CTLFLAG_NEEDGIANT from sysctl.
MFC after:	2 weeks

(cherry picked from commit 1886cef69b)
2022-01-08 20:23:58 -05:00
Hans Petter Selasky
457750da86 snd_uaudio(4): Loosen up the USB MIDI permissions.
This makes USB MIDI more userfriendly for desktop users.

PR:		260489
Sponsored by:	NVIDIA Networking

(cherry picked from commit 2fcd7d380b)
2022-01-07 14:23:26 +01:00
Scott Long
ea4e9becc7 Fix "set but not used" warnings in the mpr driver. This fixes a minor
bug in error handling.

(cherry picked from commit 61f17c5fd6)
2022-01-06 14:08:50 -05:00
Warner Losh
59e2f48e03 mpr: Minor formatting changes to match mps.
Minor reformatting nits to make mprsas_scsiio_timeout match
mpssas_scsiio_timeout more closely. The differences aren't necessary and
are distracting when comparing the routines. No functional changes.

Sponsored by:		Netflix

(cherry picked from commit 2bbaed4d7f)
2022-01-06 14:08:24 -05:00
Warner Losh
726d8e1852 mps(4): Fix unmatched devq release.
Port 9781c28c6d and a8837c77ef to the mps driver.  Before this
change devq was frozen only if some command was sent to the target after
reset started, but release was called always.  This change freezes the
devq immediately, leaving mprsas_action_scsiio() check only to cover
race condition due to different lock devq use.

This should also avoid unnecessary requeue of the commands, creating
additional log noise and confusing some broken apps. It also avoids a
'busy' requeue of I/Os failing when we're doing recovery that takes
longer than the normal busy timeout. These I/Os failing can lead to
filesystems being unmounted in the force unmount case for I/O errors.

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

(cherry picked from commit a10253cffe)
2022-01-06 14:03:38 -05:00
Scott Long
0565198d80 Fix "set but not used" warnings in the mps driver.
(cherry picked from commit bcce9c5bed)
2022-01-06 14:01:59 -05:00
Warner Losh
f9c51d3a1d mps: Fix debugging line
Print cm instead of sc here, as is done in mpr. We can get the sc from
cm, but not vice versa.

Sponsored by:		Netflix

(cherry picked from commit b086bc0bf1)
2022-01-06 14:01:19 -05:00
Andrew Turner
bc98adaf6a Check cpu_softc is not NULL before dereferencing
In the acpi_cpu_postattach SYSINIT function cpu_softc may be NULL, e.g.
on arm64 when booting from FDT. Check it is not NULL at the start of
the function so we don't try to dereference a NULL pointer.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 4e50efb194)
2022-01-04 13:08:58 -05:00
Alexander Motin
6b06f8a792 amdtemp: Revert related part of "Make CPU children" commit.
While it still looks like previous code worked by coincidence, this
change broke things even more instead of fixing.

Reported by:	avg@
MFC after:	1 week

(cherry picked from commit 94a72c5ac4)
2022-01-04 12:21:49 -05:00
Alexander Motin
a77188ffd3 acpi_cpu: Fix panic if some CPU devices are disabled.
While there, remove couple unneeded global variables.

(cherry picked from commit 695323ae88)
2022-01-04 12:21:46 -05:00
Alexander Motin
b7668d009e Make CPU children explicitly share parent unit numbers.
Before this device unit number match was coincidental and broke if I
disabled some CPU device(s).  Aside of cosmetics, for some drivers
(may be considered broken) it caused talking to wrong CPUs.

(cherry picked from commit d3a8f98acb)
2022-01-04 12:21:42 -05:00
Alexander Motin
083a2ff0f0 acpi_cpu: Make device unit numbers match OS CPU IDs.
There are already APIC ID, ACPI ID and OS ID for each CPU.  In perfect
world all of those may match, but at least for SuperMicro server boards
none of them do.  Plus none of them match the CPU devices listing order
by ACPI.  Previous code used the ACPI device listing order to number
cpuX devices.  It looked nice from NewBus perspective, but introduced
4th different set of IDs. Extremely confusing one, since in some places
the device unit numbers were treated as OS CPU IDs (coretemp), but not
in others (sysctl dev.cpu.X.%location).

(cherry picked from commit c8077ccd70)
2022-01-04 12:21:35 -05:00
Alexander Motin
2572b6bd6b xen/blkfront: Remove CTLFLAG_NEEDGIANT from sysctl.
It only converts bit field into string.  It does not need locking.

MFC after:	1 week

(cherry picked from commit 54daceab55)
2022-01-02 16:39:28 -05:00
Bjoern A. Zeeb
a34668185b modules: increase MAXMODNAME and provide backward compat
With various firmware files used by graphics and wireless drivers
we are exceeding the current 32 character module name (file path
in kldxref) length.
In order to overcome this issue bump it to the maximum path length
for the next version.
To be able to MFC provide backward compat support for another version
of the struct as the offsets for the second half change due to the
array size increase.

MAXMODNAME being defined to MAXPATHLEN needs param.h to be
included first.  With only 7 modules (or LinuxKPI module.h) not
doing that adjust them rather than including param.h in module.h [1].

Reported by:	Greg V (greg unrelenting.technology)
Sponsored by:	The FreeBSD Foundation
Suggested by:	imp [1]
Reviewed by:	imp (and others to different level)
Differential Revision:	https://reviews.freebsd.org/D32383

(cherry picked from commit df38ada293)
2021-12-30 18:26:18 +00:00
Bjoern A. Zeeb
8adc24f7c5 USB dwc3 controller: add quirk snps,dis_rxdet_inp3_quirk
Add support for the "snps,dis_rxdet_inp3_quirk" quirk needed
at least on SolidRun's HoneyComb.

Reviewed by:	manu, mw
Differential Revision: https://reviews.freebsd.org/D32921

(cherry picked from commit 3987e50611)
2021-12-29 16:02:51 +00:00
Bjoern A. Zeeb
907c4e7538 USB: add CYUSB330x to usbdevs
Add the Cypress dual USB3/2 HUB CYUSB330x as found in SolidRun's
HoneyComb to usbdevs.

(cherry picked from commit 1910048eb9)
2021-12-29 16:02:38 +00:00
Andriy Gapon
bf206683a8 amdsbwd: always enable watchdog register decoding
This seems to be required even if the watchdog is accessed via the common
MMIO space.

Tested on:
- Ryzen 3 3200U APU;
- Ryzen 7 5800X CPU with X570 chipset.

(cherry picked from commit cca0d3bbd8)
2021-12-27 13:37:29 +02:00
Andriy Gapon
96097be6a8 vmxnet3: skip zero-length descriptor in the middle of a packet
Passing up such descriptors to iflib is obviously wasteful.
But the main conern is that we may overrun iri_frags array because of
them.  That's been observed in practice.

Also, assert that the number of fragments / descriptors / segments is
less than IFLIB_MAX_RX_SEGS.

Sponsored by:	Panzura LLC

(cherry picked from commit 9c612a5d0a)
2021-12-27 13:37:12 +02:00
黃清隆
a6f70ce9fc sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886.
1. Doorbell interrupt status may arrive lately when doorbell interrupt on
   ARC-1886.
2. System boot up hung when ARC-1886 with no volume created or no device
   attached.

Many thanks to Areca for continuing to support FreeBSD.

(cherry picked from commit 6964b77e59)
2021-12-26 22:54:48 -08:00
Mark Johnston
2520c9ba7e qat: Address -Wunused-but-set-variable warnings
(cherry picked from commit 8fcf230c13)
2021-12-26 19:15:14 -05:00
Andriy Gapon
fe3c0370da twsi: use twsi_error() to handle wrong bus status when starting
(cherry picked from commit 46e0c03795)
2021-12-26 12:15:18 +02:00
Alexander Motin
e6140a05bc hwpmc: Add IDs for Intel Comet/Ice/Tiger/Rocketlake CPUs.
MFC after:	1 month

(cherry picked from commit 913c07a049)
2021-12-25 19:47:16 -05:00
Gordon Bergling
56cb816fb7 sound(4): Fix a typo in a source code comment
- s/aggresively/aggressively/

(cherry picked from commit d34632a235)
2021-12-25 11:40:16 +01:00
Ram Kishore Vegesna
cc3114e17b ocs_fc: Populate subvendor and subdevice ids.
Enable serialnumber reporting.

Reviewed by: mav
MFC after: 3 days

(cherry picked from commit cba757ef2a)

ocs_fs(4): Fix some common typos in source code comments

- s/transfered/transferred/
- s/associted/associated/

MFC after:	3 days

(cherry picked from commit 16b71d98d9)
2021-12-24 14:28:15 +05:30
Alexander Motin
f9c97b8ada hpt27xx: Remove FreeBSD 9.x support including Giant.
MFC after:	2 weeks

(cherry picked from commit 63e0f96ace)
2021-12-23 20:05:21 -05:00
Alexander Motin
7f703988b5 ahc: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks

(cherry picked from commit 35b2021a0a)
2021-12-23 20:05:13 -05:00
Alexander Motin
4fd804ef66 ahci(4): Allow enclosure emulation without hardware.
After 53f5ac1310 allowed SATA device mapping to enclosure slots,
it may have sense to provide enclosure device emulation even without
real hardware interface like SGPIO just for purposes of physical
device location tracking (still assuming straight cabling).

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 9aba757e92)
2021-12-23 20:05:10 -05:00
Alexander Motin
dee2739713 wbwd: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks

(cherry picked from commit fdec27ed82)
2021-12-23 20:05:06 -05:00
Alexander Motin
93ce10ed26 hptiop: Remove Giant locking around ioctls.
The methods have their own locking and don't require Giant.

MFC after:	2 weeks

(cherry picked from commit e06c67eef8)
2021-12-23 20:05:03 -05:00
Alexander Motin
951183ac83 fxp: Mark sysctls with CTLFLAG_MPSAFE.
MFC after:	2 weeks

(cherry picked from commit 35efbedc98)
2021-12-23 20:03:09 -05:00
Alexander Motin
c5794c708c fxp: Remove unneeded Giant from bus_dma_tag_create().
All bus_dmamap_load() calls here use BUS_DMA_NOWAIT.

MFC after:	2 weeks

(cherry picked from commit 5ae7518b7b)
2021-12-23 20:03:05 -05:00
Andriy Gapon
a520d08538 twsi: fix handling of consecuitve write messages in transaction
Make sure to reset 'message_done' flag when jumping from a message to the
next one within the same interrupt handler call.  This happens only when
a write with no-stop flag message is followed by a write with no-start
flag message.
Without this fix the second message would be prematurely "completed"
without waiting for an ACK (or NACK) for its first byte and without
sending subsequent bytes (if any).

Fixes:		ff1e8581 twsi: support more message combinations in transfers

(cherry picked from commit e5268c3d43)
2021-12-23 10:45:38 +02:00
Andriy Gapon
524020aa37 ds3231: allow configuration via hints on FDT systems
(cherry picked from commit 1256067c5c)
(cherry picked from commit b277ef3304)
2021-12-23 10:44:54 +02:00
Vincenzo Maffione
ecb7f44be9 e1000: fix interface capabilities management
The e1000 drivers (em, lem, igb) are currently looking at the
iflib copies of the capabilities bitvectors (scctx->isc_capabilities
and scctx->isc_capenable) rather than the ifnet ones
(ifp->if_capabilities and ifp->if_capenable). However, the latter
are the ones that are actually updated by ifconfig and that should
be used by the drivers during interface operation. The former are
set by the driver on interface attach (for iflib internal use)
and should not be used anymore by the driver.
This patch fixes the e1000 driver to use the correct bitvectors.

PR:		260068
Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33154

(cherry picked from commit e0f4cdba53)
2021-12-22 08:50:35 +00:00
Emmanuel Vadot
6bd6344f13 fb: Add new FBTYPE_EFIFB
Currently the type isn't set in the fbtype struct so any userland
program that call the FBIOGTYPE ioctl will think it's a FBTYPE_SUN1BW
which is far from the truth.
No app that I found find checks the type but at least now it's correct.

Reviewed by:	emaste, tsoome
MFC after:	2 weeks
Sponsored by:   Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33221

(cherry picked from commit ca23e9d2ac)
2021-12-21 10:21:26 +01:00