]> git.baikalelectronics.ru Git - kernel.git/commit
PCI/RCEC: Fix RCiEP device to RCEC association
authorQiuxu Zhuo <qiuxu.zhuo@intel.com>
Mon, 22 Feb 2021 01:17:17 +0000 (09:17 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 10 Mar 2021 21:10:46 +0000 (15:10 -0600)
commit0724a85c8b1905813f615ad174973d4f26e92934
tree62e7fa066fa5ef9fdec249178265e10aca4db939
parent1b8bd930b05ba1f659bccfc6ef406e93916f57ed
PCI/RCEC: Fix RCiEP device to RCEC association

rcec_assoc_rciep() used "rciep->devfn" (a single byte encoding both the
device and function number) as the device number to check whether the
corresponding bit was set in the RCEC's Association Bitmap for RCiEPs.

But per PCIe r5.0, sec 7.9.10.2, "Association Bitmap for RCiEPs", the
32-bit bitmap contains one bit per device.  That bit applies to all
functions of the device.

Fix rcec_assoc_rciep() to convert the value of "rciep->devfn" to a device
number to ensure that RCiEP devices are correctly associated with the RCEC.

Reported-and-tested-by: Wen Jin <wen.jin@intel.com>
Fixes: ae7a8cbae377 ("PCI/ERR: Add pcie_link_rcec() to associate RCiEPs")
Link: https://lore.kernel.org/r/20210222011717.43266-1-qiuxu.zhuo@intel.com
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Sean V Kelley <sean.v.kelley@intel.com>
drivers/pci/pcie/rcec.c