History

PCI: aardvark: Correct Configuration RRS checking

Per PCIe r6.0, sec 2.3.2, when a Root Complex handles a Completion with Request Retry Status for a Configuration Read Request that includes both bytes of the Vendor ID field, it must complete the Request to the host by returning 0001h for the Vendor ID and all 1's for any additional bytes. Previously we only returned the 0001h Vendor ID value if we got an RRS completion for reads of exactly 4 bytes. A read of 2 bytes would not qualify, although the spec says it should. Check for reads of 2 or more bytes including the Vendor ID. I don't think this will fix any observable problems because RRS only applies to the first config reads after reset, and those are all currently dword (4-byte) reads.

Bjorn Helgaas committed 2 years ago

Commit dd4e47e1 parent d591f681 file · +4 −4Browse files

Unified · Split

drivers/pci/controller/pci-aardvark.c+4−4
@@ -1153,11 +1153,11 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn, · 1152 unmodified lines
1153 size, val);1153 size, val);
1154 1154
1155 /*1155 /*
1156 * Completion Retry Status is possible to return only when reading all1156 * Completion Retry Status is possible to return only when reading
1157 * 4 bytes from PCI_VENDOR_ID and PCI_DEVICE_ID registers at once and1157 * both bytes from PCI_VENDOR_ID at once and CRSSVE flag on Root
1158 * CRSSVE flag on Root Bridge is enabled.1158 * Port is enabled.
1159 */1159 */
1160 allow_crs = (where == PCI_VENDOR_ID) && (size == 4) &&1160 allow_crs = (where == PCI_VENDOR_ID) && (size >= 2) &&
1161 (le16_to_cpu(pcie->bridge.pcie_conf.rootctl) &1161 (le16_to_cpu(pcie->bridge.pcie_conf.rootctl) &
1162 PCI_EXP_RTCTL_CRSSVE);1162 PCI_EXP_RTCTL_CRSSVE);
1163 1163