devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base property
       [not found] ` <20210726125436.58685-2-andriy.shevchenko@linux.intel.com>
@ 2021-08-11 12:37   ` Linus Walleij
  2021-08-11 13:11     ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2021-08-11 12:37 UTC (permalink / raw)
  To: Andy Shevchenko,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
  Cc: Serge Semin, Lee Jones, linux-kernel, open list:GPIO SUBSYSTEM,
	Hoan Tran, Serge Semin, Bartosz Golaszewski

On Mon, Jul 26, 2021 at 2:54 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> For backward compatibility with some legacy devices introduce
> a new (*) property gpio-base to read GPIO base. This will allow
> further cleanup of the driver.
>
> *) Note, it's not new for GPIO library since mockup driver is
>    using it already.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
(...)
> -               pp->gpio_base   = -1;
> +               if (fwnode_property_read_u32(fwnode, "gpio-base", &pp->gpio_base))
> +                       pp->gpio_base = -1;

This is problematic because we have repeatedly NACKed this property
to be added to device trees.

I don't know about fwnode policies, but in the device tree this would have
to be "linux,gpio-base" and then it would be NACKed because of adding
an operating-system specific thing to a OS-independent hardware
description.

I don't know what to do with this really, but I understand the need of it
as a kernel-internal thing, however I am afraid that adding this will make
it possible to add linux,gpio-base = <n> to any device tree gpio_chip
as well and that encourages bad behaviour even if we don't allow a
DT binding (YAML) like that.

Is there a way to make a fwnode property only come from software
nodes and not allowed to be used in ACPI or DT? (I guess not...)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base property
  2021-08-11 12:37   ` [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base property Linus Walleij
@ 2021-08-11 13:11     ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-08-11 13:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Serge Semin, Lee Jones, linux-kernel, open list:GPIO SUBSYSTEM,
	Hoan Tran, Serge Semin, Bartosz Golaszewski

On Wed, Aug 11, 2021 at 02:37:42PM +0200, Linus Walleij wrote:
> On Mon, Jul 26, 2021 at 2:54 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > For backward compatibility with some legacy devices introduce
> > a new (*) property gpio-base to read GPIO base. This will allow
> > further cleanup of the driver.
> >
> > *) Note, it's not new for GPIO library since mockup driver is
> >    using it already.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> (...)
> > -               pp->gpio_base   = -1;
> > +               if (fwnode_property_read_u32(fwnode, "gpio-base", &pp->gpio_base))
> > +                       pp->gpio_base = -1;
> 
> This is problematic because we have repeatedly NACKed this property
> to be added to device trees.
> 
> I don't know about fwnode policies, but in the device tree this would have
> to be "linux,gpio-base" and then it would be NACKed because of adding
> an operating-system specific thing to a OS-independent hardware
> description.
> 
> I don't know what to do with this really, but I understand the need of it
> as a kernel-internal thing, however I am afraid that adding this will make
> it possible to add linux,gpio-base = <n> to any device tree gpio_chip
> as well and that encourages bad behaviour even if we don't allow a
> DT binding (YAML) like that.
> 
> Is there a way to make a fwnode property only come from software
> nodes and not allowed to be used in ACPI or DT? (I guess not...)

This has been the very same concern by Serge and we agreed on limiting this to
software nodes only. And I have seen you are fine with the approach, thanks!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-11 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210726125436.58685-1-andriy.shevchenko@linux.intel.com>
     [not found] ` <20210726125436.58685-2-andriy.shevchenko@linux.intel.com>
2021-08-11 12:37   ` [PATCH v1 2/4] gpio: dwapb: Read GPIO base from gpio-base property Linus Walleij
2021-08-11 13:11     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).