linux/drivers/pci/controller
Jianjun Wang a765609f22 PCI: mediatek-gen3: Fix translation window size calculation
[ Upstream commit 9ccc1318cf ]

When using the fls() helper, the translation table should be a power of
two; otherwise, the resulting value will not be correct.

For example, given fls(0x3e00000) - 1 = 25, the PCIe translation window
size will be set to 0x2000000 instead of the expected size 0x3e00000.

Fix the translation window by splitting the MMIO space into multiple tables
if its size is not a power of two.

[kwilczynski: commit log]
Link: https://lore.kernel.org/linux-pci/20231023081423.18559-1-jianjun.wang@mediatek.com
Fixes: d3bf75b579 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192")
Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:55 -08:00
..
cadence PCI: Fix typos in docs and comments 2023-08-25 08:15:38 -05:00
dwc PCI: keystone: Fix race condition when initializing PHYs 2024-01-25 15:35:55 -08:00
mobiveil PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
Kconfig pci-v6.6-changes 2023-08-30 20:23:07 -07:00
Makefile
pci-aardvark.c PCI: aardvark: Convert to platform remove callback returning void 2023-06-24 14:10:09 +00:00
pci-ftpci100.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pci-host-common.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pci-host-generic.c
pci-hyperv-intf.c
pci-hyperv.c PCI: hv: Fix a crash in hv_pci_restore_msi_msg() during hibernation 2023-08-22 15:03:11 +02:00
pci-ixp4xx.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pci-loongson.c PCI: loongson: Limit MRRS to 256 2023-12-20 17:01:53 +01:00
pci-mvebu.c PCI: mvebu: Use FIELD_PREP() with Link Width 2023-11-28 17:19:43 +00:00
pci-rcar-gen2.c PCI: rcar-gen2: Use devm_platform_get_and_ioremap_resource() 2023-07-13 18:12:35 +00:00
pci-tegra.c PCI: tegra: Convert to platform remove callback returning void 2023-06-24 14:14:02 +00:00
pci-thunder-ecam.c
pci-thunder-pem.c
pci-v3-semi.c Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
pci-versatile.c PCI: Remove MODULE_LICENSE so boolean drivers don't look like modules 2023-02-17 08:47:58 -06:00
pci-xgene-msi.c PCI: xgene-msi: Use devm_platform_get_and_ioremap_resource() 2023-07-13 18:12:36 +00:00
pci-xgene.c PCI: Remove unnecessary <linux/of_irq.h> includes 2022-11-10 14:53:51 -06:00
pcie-altera-msi.c PCI: altera-msi: Convert to platform remove callback returning void 2023-06-24 14:10:47 +00:00
pcie-altera.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pcie-apple.c Merge branch 'pci/misc' 2023-08-29 11:03:57 -05:00
pcie-brcmstb.c PCI: brcmstb: Remove stale comment 2023-08-24 17:33:59 +02:00
pcie-hisi-error.c PCI: hisi-error: Convert to platform remove callback returning void 2023-06-24 14:12:13 +00:00
pcie-iproc-bcma.c PCI: Add defines for normal and subtractive PCI bridges 2022-02-17 15:29:35 -06:00
pcie-iproc-msi.c PCI: iproc: Use of_property_read_bool() for boolean properties 2023-07-13 18:09:24 +00:00
pcie-iproc-platform.c PCI: iproc: Convert to platform remove callback returning void 2023-06-24 14:12:36 +00:00
pcie-iproc.c PCI: iproc: Convert to platform remove callback returning void 2023-06-24 14:12:36 +00:00
pcie-iproc.h PCI: iproc: Convert to platform remove callback returning void 2023-06-24 14:12:36 +00:00
pcie-mediatek-gen3.c PCI: mediatek-gen3: Fix translation window size calculation 2024-01-25 15:35:55 -08:00
pcie-mediatek.c PCI: mediatek: Clear interrupt status before dispatching handler 2024-01-25 15:35:48 -08:00
pcie-microchip-host.c Merge branch 'pci/controller/remove-void-cast' 2023-08-29 11:03:56 -05:00
pcie-mt7621.c PCI: mt7621: Convert to platform remove callback returning void 2023-06-24 14:13:16 +00:00
pcie-rcar-ep.c
pcie-rcar-host.c PCI: rcar: Use correct product family name for Renesas R-Car 2023-06-24 13:15:51 +00:00
pcie-rcar.c
pcie-rcar.h PCI: rcar: Avoid defines prefixed with CONFIG 2023-03-10 13:34:27 +01:00
pcie-rockchip-ep.c PCI: rockchip: Set address alignment for endpoint mode 2023-06-22 09:36:51 +02:00
pcie-rockchip-host.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pcie-rockchip.c PCI: Explicitly include correct DT includes 2023-07-18 14:33:17 -05:00
pcie-rockchip.h PCI: rockchip: Use 64-bit mask on MSI 64-bit PCI address 2023-07-13 18:25:44 +00:00
pcie-xilinx-cpm.c PCI: Remove unnecessary <linux/of_irq.h> includes 2022-11-10 14:53:51 -06:00
pcie-xilinx-nwl.c Merge branch 'pci/kbuild' 2022-12-10 10:36:52 -06:00
pcie-xilinx.c
vmd.c PCI: vmd: Fix potential deadlock when enabling ASPM 2023-12-20 17:01:54 +01:00