With the old size, the string could easily be truncated, resulting in
non-unique identifiers.
PR: 287679
Reported by: Phil Krylov <phil@krylov.eu>
Reviewed by: kib
MFC after: 2 weeks
The TRNG service will return random data in x3. Use the correct field
when filling the buffer in trng_read.
This driver has not been in any release, so no security advisory is
needed.
Reviewed by: bz
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50979
In the SMCCC TRNG and Errata ABI drivers check if the version
functions are implemented before calling them. Without this the firmware
may complain about an unimplemented function being called.
Reported by: bz
Reviewed by: bz
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50978
Switch to the SMCCC not supported macro in smccc_arch_features. This
shouldn't be a functional change as the value is identical to the PSCI
value it replaces.
Reviewed by: bz, emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50977
The CH343 devices support any baud rate up to 6 Mbps.
PR: 272803
Reviewed by: imp
Tested by: joerg, Tomasz "CeDeROM" CEDRO <tomek_AT_cedro_DOT_info>
Differential Revision: https://reviews.freebsd.org/D46290
Provide flexibility to use format strings for gone_in(). As a side
effect, this removes hardcoded string "Obsolete code will be removed
soon:" from the message, so now it is obligation of the deprecated code to
provide a meaningful message. This required a small adoption of the
existing users: midi, drm2 and le(4). Note that gone_in() is not a public
KPI as it has no sense to use it outside of the FreeBSD tree.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50783
Pass 0 as the number of indirect descriptors when they are not
supported.
This fixes an issue on the Arm FVP model where we don't negotiate
them, however pass a number of segments greater than
VIRTIO_MAX_INDIRECT. This leads to virtqueue_alloc failing and
virtio_blk failing to attach.
Reviewed by: Harry Moulton <harry.moulton@arm.com>
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50909
Account for endianness when writing to 24bpp framebuffers. Also create a
vt_fb_mem_wr3 function to avoid code duplication.
Reviewed by: manu, imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50843
Make sure there is enough room to write more than one byte.
Reviewed by: manu, imp
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50842
We are currently not reporting any per-chain S:N values so remove
IEEE80211_R_C_RSSI and IEEE80211_R_RSSI along with it as it is set
already in the line above.
Sponsored by: The FreeBSD Foundation
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D50927
There is no point in assigning the channel index to the number of
chains for the RX status reporting. The value was not tagged as
being used. Rather than simply removing it try to fix it and
set the flag if we get a value.
Sposnored by: The FreeBSD Foundation
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D50926
Replace priorities specified by a base priority and some hardcoded
offset value by symbolic constants. Hardcoded offsets prevent changing
the difference between priorities without changing their relative
ordering, and is generally a dangerous practice since the resulting
priority may inadvertently belong to a different selection policy's
range.
Since RQ_PPQ is 4, differences of less than 4 are insignificant, so just
remove them. These small differences have not been changed for years,
so it is likely they have no real meaning (besides having no practical
effect). One can still consult the changes history to recover them if
ever needed.
No functional change (intended).
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45390
<sys/proc.h> doesn't need <sys/runq.h>. Remove this include and add it
back for kernel files that relied on the pollution.
Reviewed by: kib
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45387
Function pci_mask_msix uses cached value of MSI-X CTRL
register to verify if vector index is valid. Update
that value in pci_alloc_msix_method before it is
used to avoid kernel panic.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>
Reviewed by: jhb
Approved by: kbowling (mentor)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D49484
This commit adds a storage driver that supports the Universal Flash
Storage Host Controller Interface (UFSHCI) on FreeBSD.
Universal Flash Storage (UFS) is a flash-based mobile storage device
that replaces eMMC, aiming for high performance with low power. The UFS
Host Controller Interface (UFSHCI) is the host side controller and
connects UFS device to a system bus, such as PCIe.
The code targets the latest standards:
- UFS 4.1: https://www.jedec.org/standards-documents/docs/jesd220g
- UFSHCI 4.1: https://www.jedec.org/standards-documents/docs/jesd223f
The ufshci(4) driver implements controller/device initialization,
interrupt, single-doorbell(SDB) queue based IO requests. Support for
multi-queue (MCQ) IO requests is planned for a later commit.
Implemented features:
- PCIe bus support
- legacy(INTx) Interrupt Handling
- UIC command support
- UTP Transfer Request (UTR) support
- UTP Task Management Request (UTMR) support
- single doorbell queue (SDB) with multiple queue depth
- SCSI command set support
- sysctl
Work in progress:
- multi-Circular Queue (per-CPU IO queues)
- MSI-X interrupt Support
- write booster
- write Protect
- Host Performance Booster (HPB)
- interrupt aggregation
- ARM based system bus support
- ufs-utils port
Tests were performed on QEMU and an Intel-based laptop.
Since QEMU has an emulated UFS device, I tested on QEMU.
How to test on QEMU:
1. Run QEMU
$ qemu-system-x86_64 ... -device ufs -drive file=blk1g.bin,format=raw,if=none,id=luimg -device ufs-lu,drive=luimg,lun=0
2. Loading/unloading the ufshci module on QEMU
$ kldload /usr/obj/usr/src/amd64.amd64/sys/modules/ufshci/ufshci.ko
$ kldunload ufshci
Testing on real hardware:
- Samsung Galaxy Book S (Intel Lakefield) with UFS 3.0
- Lenovo duet 3 11ian8 (Intel N100) with UFS 2.1
Sponsored by: Samsung Electronics
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D50370
This was broken in c63d67e137, the early returns prevent building the
media lists as expected.
The BASE-T parts of the patch were suggested by "cyric@mm.st", while I
am adding the additional 40G AOC, 1CX, autoneg and unknown PHY fixes
based on code inspection. There may be additional work left here for
Broadcom but this is certainly better than the returns.
PR: 287395
Reported by: mickael.maillot@gmail.com, cyric@mm.st
Tested by: Einar Bjarni Halldórsson <einar@isnic.is>
MFC after: 1 week
It's okay if MCLBYTES is larger than the default receive buffer size.
Fixes: 71702df612 ("gve: Add support for 4k RX Buffers when using DQO queue formats")
This change adds support for using 4K RX Buffers when using DQO queue
formats when a boot-time tunable flag is set to true by the user.
When this flag is enabled, the driver will use 4K RX Buffer size either
when HW LRO is enabled or mtu > 2048.
Signed-off-by: Vee Agarwal <veethebee@google.com>
Reviewed by: markj, ziaee
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D50786
While attaching the qlnx driver we can end up trying to call ifmedia functions
before those are set up (through ether_ifattach() -> rtnl_handle_ifattach()
-> dump_iface() -> get_operstate_ether() -> ifmedia_ioctl()). Postpone the
ether_ifattach() until after the ifmedia setup.
Reviewed by: markj,zlei
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50819
HDMI audio did not work on my older Radeon GPU, the error message
during attach was:
hdac0: hdac_get_capabilities: Invalid corb size (0)
This is fixed by calling hdac_reset() before the HDA device
capabilities are retrieved. This solution was proposed by Andriy Gapon
in 2010, but apparently did not solve the problem reported at the time.
Approved by: christos
Differential Revision: https://reviews.freebsd.org/D50737
usb_msc_auto_quirk() potentially crashes usb devices with a hidden
storage (see bug 287333). These devices may still operate normally if
usb_msc_auto_quirk() would not be called all and the hidden storage is
ignored. This patch makes sure, that usb_msc_auto_quirk() is not called
when the UQ_MSC_IGNORE quirk is set for a device. It shouldn't be called
anyway if the hidden storage supposed to be ignored. This gives users a
chance to get their devices working by using
'usbconfig add_dev_quirk_vplh <vid> <pid> <lo_rev> <hi_rev> UQ_MSC_IGNORE'.
Reviewed by: imp
MFC After: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1716
Closes: https://github.com/freebsd/freebsd-src/pull/1716
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
Use LIST_FOREACH_SAFE to avoid a use-after-free in scmi_reqs_pool_free.
The next pointer will be invalid after the call to free meaning
LIST_FOREACH will dereference a freed struct to move to the next item.
Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D50753
Expose as read-only the configured transport properties.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47428
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Add a few basic traces to track SCMI messages lifecycle.
Tested on: Arm Morello Board
Reviewed by: Andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47427
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Add the core logic to handle the replies to pending command in an
asynchronous manner.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47426
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Split scmi_request internals into a TX and an RX phase, which will be
called, anyway, in sequence as before when a normal transmission is
requested.
No functional change.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47425
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
During normal operation, the SCMI stack, upon each transmission attempt,
takes care to automatically pick an appropriate, monotonically increasing,
sequence number to fill-in the token field in the egressing message.
This does not cope well with the alternative scenario in which, instead,
a complete and fully formed message is provided upfront: in such a case the
SCMI stack will have to use the already provided sequence number, embedded
in the message, to track such transaction.
Add a method to attempt to reserve a specific sequence number to be used
when a fully firmed (raw) message is handled.
Tested on: Arm Morello Board
Reported by: andrew
Sponsored by: Arm ltd
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Refactor allocation logic for scmi_req and introduce new helpers to be able
to obtain an scmi_msg reference to a freshly allocated request.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47423
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
SCMI transport characteristics can be optionally described in the
devicetree to override the default build-time values.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47422
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
The defined maximum payload size should not include header and status
field. Fix the definition accordingly, so that it matches the
definitions as can be found in the Linux SCMI stack.
The semantic of this define is important since it will then be possible
to override such values from devicetree, like in Linux.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D47421
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Once a message is received that fits into the RX buffer, update the
msg.rx_len field with the effective length of the message received.
Tested on: Arm Morello Board
Reviewed by: andrew
Sponsored by: Arm Ltd
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
API files are updated to have SPDX identifier and remove
longer form of license to ensure consistency with the
license format across all files.
Reviewed by: markj, ziaee
MFC after: 2 weeks
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D50379
Error handling in qat driver code has been refactored.
Mutex lock handling has also been added during driver
attach and detach. Also pci_disable_busmaster() is called in
adf_detach() to ensure proper cleanup during device detachment.
Reviewed by: markj, ziaee
MFC after: 2 weeks
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D50379