[1/2] ppc/pnv: Loop on the whole hierarchy to populate the DT with the XSCOM nodes
diff mbox series

Message ID 20191210135845.19773-2-clg@kaod.org
State New
Headers show
Series
  • ppc/pnv: minor XSCOM fixes
Related show

Commit Message

Cédric Le Goater Dec. 10, 2019, 1:58 p.m. UTC
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(-)

Comments

Greg Kurz Dec. 10, 2019, 4:49 p.m. UTC | #1
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;
>  }
>
Cédric Le Goater Dec. 10, 2019, 5:08 p.m. UTC | #2
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;
>>  }
>>  
>
Cédric Le Goater Dec. 10, 2019, 6:04 p.m. UTC | #3
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.
Greg Kurz Dec. 10, 2019, 9:24 p.m. UTC | #4
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;
>  }
>
David Gibson Dec. 10, 2019, 11:46 p.m. UTC | #5
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;
> >  }
> >  
>

Patch
diff mbox series

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;
 }