Re: [PATCH v1] of: property: Add fw_devlink support for "gpio" and "gpios" binding

From: Saravana Kannan
Date: Tue Jan 19 2021 - 14:03:24 EST


On Tue, Jan 19, 2021 at 2:20 AM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> On Tue, Jan 19, 2021 at 9:50 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
> > > Can we pull this into driver-core-next please? It fixes issues on some
> > > boards with fw_devlink=on.
> >
> > On r8a77951-salvator-xs.dts, it introduces one more failure:
> >
> > OF: /soc/i2c@e66d8000/gpio@20/pcie-sata-switch-hog: could not get
> > #gpio-cells for /cpus/cpu@102

Geert,

One good thing is that it's noticing this being weird and ignoring it
in your particular board. I *think* it interprets the "7" as a phandle
and that's cpu@102 and realizes it's not a gpio-controller. For at
least in your case, it's a safe failure.

> >
> > Seems like it doesn't parse gpios properties in GPIO hogs correctly.
>
> Could it be that the code assumes no self-referencing phandles?
> (Just guessing...)
>

Linus,

Ok I tried to understand what gpio-hogs means. It's not fully clear to
me. But it looks like if a gpio-controller has a gpio-hog, then it
doesn't have/need gpio-cells? Is that right?

So if a gpio-controller has a gpio-hog, can it ever be referred to by
another consumer in DT using blah-gpios = ...? If so, I don't see any
obvious code that's handling the missing gpio-cells in this case.

Long story short, please help me understand gpio-hog in the context of
finding dependencies in DT.

Thanks,
Saravana