lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUe6W5ABO-WntCRFXnusacY=2HNiahXN-9ts-Nsf847uQ@mail.gmail.com>
Date:   Tue, 19 Jan 2021 19:32:57 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Saravana Kannan <saravanak@...gle.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        linux-tegra <linux-tegra@...r.kernel.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Jon Hunter <jonathanh@...dia.com>,
        Android Kernel Team <kernel-team@...roid.com>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1] of: property: Add fw_devlink support for "gpio" and
 "gpios" binding

Hi Saravana,

On Tue, Jan 19, 2021 at 7:19 PM Saravana Kannan <saravanak@...gle.com> wrote:
> On Tue, Jan 19, 2021 at 10:10 AM Geert Uytterhoeven
> <geert@...ux-m68k.org> wrote:
> > On Tue, Jan 19, 2021 at 6:54 PM Saravana Kannan <saravanak@...gle.com> wrote:
> > > On Tue, Jan 19, 2021 at 2:20 AM Linus Walleij <linus.walleij@...aro.org> wrote:
> > > > On Tue, Jan 19, 2021 at 9:50 AM Geert Uytterhoeven <geert@...ux-m68k.org> 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@...d8000/gpio@...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.
> >
> > While 7 is the GPIO index, relative to the current GPIO controller,
> > represented by the parent device node.
> >
> > > > > 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...)
> > >
> > > 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?
> >
> > A GPIO hog is a way to fix (strap) a GPIO line to a specific value.
> > Usually this is done to enable a piece of hardware on a board, or
> > control a mux.
> >
> > The controller still needs gpio-cells.
> >
> > > 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.
> >
> > Yes it can.
> >
> > > Long story short, please help me understand gpio-hog in the context of
> > > finding dependencies in DT.
> >
> > The hog references a GPIO on the current controller.  As this is always
> > the parent device node, the hog's gpios properties lack the phandle.
> >
> > E.g. a normal reference to the first GPIO of gpio5 looks like:
> >
> >     gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
> >
> > A hog on the first GPIO of gpio5 would be a subnode of gpio5,
> > and would just use:
> >
> >     gpios = <0 GPIO_ACTIVE_LOW>;
> >
> > instead.
> >
> > Hope this helps.
>
> I'm still not sure if I've understood this fully, but does this just
> boil down to:
> Don't parse [name-]gpio[s] to find dependencies if the node has
> gpio-hog property?

Indeed. You can just ignore all nodes with a gpio-hog property, as they're
always handled by their parent.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ