From: Richard Zhu Date: Mon, 29 Jul 2024 20:18:09 +0000 (-0400) Subject: PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI X-Git-Tag: v6.10.13~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7826d9f1eb3d176a09de544e0fb2ae138727c9ab;p=thirdparty%2Fkernel%2Fstable.git PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI commit 5cb3aa92c7cf182940ae575c3f450d3708af087c upstream. Correct occasional MSI triggering failures in i.MX8MP PCIe EP by applying the correct hardware outbound alignment requirement. The i.MX platform has a restriction about outbound address translation. The pci-epc-mem uses page_size to manage it. Set the correct page_size for i.MX platform to meet the hardware requirement, which is the same as inbound address alignment. Thus, align it with epc_features::align. Fixes: 1bd0d43dcf3b ("PCI: imx6: Clean up addr_space retrieval code") Link: https://lore.kernel.org/linux-pci/20240729-pci2_upstream-v8-2-b68ee5ef2b4d@nxp.com Signed-off-by: Richard Zhu Signed-off-by: Frank Li [kwilczynski: commit log] Signed-off-by: Krzysztof WilczyƄski Reviewed-by: Manivannan Sadhasivam Acked-by: Jason Liu Cc: # 6.9+ Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 7074184278e94..dbd6d7a274893 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1119,6 +1119,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, if (imx6_check_flag(imx6_pcie, IMX6_PCIE_FLAG_SUPPORT_64BIT)) dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); + ep->page_size = imx6_pcie->drvdata->epc_features->align; + ret = dw_pcie_ep_init(ep); if (ret) { dev_err(dev, "failed to initialize endpoint\n");