From: Ray Jui Date: Tue, 22 Nov 2016 01:48:30 +0000 (-0800) Subject: PCI: iproc: Fix incorrect MSI address alignment X-Git-Tag: v4.14-rc1~1865^2~7^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=feacdb4a35920235a0daf42d6f5701a74c4708b5;p=platform%2Fkernel%2Flinux-rpi.git PCI: iproc: Fix incorrect MSI address alignment In the code to handle PAXB v2 based MSI steering, the logic aligns the MSI register address to the size of supported inbound mapping range. This is incorrect since it rounds "up" the starting address to the next aligned address, but what we want is the starting address to be rounded "down" to the aligned address. This patch fixes the issue and allows MSI writes to be properly steered to the GIC. Fixes: 4b073155fbd3 ("PCI: iproc: Add support for the next-gen PAXB controller") Signed-off-by: Ray Jui Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 3d02ad2..cd51334 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -1020,7 +1020,7 @@ static int iproc_pcie_paxb_v2_msi_steer(struct iproc_pcie *pcie, u64 msi_addr) memset(&range, 0, sizeof(range)); range.size = SZ_32K; - range.pci_addr = range.cpu_addr = ALIGN(msi_addr, range.size); + range.pci_addr = range.cpu_addr = msi_addr & ~(range.size - 1); ret = iproc_pcie_setup_ib(pcie, &range, IPROC_PCIE_IB_MAP_IO); return ret;