pci: intel: Fix error when enumerating multi-function PCIe device
authorLey Foon Tan <ley.foon.tan@intel.com>
Fri, 24 May 2019 02:29:59 +0000 (10:29 +0800)
committerTom Rini <trini@konsulko.com>
Sun, 11 Aug 2019 20:43:41 +0000 (16:43 -0400)
Hardware return completion status non-zero when read from non exist
function in multi-function PCIe device. Return error will cause PCIe
enumeration fail.

Change it to return 0 and return value 0xffffffff when error.

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
drivers/pci/pcie_intel_fpga.c

index e74b35a..a096d1c 100644 (file)
@@ -161,8 +161,10 @@ static int tlp_read_packet(struct intel_fpga_pcie *pcie, u32 *value)
                        dw[count++] = cra_readl(pcie, RP_RXCPL_REG);
                        if (ctrl & RP_RXCPL_EOP) {
                                comp_status = TLP_COMP_STATUS(dw[1]);
-                               if (comp_status)
-                                       return -EFAULT;
+                               if (comp_status) {
+                                       *value = pci_get_ff(PCI_SIZE_32);
+                                       return 0;
+                               }
 
                                if (value &&
                                    TLP_BYTE_COUNT(dw[1]) == sizeof(u32) &&