* [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 13:58 [PATCH 0/2] ppc/pnv: minor XSCOM fixes Cédric Le Goater
@ 2019-12-10 13:58 ` Cédric Le Goater
2019-12-10 16:49 ` Greg Kurz
2019-12-10 21:24 ` Greg Kurz
2019-12-10 13:58 ` [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices Cédric Le Goater
2019-12-10 23:46 ` [PATCH 0/2] ppc/pnv: minor XSCOM fixes David Gibson
2 siblings, 2 replies; 12+ messages in thread
From: Cédric Le Goater @ 2019-12-10 13:58 UTC (permalink / raw)
To: David Gibson; +Cc: Cédric Le Goater, qemu-ppc, Greg Kurz, qemu-devel
Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
the first layer, so we need to loop on the whole object hierarchy to
catch them.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv_xscom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
index bed41840845e..006d87e970d9 100644
--- a/hw/ppc/pnv_xscom.c
+++ b/hw/ppc/pnv_xscom.c
@@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
args.fdt = fdt;
args.xscom_offset = xscom_offset;
- object_child_foreach(OBJECT(chip), xscom_dt_child, &args);
+ /*
+ * Loop on the whole object hierarchy to catch all
+ * PnvXScomInterface objects which can lie a bit deeper the first
+ * layer.
+ */
+ object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args);
return 0;
}
--
2.21.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 13:58 ` [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes Cédric Le Goater
@ 2019-12-10 16:49 ` Greg Kurz
2019-12-10 17:08 ` Cédric Le Goater
2019-12-10 23:46 ` David Gibson
2019-12-10 21:24 ` Greg Kurz
1 sibling, 2 replies; 12+ messages in thread
From: Greg Kurz @ 2019-12-10 16:49 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Tue, 10 Dec 2019 14:58:44 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
I didn't find any trace of PnvPBCQState in the code... what is it ?
> the first layer, so we need to loop on the whole object hierarchy to
> catch them.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> hw/ppc/pnv_xscom.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> index bed41840845e..006d87e970d9 100644
> --- a/hw/ppc/pnv_xscom.c
> +++ b/hw/ppc/pnv_xscom.c
> @@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
> args.fdt = fdt;
> args.xscom_offset = xscom_offset;
>
> - object_child_foreach(OBJECT(chip), xscom_dt_child, &args);
> + /*
> + * Loop on the whole object hierarchy to catch all
> + * PnvXScomInterface objects which can lie a bit deeper the first
s/deeper the first/deeper than the first/
> + * layer.
> + */
> + object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args);
> return 0;
> }
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 16:49 ` Greg Kurz
@ 2019-12-10 17:08 ` Cédric Le Goater
2019-12-10 18:04 ` Cédric Le Goater
2019-12-10 23:46 ` David Gibson
1 sibling, 1 reply; 12+ messages in thread
From: Cédric Le Goater @ 2019-12-10 17:08 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, qemu-devel, David Gibson
On 10/12/2019 17:49, Greg Kurz wrote:
> On Tue, 10 Dec 2019 14:58:44 +0100
> Cédric Le Goater <clg@kaod.org> wrote:
>
>> Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
>
> I didn't find any trace of PnvPBCQState in the code... what is it ?
PHB4, which is not merged yet.
C.
>
>> the first layer, so we need to loop on the whole object hierarchy to
>> catch them.
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>> hw/ppc/pnv_xscom.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
>> index bed41840845e..006d87e970d9 100644
>> --- a/hw/ppc/pnv_xscom.c
>> +++ b/hw/ppc/pnv_xscom.c
>> @@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
>> args.fdt = fdt;
>> args.xscom_offset = xscom_offset;
>>
>> - object_child_foreach(OBJECT(chip), xscom_dt_child, &args);
>> + /*
>> + * Loop on the whole object hierarchy to catch all
>> + * PnvXScomInterface objects which can lie a bit deeper the first
>
> s/deeper the first/deeper than the first/
>
>> + * layer.
>> + */
>> + object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args);
>> return 0;
>> }
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 17:08 ` Cédric Le Goater
@ 2019-12-10 18:04 ` Cédric Le Goater
0 siblings, 0 replies; 12+ messages in thread
From: Cédric Le Goater @ 2019-12-10 18:04 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, qemu-devel, David Gibson
On 10/12/2019 18:08, Cédric Le Goater wrote:
> On 10/12/2019 17:49, Greg Kurz wrote:
>> On Tue, 10 Dec 2019 14:58:44 +0100
>> Cédric Le Goater <clg@kaod.org> wrote:
>>
>>> Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
>>
>> I didn't find any trace of PnvPBCQState in the code... what is it ?
>
> PHB4, which is not merged yet.
In fact, PnvPBCQState is for PHB3. But we have a similar need for PHB4.
C.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 16:49 ` Greg Kurz
2019-12-10 17:08 ` Cédric Le Goater
@ 2019-12-10 23:46 ` David Gibson
1 sibling, 0 replies; 12+ messages in thread
From: David Gibson @ 2019-12-10 23:46 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, Cédric Le Goater, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]
On Tue, Dec 10, 2019 at 05:49:01PM +0100, Greg Kurz wrote:
> On Tue, 10 Dec 2019 14:58:44 +0100
> Cédric Le Goater <clg@kaod.org> wrote:
>
> > Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
>
> I didn't find any trace of PnvPBCQState in the code... what is it ?
>
> > the first layer, so we need to loop on the whole object hierarchy to
> > catch them.
> >
> > Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > ---
> > hw/ppc/pnv_xscom.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> > index bed41840845e..006d87e970d9 100644
> > --- a/hw/ppc/pnv_xscom.c
> > +++ b/hw/ppc/pnv_xscom.c
> > @@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
> > args.fdt = fdt;
> > args.xscom_offset = xscom_offset;
> >
> > - object_child_foreach(OBJECT(chip), xscom_dt_child, &args);
> > + /*
> > + * Loop on the whole object hierarchy to catch all
> > + * PnvXScomInterface objects which can lie a bit deeper the first
>
> s/deeper the first/deeper than the first/
Fixed during commit.
>
> > + * layer.
> > + */
> > + object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args);
> > return 0;
> > }
> >
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
2019-12-10 13:58 ` [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes Cédric Le Goater
2019-12-10 16:49 ` Greg Kurz
@ 2019-12-10 21:24 ` Greg Kurz
1 sibling, 0 replies; 12+ messages in thread
From: Greg Kurz @ 2019-12-10 21:24 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Tue, 10 Dec 2019 14:58:44 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> Some PnvXScomInterface objects lie a bit deeper (PnvPBCQState) than
> the first layer, so we need to loop on the whole object hierarchy to
> catch them.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/pnv_xscom.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> index bed41840845e..006d87e970d9 100644
> --- a/hw/ppc/pnv_xscom.c
> +++ b/hw/ppc/pnv_xscom.c
> @@ -326,7 +326,12 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset)
> args.fdt = fdt;
> args.xscom_offset = xscom_offset;
>
> - object_child_foreach(OBJECT(chip), xscom_dt_child, &args);
> + /*
> + * Loop on the whole object hierarchy to catch all
> + * PnvXScomInterface objects which can lie a bit deeper the first
> + * layer.
> + */
> + object_child_foreach_recursive(OBJECT(chip), xscom_dt_child, &args);
> return 0;
> }
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
2019-12-10 13:58 [PATCH 0/2] ppc/pnv: minor XSCOM fixes Cédric Le Goater
2019-12-10 13:58 ` [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes Cédric Le Goater
@ 2019-12-10 13:58 ` Cédric Le Goater
2019-12-10 16:53 ` Greg Kurz
2019-12-10 21:24 ` Greg Kurz
2019-12-10 23:46 ` [PATCH 0/2] ppc/pnv: minor XSCOM fixes David Gibson
2 siblings, 2 replies; 12+ messages in thread
From: Cédric Le Goater @ 2019-12-10 13:58 UTC (permalink / raw)
To: David Gibson; +Cc: Cédric Le Goater, qemu-ppc, Greg Kurz, qemu-devel
Some devices could be initialized in the instance_init handler but not
realized for configuration reasons. Nodes should not be added in the DT
for such devices.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/pnv_xscom.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
index 006d87e970d9..6d3745a49e50 100644
--- a/hw/ppc/pnv_xscom.c
+++ b/hw/ppc/pnv_xscom.c
@@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)
PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child);
PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd);
- if (xc->dt_xscom) {
+ /*
+ * Only "realized" devices should be configured in the DT
+ */
+ if (xc->dt_xscom && DEVICE(child)->realized) {
_FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset)));
}
}
--
2.21.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
2019-12-10 13:58 ` [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices Cédric Le Goater
@ 2019-12-10 16:53 ` Greg Kurz
2019-12-10 17:08 ` Cédric Le Goater
2019-12-10 21:24 ` Greg Kurz
1 sibling, 1 reply; 12+ messages in thread
From: Greg Kurz @ 2019-12-10 16:53 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Tue, 10 Dec 2019 14:58:45 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> Some devices could be initialized in the instance_init handler but not
> realized for configuration reasons. Nodes should not be added in the DT
> for such devices.
>
Do you have examples of such devices to share ?
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
> hw/ppc/pnv_xscom.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> index 006d87e970d9..6d3745a49e50 100644
> --- a/hw/ppc/pnv_xscom.c
> +++ b/hw/ppc/pnv_xscom.c
> @@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)
> PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child);
> PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd);
>
> - if (xc->dt_xscom) {
> + /*
> + * Only "realized" devices should be configured in the DT
> + */
> + if (xc->dt_xscom && DEVICE(child)->realized) {
> _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset)));
> }
> }
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
2019-12-10 16:53 ` Greg Kurz
@ 2019-12-10 17:08 ` Cédric Le Goater
0 siblings, 0 replies; 12+ messages in thread
From: Cédric Le Goater @ 2019-12-10 17:08 UTC (permalink / raw)
To: Greg Kurz; +Cc: qemu-ppc, qemu-devel, David Gibson
On 10/12/2019 17:53, Greg Kurz wrote:
> On Tue, 10 Dec 2019 14:58:45 +0100
> Cédric Le Goater <clg@kaod.org> wrote:
>
>> Some devices could be initialized in the instance_init handler but not
>> realized for configuration reasons. Nodes should not be added in the DT
>> for such devices.
>>
>
> Do you have examples of such devices to share ?
PHB4 again.
C.
>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>> hw/ppc/pnv_xscom.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
>> index 006d87e970d9..6d3745a49e50 100644
>> --- a/hw/ppc/pnv_xscom.c
>> +++ b/hw/ppc/pnv_xscom.c
>> @@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)
>> PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child);
>> PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd);
>>
>> - if (xc->dt_xscom) {
>> + /*
>> + * Only "realized" devices should be configured in the DT
>> + */
>> + if (xc->dt_xscom && DEVICE(child)->realized) {
>> _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset)));
>> }
>> }
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices
2019-12-10 13:58 ` [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices Cédric Le Goater
2019-12-10 16:53 ` Greg Kurz
@ 2019-12-10 21:24 ` Greg Kurz
1 sibling, 0 replies; 12+ messages in thread
From: Greg Kurz @ 2019-12-10 21:24 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Tue, 10 Dec 2019 14:58:45 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> Some devices could be initialized in the instance_init handler but not
> realized for configuration reasons. Nodes should not be added in the DT
> for such devices.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
Reviewed-by: Greg Kurz <groug@kaod.org>
> hw/ppc/pnv_xscom.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c
> index 006d87e970d9..6d3745a49e50 100644
> --- a/hw/ppc/pnv_xscom.c
> +++ b/hw/ppc/pnv_xscom.c
> @@ -272,7 +272,10 @@ static int xscom_dt_child(Object *child, void *opaque)
> PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child);
> PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd);
>
> - if (xc->dt_xscom) {
> + /*
> + * Only "realized" devices should be configured in the DT
> + */
> + if (xc->dt_xscom && DEVICE(child)->realized) {
> _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset)));
> }
> }
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] ppc/pnv: minor XSCOM fixes
2019-12-10 13:58 [PATCH 0/2] ppc/pnv: minor XSCOM fixes Cédric Le Goater
2019-12-10 13:58 ` [PATCH 1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes Cédric Le Goater
2019-12-10 13:58 ` [PATCH 2/2] ppc/pnv: populate the DT with realized XSCOM devices Cédric Le Goater
@ 2019-12-10 23:46 ` David Gibson
2 siblings, 0 replies; 12+ messages in thread
From: David Gibson @ 2019-12-10 23:46 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, Greg Kurz, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
On Tue, Dec 10, 2019 at 02:58:43PM +0100, Cédric Le Goater wrote:
> Hello,
>
> Here are a couple of fixes/cleanups for the PowerNV XSCOM bus.
Applied to ppc-for-5.0, thanks.
>
> Thanks,
>
> C.
>
> Cédric Le Goater (2):
> ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM
> nodes
> ppc/pnv: populate the DT with realized XSCOM devices
>
> hw/ppc/pnv_xscom.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread