qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] hw/arm/virt: "bus-range"/end is off by one


From: Laszlo Ersek
Subject: [Qemu-devel] [PATCH] hw/arm/virt: "bus-range"/end is off by one
Date: Thu, 12 Feb 2015 19:50:13 +0100

According to "PCI Bus Binding to IEEE Std 1275-1994", 3.1.2. Bus-specific
Properties for Bus Nodes, the second integer in "bus-range" is an
inclusive limit.

This seems to be consistent with several *.dtsi files in the kernel tree,
where examples like

  bus-range = <0 0>;

are visible.

In addition, the loop in gen_pci_parse_map_cfg_windows()
[drivers/pci/host/pci-host-generic.c] uses "bus_range->end" as an
inclusive limit.

Signed-off-by: Laszlo Ersek <address@hidden>
---

Notes:
    Applies on top of target-arm.next.

 hw/arm/virt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index a2a5c96..ee77093 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -693,7 +693,8 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq 
*pic,
     qemu_fdt_setprop_string(vbi->fdt, nodename, "device_type", "pci");
     qemu_fdt_setprop_cell(vbi->fdt, nodename, "#address-cells", 3);
     qemu_fdt_setprop_cell(vbi->fdt, nodename, "#size-cells", 2);
-    qemu_fdt_setprop_cells(vbi->fdt, nodename, "bus-range", 0, nr_pcie_buses);
+    qemu_fdt_setprop_cells(vbi->fdt, nodename, "bus-range", 0,
+                           nr_pcie_buses - 1);
 
     qemu_fdt_setprop_sized_cells(vbi->fdt, nodename, "reg",
                                  2, base_ecam, 2, size_ecam);
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]