In function 'wg_aip_add()', the error path of returning ENOMEM when
(node == NULL) is forgetting to unlock the radix tree, and thus may lead
to a deadlock.
PR: 275001
Reviewed by: kp
MFC after: 1 week
(cherry picked from commit dcc4d2939f789a6d1f272ffeab2068ba2b7525ea)
KIOXIA CD8 SSDs routinely take ~25 seconds to delete non-empty
namespace. In some cases like hot-plug it takes longer, triggering
timeout and controller resets after just 30 seconds. Linux for many
years has separate 60 seconds timeout for admin queue. This patch
does the same. And it is good to be consistent.
Sponsored by: iXsystems, Inc.
Reviewed by: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42454
(cherry picked from commit 8d6c0743e36e3cff9279c40468711a82db98df23)
Commit 4692906480 made e6000sw's
implementation of miibus_(read|write)reg assume that the softc lock is
held. I presume that is to avoid lock recursion in e6000sw_attach() ->
e6000sw_attach_miibus() -> mii_attach() -> MIIBUS_READREG().
However, the lock assertion in e6000sw_readphy_locked() can fail if a
different driver uses the interface to probe registers. Work around the
problem by providing implementations which lock the softc if it is not
already locked.
PR: 274795
Fixes: 4692906480 ("e6000sw: add readphy and writephy wrappers")
Reviewed by: kp, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42466
(cherry picked from commit 725962a9f4c050b21488edd58d317e87c76d6f66)
The driver has a tunable hw.xn.enable_lro which is intended to control
whether LRO is enabled. This is currently non-functional - even if its
set to zero, the driver still requests LRO support from the backend.
This change fixes the feature so that if enable_lro is set to zero, LRO
no longer appears in the interface capabilities and LRO is not requested
from the backend.
PR: 273046
MFC after: 1 week
Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D41439
(cherry picked from commit da4b0d6eb06d730487d48e15d2d5e10c56266fd9)
The specification for the Toeplitz function doesn't require to set the key
explicitly to be symmetric. In case a symmetric functionality is required
a symmetric key can be simply used.
Wrongly forcing the algorithm to symmetric causes the wrong packet
distribution and a performance degradation.
Link: https://lore.kernel.org/r/20190723065733.4899-7-leon@kernel.org
Fixes: 28d6137008b2 ("IB/mlx5: Add RSS QP support")
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Alex Vainman <alexv@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
[khng: cherry-picked from Linux
b7165bd0d6cbb93732559be6ea8774653b204480]
Sponsored by: Juniper Networks, Inc.
MFC after: 7 days
Reviewed by: kib, zlei
Differential Revision: https://reviews.freebsd.org/D42178
(cherry picked from commit 813d981e1e78daffde4b2a05df35d054fcb4343f)
QEMU emulates Hyper-V [1] but lacks the emulation for vmbus_res, thus no
coherence information is available. Add NULL check for it and fallback
to no coherence. This will prevent FreeBSD guests from panic on QEMU
with the Hyper-V enlightenment hv-synic enabled.
For real Hyper-V, both gen1 and gen2 have vmbus_res then they are not
affected by this change.
1. https://www.qemu.org/docs/master/system/i386/hyperv.html
PR: 274810
Reviewed by: mhorne, emaste, delphij, whu
Diagnosed by: mhorne
Fixes: e7a9817b8d32 Hyper-V: vmbus: implementat bus_get_dma_tag in vmbus
Insta-MFC approved by: re (delphij) for 14.0-RC4
Differential Revision: https://reviews.freebsd.org/D42414
(cherry picked from commit 63bf943d4af17799cef21e2bb78dd28003ce1ce5)
Currently if _BBN doesn't match the first bus in the decoded bus range
from _CRS for a Host to PCI bridge, the driver fails to attach as a
defensive measure.
There is now firmware in the field where these do not match, and the
_BBN values are clearly wrong, so rather than failing attach, trust
the range from _CRS over _BBN.
Co-authored-by: Justin Gibbs <gibbs@FreeBSD.org>
Reported by: gibbs
Reviewed by: imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D42231
(cherry picked from commit 22a6678b627b39ceb94f7323be1010e928d92494)
It is observed that netvsc's send rings could stall on the latest
Azure Boost platforms. This is due to vmbus_rxbr_read() routine
doesn't check if host is waiting for more room to put data, which
leads to host side sleeping forever on this vmbus channel. The
problem was only observed on the latest platform because the host
requests larger buffer ring room to be available, which causes
the issue to happen much more easily.
Fix this by adding check in the vmbus_rxbr_read call and signaling
the host in the callers if check returns positively.
Reported by: NetApp
Tested by: whu
Sponsored by: Microsoft
(cherry picked from commit 49fa9a64372b087cfd66459a20f4ffd25464b6a3)
Move creation of watchdog process from just before we configure the
interrupt config hook to into the config hook itself. This prevents it
from racing the config intr hook and doing an extra reset of the
card. This extra reset is usually harmless, but sometimes it can prevent
discovery of devices if done at just the wrong time. This can lead to no
disks being registered in a box full of disks, for example. Starting it
later eliminates this race, making discovery reliable.
Reviewed by: imp
(cherry picked from commit 7e02c7074c4c6df77b860e0dbcd032a2ea04b98b)
Problem: Under certain I/O conditions, a program doing large block disk
reads can cause a controller to crash.
Root Cause: The SCSI read request and destination address in the BDMA
descriptor is incorrect, causing the BDMA engine in the controller to
assert.
Fix: Change the alignment for creating bus_dma_tags in the driver from
PAGE_SIZE (4k) to 1, which allows the controller to manage it's own
address range for BDMA transactions.
Risk: Medium
Exposure: This reverts a change first made to support NVMe drives on
Excalibur. At that time a 4k alignment was necessary. This no longer
seems to be the case.
PR: 259541
Reported by: Ka Ho Ng <khng@freebsd.org>
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41619
(cherry picked from commit f07b267d8cc87e88be3c78aa69504b5ebc6571ee)
pqisrc_free_device frees the device softc with the os spinlock
held. This causes crashes when devices are removed because the memory
free might sleep (which is prohibited with spin locks held). Drop the
spinlock before releasing the memory.
MFC After: 2 days
PR: 273289
Reviewed by: imp
(cherry picked from commit b064a4c9eed5b1dd2a40fc4fd2cb7e738b681547)
This is a simple RTC driver for the rv3032 from Microcrystal.
Just the basic functionality is implemented (no timer, alarm etc ..).
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41995
(cherry picked from commit 1d6a6a524409662992ca96bc91ae69b2a2a5ff35)
This IP is found in Xilinx SoC, it only been tested on ZynqMP (arm64)
so only enable it there for now.
Differential Revision: https://reviews.freebsd.org/D41994
(cherry picked from commit 137b58e4d2044adc200d13c8989d3746a0a4bd7f)
No reason that they should live directly under iicbus
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41913
(cherry picked from commit 7c569caa0a6fffa7e1cc0a7f61e986dbc7c59074)
No reason that they should live directly under iicbus
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41911
(cherry picked from commit 06589d6e029c6ff64a7816d743e0a508abe6193b)
Those are (mainly) pwm controller so move it under a new subdirectory.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41910
(cherry picked from commit 22d7dd834bc5cd189810e414701e3ad1e98102e4)
No reason that they should live directly under iicbus
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41908
(cherry picked from commit 2f16049c985a364e2bd2b256f5bef9af17e10c62)
The folder is a mess so start moving stuff into sub-directories.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D41907
(cherry picked from commit 580d00f42fdd94ce43583cc45fe3f1d9fdff47d4)
- pclk and hclk are mandatory so always try to get them.
Don't make it fatal if it fails as some platform (like Zynq) don't
have a proper clock driver.
- Always use pclk for the reference clock.
- Try to get all the possible clocks and enable them.
Reviewed-by: mhorne
Tested-by: Milan Obuch <bsd@dino.sk>
Differential Revision: https://reviews.freebsd.org/D41857
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 4c52dde5bda099936d43820da84e569dccc6f475)
- Remove cdns,gem, it's the generic binding but for all platform that include
this one we need specific drivers setup so remove it.
- Remove cdns,macb, it's the generic binding for Atmel AT91 which we don't suport
- Remove cadence,gem, it's not an official binding and seems to be only used in some
obscure ARM11 SoC.
- Note that the cdns,zynq* are deprecated
- Add the new Xilinx compatible for zynq and zynqmp
Reviewed-by: mhorne
Tested-by: skibo, Milan Obuch <bsd@dino.sk>
Differential Revision: https://reviews.freebsd.org/D41856
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit bdbbbbb32104569fccd786d9cc07d17f6231a713)
The binding says that we can have one or two clocks to export.
The first one is the actual sdclock while the second is the sample clock.
Both have the same parent, clk_xin.
Correctly export the clocks for RK3399 and ZynqMP.
No need to use a high ID as before, we have our own clock domain so use
ids starting at 1 as all exported clocks should be.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41810
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 81a4fe38a6ce818bb7cba548bb2c697429fa9479)
Per the bindings the phy and the syscon can always be present not just
for RK3399.
Reviewed-by: bz
Differiential Revision: https://reviews.freebsd.org/D41809
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 0ee5d6fcfc63be48fd7c1b461917dfb880dc7f72)
Those two (in fact all of the supported one in this driver except RK3568) always
needs the clocks to be enabled.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41808
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 9377d7049c846d1e35c8fc8809c23e6413909fca)
This was used when we had our own DTS, it's not used anymore.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41807
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 8c7e747491ad636d6ee4069a74ddb24814870540)
Add clock and reset drivers for the ZynqMP SoC.
The clocks are discovered by talking to the firmware as the topology isn't
fixed on this SoC.
Differential Revision: https://reviews.freebsd.org/D41812
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 4e579ad047720775ab580b74192c7de8a3386fea)
The ZynqMP SoC have a MCU running a firmware to control clocks, resets,
fpga loading etc ...
Add a driver that can be use to communicate with it.
For now only the clock and reset part are implemented.
Differential Revision: https://reviews.freebsd.org/D41811
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 9e88711f28dc9afa7d68ae8dd027d2399a2a290b)
When building the frequencies table we convert the value in the DTS to
megahertz and loose precision. While it's not a problem for most of the
DTS it is when the expected frequency value is strict down to the hertz.
So it's either we don't truncate the value and have some ugly and long
values in the sysctls or we just find the closest frequency.
Do the latter.
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D41762
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 17c17872ca98df0e2b9f9c7a2c41ef73f7dee21a)
callout_stop() requires the associated lock to be held.
This is a bit hacky, but I believe it's safe since the subsequent
mrsas_cmd_done() call will also acquire the SIM lock to stop a different
callout.
PR: 265484
Reviewed by: imp
Tested by: Jérémie Jourdin <jeremie.jourdin@advens.fr>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39559
(cherry picked from commit 4640df1b0a49697840b81f6bcd269a483514c6aa)
Similar to dcfddc8dc091e7688abc8488a0307eba425fa7a2, replace the
simpler, inlined version with the full version.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41690
(cherry picked from commit 897e564361624411c4e557e0817642e1477f0af4)
In particular, the kernel RPC layer used by the NFS client never
invokes pru_rcvd since it always reads data from the socket upcall
via MSG_SOCALLBCK which avoids calling pru_rcvd. As a result, on an
NFS client connection managed by t4_tom, RX credits were never
returned to the TOE connection to open the TCP window resulting in
connection hangs.
To fix, expand the set of conditions in do_rx_data where RX credits
are returned to match those in t4_rcvd_locked by calling the function
directly.
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41688
(cherry picked from commit dcfddc8dc091e7688abc8488a0307eba425fa7a2)
Queue an initial fetch of data during attach and after every read
rather than synchronously fetching data and polling for completion.
If data has not been returned from an previous fetch during read,
just return EAGAIN rather than blocking.
Co-authored-by: John Baldwin <jhb@FreeBSD.org>
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D41656
(cherry picked from commit f1c5a2e3a625053e2b70d5b1777d849a4d9328f2)