]> git.baikalelectronics.ru Git - kernel.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)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 24 May 2021 23:42:26 +0000 (18:42 -0500)
commit472242c02998e872fa653e6ca72ebc4ab88ed42a
treeff0f4425e78390eb6d472cb2bb31084727977145
parent10d98beb7620f386b9f66ff81a47cf0f2b45b191
PCI: Work around Huawei Intelligent NIC VF FLR erratum

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>
drivers/pci/quirks.c