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] [day] [month] [year] [list]
Message-ID: <CAGETcx9EGJi68==uCxrAddZ5GoyNxTKGPxwsqwpv+pzkJ5Uj7A@mail.gmail.com>
Date:   Fri, 22 Jan 2021 10:37:58 -0800
From:   Saravana Kannan <saravanak@...gle.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Andy Shevchenko <andy.shevchenko@...il.com>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Marc Zyngier <maz@...nel.org>,
        Jisheng Zhang <Jisheng.Zhang@...aptics.com>,
        Kever Yang <kever.yang@...k-chips.com>,
        Android Kernel Team <kernel-team@...roid.com>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4] gpiolib: Bind gpio_device to a driver to enable
 fw_devlink=on by default

On Fri, Jan 22, 2021 at 5:08 AM Linus Walleij <linus.walleij@...aro.org> wrote:
>
> On Fri, Jan 22, 2021 at 10:55 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:

Andy, I'll address your exit() comments too.

> > On Fri, Jan 22, 2021 at 12:40 AM Saravana Kannan <saravanak@...gle.com> wrote:
>
> > > @@ -596,6 +596,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
> > >                 gdev->dev.of_node = gc->of_node;
> > >         else
> > >                 gc->of_node = gdev->dev.of_node;
> > > +       gdev->dev.fwnode = of_fwnode_handle(gdev->dev.of_node);
> >
> > This looks like a complete breakage on ACPI enabled systems.
>
> This looks broken to me too, if OF functions are compiled out
> this happens:
>
> include/linux/of.h:#define of_fwnode_handle(node) NULL
>
> And if there is a valid fwnode in the device it gets overwritten
> with NULL.
>
> This is partly why I want the DT code to be in its own file.

Yeah, both of you are right that this is broken.

So all I really need to do to fix this is:
if (gdev->dev.of_node)
    gdev->dev.fwnode = of_fwnode_handle(gdev->dev.of_node);

I don't mind putting this in gpiolib-of.c. It's just kinda weird to me
to call into gpiolib-of.c just for these 2 lines.

I'll just move the entire block inside #ifdef into gpiolib-of.c in the
next version. Let me know how it looks.

-Saravana

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ