linux/drivers/pci/dwc
Niklas Cassel ad4a5becc6 PCI: designware-ep: Fix find_first_zero_bit() usage
find_first_zero_bit()'s parameter 'size' is defined in bits,
not in bytes.

find_first_zero_bit() is called with size in bytes rather than bits,
which thus defines a too low upper limit, causing
dw_pcie_ep_inbound_atu() to assign iatu index #4 to both bar 4
and bar 5, which makes bar 5 overwrite the settings set by bar 4.

Since the sizes of the bitmaps are known, dynamically allocate the
bitmaps, and use the correct size when calling find_first_zero_bit().

Additionally, make sure that ep->num_ob_windows and ep->num_ib_windows,
which are obtained from device tree, are smaller than the maximum number
of iATUs (MAX_IATU_IN/MAX_IATU_OUT).

Fixes: f8aed6ec62 ("PCI: dwc: designware: Add EP mode support")
Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
2017-12-19 11:05:44 +00:00
..
Kconfig PCI: hisi: Add HiSilicon STB SoC PCIe controller driver 2017-10-24 14:48:20 -05:00
Makefile pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pci-dra7xx.c pci-v4.15-changes 2017-11-15 15:01:28 -08:00
pci-exynos.c Merge branch 'pci/host-exynos' into next 2017-09-07 13:23:56 -05:00
pci-imx6.c Merge branch 'pci/host-imx6' into next 2017-09-07 13:23:59 -05:00
pci-keystone-dw.c Merge branch 'pci/trivial' into next 2017-09-07 13:24:20 -05:00
pci-keystone.c Merge branch 'pci/host-keystone' into next 2017-09-07 13:24:01 -05:00
pci-keystone.h PCI: keystone: Use PCI_NUM_INTX 2017-08-16 13:39:31 -05:00
pci-layerscape.c PCI: layerscape: Change default error response behavior 2017-10-20 13:26:27 -05:00
pcie-armada8k.c Merge branch 'pci/host-designware' into next 2017-09-07 13:23:55 -05:00
pcie-artpec6.c Merge branch 'pci/host-layerscape' into next 2017-09-07 13:24:02 -05:00
pcie-designware-ep.c PCI: designware-ep: Fix find_first_zero_bit() usage 2017-12-19 11:05:44 +00:00
pcie-designware-host.c Merge branch 'pci/trivial' into next 2017-09-07 13:24:20 -05:00
pcie-designware-plat.c PCI: dwc: designware: Handle ->host_init() failures 2017-08-03 16:14:32 -05:00
pcie-designware.c Merge branch 'pci/trivial' into next 2017-09-07 13:24:20 -05:00
pcie-designware.h PCI: designware-ep: Fix find_first_zero_bit() usage 2017-12-19 11:05:44 +00:00
pcie-hisi.c PCI: hisi: Constify dw_pcie_host_ops structure 2017-08-19 16:21:32 -05:00
pcie-histb.c PCI: hisi: Add HiSilicon STB SoC PCIe controller driver 2017-10-24 14:48:20 -05:00
pcie-kirin.c Merge branch 'pci/host-kirin' into next 2017-09-07 13:24:01 -05:00
pcie-qcom.c PCI: qcom: Add support for IPQ8074 PCIe controller 2017-08-24 11:11:23 -05:00
pcie-spear13xx.c Merge branch 'pci/host-spear13xx' into next 2017-09-07 13:24:07 -05:00