Commit 463a1271 authored by Jijie Shao's avatar Jijie Shao Committed by Paolo Abeni
Browse files

net: hibmcge: disable Relaxed Ordering to fix RX packet corruption



When SMMU is disabled, the hibmcge driver may receive corrupted packets.
The hardware writes packet data and descriptors to the same page, but
with Relaxed Ordering enabled, PCI write transactions may not be
strictly ordered. This can cause the driver to observe a valid
descriptor before the corresponding packet data is fully written.

Fix this by clearing PCI_EXP_DEVCTL_RELAX_EN in the PCI bridge control
register to ensure strict write ordering between packet data and
descriptors.

Fixes: f72e2559 ("net: hibmcge: Implement rx_poll function to receive packets")
Signed-off-by: default avatarJijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20260525144525.94884-2-shaojijie@huawei.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 031f1592
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -420,6 +420,9 @@ static int hbg_pci_init(struct pci_dev *pdev)
		return -ENOMEM;

	pci_set_master(pdev);
	pcie_capability_clear_word(pdev, PCI_EXP_DEVCTL,
				   PCI_EXP_DEVCTL_RELAX_EN);
	pci_save_state(pdev);
	return 0;
}