All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH] gpiolib: Disallow identical line names in the same chip
Date: Sat, 12 Dec 2020 10:23:33 +0100	[thread overview]
Message-ID: <CAMuHMdXZft=w4JZz_xAJ2r3AVh1QS-OGrSuVjXd8mR8=Xhr+rA@mail.gmail.com> (raw)
In-Reply-To: <20201212003447.238474-1-linus.walleij@linaro.org>

Hi Linus,

On Sat, Dec 12, 2020 at 1:36 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> We need to make this namespace hierarchical: at least do not
> allow two lines on the same chip to have the same name, this
> is just too much flexibility. If we name a line on a chip,
> name it uniquely on that chip.
>
> I don't know what happens if we just apply this, I *hope* there
> are not a lot of systems out there breaking this simple and
> intuitive rule.
>
> As a side effect, this makes the device tree naming code
> scream a bit if names are not globally unique.
>
> I think there are not super-many device trees out there naming
> their lines so let's fix this before the problem becomes
> widespread.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Johan Hovold <johan@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> This may be just the first step in tightening this up.
> Googling gives at hand that the colission warning doesn't
> happen much so we might go as far as to say the name can
> be required to be globally unique, but that creates a flat
> namespace so I don't know if that is desireable.

As the names are specified in DT, I think the biggest "use case" for
collisions is GPIO chips on expansion boards, if multiple instances
of the same board can be connected.

This is a bit similar to clock outputs, cfr. commit f491276a51685987
("clk: vc5: Allow Versaclock driver to support multiple instances"), but
in the clock case, the name of the clock output is dictated by the
driver, not by DT.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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

  reply	other threads:[~2020-12-12 10:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12  0:34 [PATCH] gpiolib: Disallow identical line names in the same chip Linus Walleij
2020-12-12  9:23 ` Geert Uytterhoeven [this message]
2020-12-12 12:51   ` Linus Walleij
2020-12-14  9:23     ` Johan Hovold
2020-12-13 15:00 ` Andy Shevchenko
2020-12-14  8:45   ` Bartosz Golaszewski
2020-12-14  9:17 ` Linus Walleij
2020-12-14  9:29 ` Johan Hovold
2020-12-14 22:39   ` Linus Walleij
2020-12-15  8:24     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMuHMdXZft=w4JZz_xAJ2r3AVh1QS-OGrSuVjXd8mR8=Xhr+rA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.