linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-gpio@vger.kernel.org,  devicetree@vger.kernel.org
Subject: Re: [PATCH v2 0/2] gpio: mmio: Support ngpios property
Date: Fri, 18 Oct 2024 13:49:40 +0200	[thread overview]
Message-ID: <CACRpkdafFs-p6ikk7cfSWc6=C=8J6Gh+oe4TagAJh0EypWg3Og@mail.gmail.com> (raw)
In-Reply-To: <ZxJGxXNl29i8d_fA@black.fi.intel.com>

On Fri, Oct 18, 2024 at 1:30 PM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:


> First one is why? What the *practical* issue you have? Can you elaborate
> on that?

Sure, there are these hardwares that probe directly from the
gpio-mmio driver:
Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
properties:
  compatible:
    enum:
      - brcm,bcm6345-gpio
      - ni,169445-nand-gpio
      - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller


The practical issue is (similar to what was responded to Rob
in patch 2/2) that non-existing GPIOs will get exposed to userspace.

For patch 1/2 (adding the DT binding) it would be that without
ngpios we do not model the hardware properly.

The objection "it makes no harm to register GPIO lines
for all bits in the register" can likewise be raised to the
other 28 (if I count correctly) GPIO drivers that use this
property (git grep ngpios drivers/gpio) and I think the train left the
station long ago to object to the property in general, people
don't want to expose non-existing GPIOs to the GPIO
framework.

> Second one, is there any other way to avoid duplication of the code so
> we have one place of the property parsing?
>
> For the background I have to mention this commit:
> 55b2395e4e92 ("gpio: mmio: handle "ngpios" properly in bgpio_init()")

Oh well spotted! I completely missed the fact that we already
added ngpios parsing elsewhere in the driver.

Bartosz, can you please drop patch 2/2?

Patch 1/2 is needed however: it is just documenting the behaviour
that is already implemented.

Yours,
Linus Walleij

  reply	other threads:[~2024-10-18 11:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17  6:46 [PATCH v2 0/2] gpio: mmio: Support ngpios property Linus Walleij
2024-10-17  6:46 ` [PATCH v2 1/2] dt-bindings: gpio-mmio: Add " Linus Walleij
2024-10-17  6:46 ` [PATCH v2 2/2] gpio: mmio: Parse " Linus Walleij
2024-10-18  7:45 ` [PATCH v2 0/2] gpio: mmio: Support " Bartosz Golaszewski
2024-10-18 11:30 ` Andy Shevchenko
2024-10-18 11:49   ` Linus Walleij [this message]
2024-10-18 11:53     ` Bartosz Golaszewski
2024-10-18 12:04     ` Andy Shevchenko

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='CACRpkdafFs-p6ikk7cfSWc6=C=8J6Gh+oe4TagAJh0EypWg3Og@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=robh@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 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).