diff options
author | Niklas Cassel <niklas.cassel@axis.com> | 2017-12-14 14:01:44 +0100 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2017-12-19 11:05:44 +0000 |
commit | ad4a5becc689c3f32bbbc2b37eff89efe19dc2f9 (patch) | |
tree | 594e1ca0c98e16a9826c94d15566a3c4471c7b07 /drivers/pci/endpoint | |
parent | 1291a0d5049dbc06baaaf66a9ff3f53db493b19b (diff) | |
download | lwn-ad4a5becc689c3f32bbbc2b37eff89efe19dc2f9.tar.gz lwn-ad4a5becc689c3f32bbbc2b37eff89efe19dc2f9.zip |
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: f8aed6ec624f ("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>
Diffstat (limited to 'drivers/pci/endpoint')
0 files changed, 0 insertions, 0 deletions