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]
Date:   Tue, 30 Nov 2021 22:31:09 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Kent Gibson <warthog618@...il.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Shuah Khan <shuah@...nel.org>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v11 2/6] gpiolib: allow to specify the firmware node in
 struct gpio_chip

On Tue, Nov 30, 2021 at 07:32:28PM +0100, Bartosz Golaszewski wrote:
> On Tue, Nov 30, 2021 at 5:20 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> >
> > On Tue, Nov 30, 2021 at 06:14:01PM +0200, Andy Shevchenko wrote:
> > > On Tue, Nov 30, 2021 at 04:41:23PM +0100, Bartosz Golaszewski wrote:
> >
> > ...
> >
> > > Not sure I understand the proposal. Can you provide couple of (simplest)
> > > examples?
> > >
> > > And also it sounds like reinventing a wheel. What problem do you have that you
> > > need to solve this way?
> >
> > Have you seen these:
> >         drivers/gpio/gpio-dwapb.c
> >         drivers/mfd/intel_quark_i2c_gpio.c
> > ?
> >
> > GPIO driver has a main (controller level) node along with children on per bank
> > basis. Currently it works with the provided approach (see second driver).

> Yep, I know dwapd. What happens in probe is that each bank device is
> created using the properties from the associated child fwnode but the
> parent device's fwnode is actually assigned as the gpiochip's fwnode.

The first device is the physical device of the GPIO controller,
the

   ,-> fwnode of the physical device
   |
  GPIO  -> portA -> gpiodev A (child fwnode A)
       `-> portB -> gpiodev B (child fwnode B)
           ...

> This is logically wrong

I don't see how, it represents hardware as is.

> and OF doesn't do it - it assigns the child
> of_node to the child device if gpio_chip->of_node is assigned in the
> driver.

And this is exactly what happens.

> I'm not sure if ACPI does this.

Depending on the device description. In the case of dwapb on Galileo platform
the ACPI just misses that, that's why board files (see second driver).

> Non-OF drivers don't have a way to do this and this patch enables it.

You meant non-FW drivers, right? How come? What am I missing?

I don't see the issue here. When user wants to have GPIO device, first we
instantiate it with its own fwnode (in your case swnode), followed by
additional (child) swnode per bank.

> I want to add it mostly because gpio-sim can then use the software
> node to identify the device in the configfs by that software node but
> IMO this is logically correct too.

I also think so.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ