linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] bus: mvebu-mbus: Fix incorrect size for PCI aperture resources
@ 2014-02-12 22:57 Jason Gunthorpe
  2014-02-12 22:57 ` [PATCH 2/2] PCI: mvebu - Call request_resources on the apertures Jason Gunthorpe
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jason Gunthorpe @ 2014-02-12 22:57 UTC (permalink / raw)
  To: linux-arm-kernel

reg[0] is the DT base, reg[1] is the DT length in bytes,
struct resource.end is the inclusive end address, so a -1 is
required.

Tested on kirkwood.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 drivers/bus/mvebu-mbus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 2394e97..7fd54e9 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -876,14 +876,14 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
 	ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
 	if (!ret) {
 		mem->start = reg[0];
-		mem->end = mem->start + reg[1];
+		mem->end = mem->start + reg[1] - 1;
 		mem->flags = IORESOURCE_MEM;
 	}
 
 	ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg));
 	if (!ret) {
 		io->start = reg[0];
-		io->end = io->start + reg[1];
+		io->end = io->start + reg[1] - 1;
 		io->flags = IORESOURCE_IO;
 	}
 }
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-18 20:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 22:57 [PATCH 1/2] bus: mvebu-mbus: Fix incorrect size for PCI aperture resources Jason Gunthorpe
2014-02-12 22:57 ` [PATCH 2/2] PCI: mvebu - Call request_resources on the apertures Jason Gunthorpe
2014-02-12 23:24   ` Arnd Bergmann
2014-02-12 23:22 ` [PATCH 1/2] bus: mvebu-mbus: Fix incorrect size for PCI aperture resources Arnd Bergmann
2014-02-14 18:29 ` Bjorn Helgaas
2014-02-17  1:39   ` Jason Cooper
2014-02-18 20:38     ` Bjorn Helgaas
2014-02-18 17:05   ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).