PCI: mvebu: fix off-by-one in the computed size of the mbus windows
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Apr 2014 12:19:50 +0000 (14:19 +0200)
committerJiri Slaby <jslaby@suse.cz>
Mon, 9 Jun 2014 13:53:38 +0000 (15:53 +0200)
commitc124f60283ed72f128c6a7571f800a2b95c749a9
tree856be8a5807b0451be4b6d97a490d2f7a6ea847e
parent48e3f566cf852e75ec41ce93c18d6df2b10e3e9d
PCI: mvebu: fix off-by-one in the computed size of the mbus windows

commit b6d07e0273d3296cfbdc88145b8a00ddbefb310a upstream.

mvebu_pcie_handle_membase_change() and
mvebu_pcie_handle_iobase_change() do not correctly compute the window
size. PCI uses an inclusive start/end address pair, which requires a
+1 when converting to size.

This only worked because a bug in the mbus driver allowed it to
silently accept and round up bogus sizes.

Fix this by adding one to the computed size.

Fixes: 45361a4fe446 ('PCIe driver for Marvell Armada 370/XP systems')
Signed-off-by: Willy Tarreau <w@1wt.eu>
Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397823593-1932-5-git-send-email-thomas.petazzoni@free-electrons.com
Tested-by: Neil Greatorex <neil@fatboyfat.co.uk>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/pci/host/pci-mvebu.c