* [PATCH] hw/riscv: virt: Avoid double FDT platform node
@ 2022-05-12 18:21 Dylan Reid
2022-05-16 23:22 ` Alistair Francis
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dylan Reid @ 2022-05-12 18:21 UTC (permalink / raw)
To: qemu-riscv; +Cc: qemu-devel, palmer, alistair.francis, bin.meng, Dylan Reid
When starting the virt machine with `-machine virt,aia=aplic-imsic`,
both the imsic and aplic init code will add platform fdt nodes by
calling `platform_bus_add_all_fdt_nodes`. This leads to an error at
startup:
```
qemu_fdt_add_subnode: Failed to create subnode /platform@4000000: FDT_ERR_EXISTS
```
The call from `create_fdt_imsic` is not needed as an imsic is currently
always combined with an aplic that will create the nodes.
Fixes: 3029fab64309 ("hw/riscv: virt: Add support for generating platform FDT entries")
Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
---
hw/riscv/virt.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3326f4db96..d625f776a6 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -561,11 +561,6 @@ static void create_fdt_imsic(RISCVVirtState *s, const MemMapEntry *memmap,
}
qemu_fdt_setprop_cell(mc->fdt, imsic_name, "phandle", *msi_m_phandle);
- platform_bus_add_all_fdt_nodes(mc->fdt, imsic_name,
- memmap[VIRT_PLATFORM_BUS].base,
- memmap[VIRT_PLATFORM_BUS].size,
- VIRT_PLATFORM_BUS_IRQ);
-
g_free(imsic_name);
/* S-level IMSIC node */
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] hw/riscv: virt: Avoid double FDT platform node
2022-05-12 18:21 [PATCH] hw/riscv: virt: Avoid double FDT platform node Dylan Reid
@ 2022-05-16 23:22 ` Alistair Francis
2022-05-17 5:10 ` Alistair Francis
2022-05-19 15:04 ` Anup Patel
2 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2022-05-16 23:22 UTC (permalink / raw)
To: Dylan Reid
Cc: open list:RISC-V, qemu-devel@nongnu.org Developers,
Palmer Dabbelt, Alistair Francis, Bin Meng, Dylan Reid
On Fri, May 13, 2022 at 5:12 AM Dylan Reid <dylan@rivosinc.com> wrote:
>
> When starting the virt machine with `-machine virt,aia=aplic-imsic`,
> both the imsic and aplic init code will add platform fdt nodes by
> calling `platform_bus_add_all_fdt_nodes`. This leads to an error at
> startup:
> ```
> qemu_fdt_add_subnode: Failed to create subnode /platform@4000000: FDT_ERR_EXISTS
> ```
>
> The call from `create_fdt_imsic` is not needed as an imsic is currently
> always combined with an aplic that will create the nodes.
>
> Fixes: 3029fab64309 ("hw/riscv: virt: Add support for generating platform FDT entries")
> Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/riscv/virt.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 3326f4db96..d625f776a6 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -561,11 +561,6 @@ static void create_fdt_imsic(RISCVVirtState *s, const MemMapEntry *memmap,
> }
> qemu_fdt_setprop_cell(mc->fdt, imsic_name, "phandle", *msi_m_phandle);
>
> - platform_bus_add_all_fdt_nodes(mc->fdt, imsic_name,
> - memmap[VIRT_PLATFORM_BUS].base,
> - memmap[VIRT_PLATFORM_BUS].size,
> - VIRT_PLATFORM_BUS_IRQ);
> -
> g_free(imsic_name);
>
> /* S-level IMSIC node */
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hw/riscv: virt: Avoid double FDT platform node
2022-05-12 18:21 [PATCH] hw/riscv: virt: Avoid double FDT platform node Dylan Reid
2022-05-16 23:22 ` Alistair Francis
@ 2022-05-17 5:10 ` Alistair Francis
2022-05-19 15:04 ` Anup Patel
2 siblings, 0 replies; 5+ messages in thread
From: Alistair Francis @ 2022-05-17 5:10 UTC (permalink / raw)
To: Dylan Reid
Cc: open list:RISC-V, qemu-devel@nongnu.org Developers,
Palmer Dabbelt, Alistair Francis, Bin Meng, Dylan Reid
On Fri, May 13, 2022 at 5:12 AM Dylan Reid <dylan@rivosinc.com> wrote:
>
> When starting the virt machine with `-machine virt,aia=aplic-imsic`,
> both the imsic and aplic init code will add platform fdt nodes by
> calling `platform_bus_add_all_fdt_nodes`. This leads to an error at
> startup:
> ```
> qemu_fdt_add_subnode: Failed to create subnode /platform@4000000: FDT_ERR_EXISTS
> ```
>
> The call from `create_fdt_imsic` is not needed as an imsic is currently
> always combined with an aplic that will create the nodes.
>
> Fixes: 3029fab64309 ("hw/riscv: virt: Add support for generating platform FDT entries")
> Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
Thanks!
Applied to riscv-to-apply.next
Alistair
> ---
> hw/riscv/virt.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 3326f4db96..d625f776a6 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -561,11 +561,6 @@ static void create_fdt_imsic(RISCVVirtState *s, const MemMapEntry *memmap,
> }
> qemu_fdt_setprop_cell(mc->fdt, imsic_name, "phandle", *msi_m_phandle);
>
> - platform_bus_add_all_fdt_nodes(mc->fdt, imsic_name,
> - memmap[VIRT_PLATFORM_BUS].base,
> - memmap[VIRT_PLATFORM_BUS].size,
> - VIRT_PLATFORM_BUS_IRQ);
> -
> g_free(imsic_name);
>
> /* S-level IMSIC node */
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hw/riscv: virt: Avoid double FDT platform node
2022-05-12 18:21 [PATCH] hw/riscv: virt: Avoid double FDT platform node Dylan Reid
2022-05-16 23:22 ` Alistair Francis
2022-05-17 5:10 ` Alistair Francis
@ 2022-05-19 15:04 ` Anup Patel
2022-05-19 20:45 ` Dylan Reid
2 siblings, 1 reply; 5+ messages in thread
From: Anup Patel @ 2022-05-19 15:04 UTC (permalink / raw)
To: Dylan Reid
Cc: open list:RISC-V, QEMU Developers, Palmer Dabbelt,
Alistair Francis, Bin Meng, Dylan Reid
On Fri, May 13, 2022 at 1:34 AM Dylan Reid <dylan@rivosinc.com> wrote:
>
> When starting the virt machine with `-machine virt,aia=aplic-imsic`,
> both the imsic and aplic init code will add platform fdt nodes by
> calling `platform_bus_add_all_fdt_nodes`. This leads to an error at
> startup:
> ```
> qemu_fdt_add_subnode: Failed to create subnode /platform@4000000: FDT_ERR_EXISTS
> ```
>
> The call from `create_fdt_imsic` is not needed as an imsic is currently
> always combined with an aplic that will create the nodes.
>
> Fixes: 3029fab64309 ("hw/riscv: virt: Add support for generating platform FDT entries")
> Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
> ---
> hw/riscv/virt.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 3326f4db96..d625f776a6 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -561,11 +561,6 @@ static void create_fdt_imsic(RISCVVirtState *s, const MemMapEntry *memmap,
> }
> qemu_fdt_setprop_cell(mc->fdt, imsic_name, "phandle", *msi_m_phandle);
>
> - platform_bus_add_all_fdt_nodes(mc->fdt, imsic_name,
> - memmap[VIRT_PLATFORM_BUS].base,
> - memmap[VIRT_PLATFORM_BUS].size,
> - VIRT_PLATFORM_BUS_IRQ);
> -
This patch only fixes for the case where there is only one socket.
I had send-out a similar fix which also handles multi-socket case.
https://lore.kernel.org/all/20220511144528.393530-9-apatel@ventanamicro.com/
Regards,
Anup
> g_free(imsic_name);
>
> /* S-level IMSIC node */
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] hw/riscv: virt: Avoid double FDT platform node
2022-05-19 15:04 ` Anup Patel
@ 2022-05-19 20:45 ` Dylan Reid
0 siblings, 0 replies; 5+ messages in thread
From: Dylan Reid @ 2022-05-19 20:45 UTC (permalink / raw)
To: Anup Patel
Cc: open list:RISC-V, QEMU Developers, Palmer Dabbelt,
Alistair Francis, Bin Meng, Dylan Reid
On Thu, May 19, 2022 at 08:34:06PM +0530, Anup Patel wrote:
> On Fri, May 13, 2022 at 1:34 AM Dylan Reid <dylan@rivosinc.com> wrote:
> >
> > When starting the virt machine with `-machine virt,aia=aplic-imsic`,
> > both the imsic and aplic init code will add platform fdt nodes by
> > calling `platform_bus_add_all_fdt_nodes`. This leads to an error at
> > startup:
> > ```
> > qemu_fdt_add_subnode: Failed to create subnode /platform@4000000: FDT_ERR_EXISTS
> > ```
> >
> > The call from `create_fdt_imsic` is not needed as an imsic is currently
> > always combined with an aplic that will create the nodes.
> >
> > Fixes: 3029fab64309 ("hw/riscv: virt: Add support for generating platform FDT entries")
> > Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
> > ---
> > hw/riscv/virt.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> > index 3326f4db96..d625f776a6 100644
> > --- a/hw/riscv/virt.c
> > +++ b/hw/riscv/virt.c
> > @@ -561,11 +561,6 @@ static void create_fdt_imsic(RISCVVirtState *s, const MemMapEntry *memmap,
> > }
> > qemu_fdt_setprop_cell(mc->fdt, imsic_name, "phandle", *msi_m_phandle);
> >
> > - platform_bus_add_all_fdt_nodes(mc->fdt, imsic_name,
> > - memmap[VIRT_PLATFORM_BUS].base,
> > - memmap[VIRT_PLATFORM_BUS].size,
> > - VIRT_PLATFORM_BUS_IRQ);
> > -
>
> This patch only fixes for the case where there is only one socket.
>
> I had send-out a similar fix which also handles multi-socket case.
> https://lore.kernel.org/all/20220511144528.393530-9-apatel@ventanamicro.com/
Thanks Anup, that looks good to me.
>
> Regards,
> Anup
>
>
> > g_free(imsic_name);
> >
> > /* S-level IMSIC node */
> > --
> > 2.30.2
> >
> >
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-19 20:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 18:21 [PATCH] hw/riscv: virt: Avoid double FDT platform node Dylan Reid
2022-05-16 23:22 ` Alistair Francis
2022-05-17 5:10 ` Alistair Francis
2022-05-19 15:04 ` Anup Patel
2022-05-19 20:45 ` Dylan Reid
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.