]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: Work around Huawei Intelligent NIC VF FLR erratum
authorChiqijun <chiqijun@huawei.com>
Mon, 24 May 2021 22:44:07 +0000 (17:44 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:48:24 +0000 (08:48 -0400)
commit5489a33c043744f55737ab3eb53949029d1d7f64
tree160335a60f9f4d97a908dc6b4404a1b8fba16440
parent0f359bbf2ed7f40871773cb92ea6f7b22f5c746c
PCI: Work around Huawei Intelligent NIC VF FLR erratum

commit ce00322c2365e1f7b0312f2f493539c833465d97 upstream.

pcie_flr() starts a Function Level Reset (FLR), waits 100ms (the maximum
time allowed for FLR completion by PCIe r5.0, sec 6.6.2), and waits for the
FLR to complete.  It assumes the FLR is complete when a config read returns
valid data.

When we do an FLR on several Huawei Intelligent NIC VFs at the same time,
firmware on the NIC processes them serially.  The VF may respond to config
reads before the firmware has completed its reset processing.  If we bind a
driver to the VF (e.g., by assigning the VF to a virtual machine) in the
interval between the successful config read and completion of the firmware
reset processing, the NIC VF driver may fail to load.

Prevent this driver failure by waiting for the NIC firmware to complete its
reset processing.  Not all NIC firmware supports this feature.

[bhelgaas: commit log]
Link: https://support.huawei.com/enterprise/en/doc/EDOC1100063073/87950645/vm-oss-occasionally-fail-to-load-the-in200-driver-when-the-vf-performs-flr
Link: https://lore.kernel.org/r/20210414132301.1793-1-chiqijun@huawei.com
Signed-off-by: Chiqijun <chiqijun@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/quirks.c