History

PCI: Disable PCIe Relaxed Ordering if unsupported

When bit4 is set in the PCIe Device Control register, it indicates whether the device is permitted to use relaxed ordering. On some platforms using relaxed ordering can have performance issues or due to erratum can cause data-corruption. In such cases devices must avoid using relaxed ordering. The patch adds a new flag PCI_DEV_FLAGS_NO_RELAXED_ORDERING to indicate that Relaxed Ordering (RO) attribute should not be used for Transaction Layer Packets (TLP) targeted towards these affected root complexes. This patch checks if there is any node in the hierarchy that indicates that using relaxed ordering is not safe. In such cases the patch turns off the relaxed ordering by clearing the capability for this device.

dingtianhong committed 9 years ago

Commit a99b6461 parent 59a361b3 files · +57 −0Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/pci.h+3−0
@@ -188,6 +188,8 @@ enum pci_dev_flags { · 187 unmodified lines
188188 * the direct_complete optimization.
189189 */
190190 PCI_DEV_FLAGS_NEEDS_RESUME = (__force pci_dev_flags_t) (1 << 11),
191+ /* Don't use Relaxed Ordering for TLPs directed at this device */
192+ PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 12),
191193 };
192194
193195 enum pci_irq_reroute_variant {
@@ -1125,6 +1127,7 @@ bool pci_check_pme_status(struct pci_dev *dev); · 931 unmodified lines
11251127 void pci_pme_wakeup_bus(struct pci_bus *bus);
11261128 void pci_d3cold_enable(struct pci_dev *dev);
11271129 void pci_d3cold_disable(struct pci_dev *dev);
1130+bool pcie_relaxed_ordering_enabled(struct pci_dev *dev);
11281131
11291132 /* PCI Virtual Channel */
11301133 int pci_save_vc_state(struct pci_dev *dev);