From: Srinivas Kandagatla <srini@kernel.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Srinivas Kandagatla <srini@kernel.org>
Cc: Kees Cook <kees@kernel.org>, Mika Westerberg <westeri@kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Manivannan Sadhasivam <mani@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Shevchenko <andy@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH RFC 0/9] gpio: improve support for shared GPIOs
Date: Mon, 6 Oct 2025 22:55:04 +0100 [thread overview]
Message-ID: <80347dcf-419b-489e-9b0e-d901fbacc71a@kernel.org> (raw)
In-Reply-To: <CAMRc=MfwEHGV-HZQURR3JNg1HatAeWO17qbRmkWUXTSBWj5jSg@mail.gmail.com>
On 10/6/25 12:55 PM, Bartosz Golaszewski wrote:
> On Sat, Oct 4, 2025 at 3:32 PM Srinivas Kandagatla <srini@kernel.org> wrote:
>> On 9/24/25 3:51 PM, Bartosz Golaszewski wrote:
>>> Here's a functional RFC for improving the handling of shared GPIOs in
>>> linux.
>>>
>>> Problem statement: GPIOs are implemented as a strictly exclusive
>>> resource in the kernel but there are lots of platforms on which single
>>> pin is shared by multiple devices which don't communicate so need some
>>> way of properly sharing access to a GPIO. What we have now is the
>>> GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which was introduced as a hack and
>>> doesn't do any locking or arbitration of access - it literally just hand
>>> the same GPIO descriptor to all interested users.
>>
>> Isn't the main issue here is about not using a correct framework around
>> to the gpios that driver uses. ex: the codec usecase that you are
>> refering in this is using gpio to reset the line, instead of using a
>> proper gpio-reset control. same with some of the gpio-muxes. the problem
>> is fixed once such direct users of gpio are move their correct frameworks.
>>
>
> If they were called "reset-gpios" then we could (and should) use
> Krzysztof's reset-gpio driver here, but we have many cases where
> that's not the case and the names (and implied functions) are
Yes, these codec drivers are due to be moved to use reset-gpios.
--srini
> arbitrary. In the case addressed in this series, the GPIOs are called
> "powerdown". The second big user of nonexclusive GPIOs are fixed
> regulators where the line isn't called "reset" either. There are also
> various other uses sprinkled all over the kernel for which no good
> abstraction exists or can even be designed in a generic way.
>
>> Am not sure adding a abstraction with-in gpio framework is right
>> solution, But I do agree that NONEXCLUSIVE flags should disappear and
>> users that are using this should be moved to correct frameworks where
>> they belong.
>>
>
> I'm open to suggestions but DT maintainers have not been particularly
> fond of creating "virtual" devices to accommodate driver
> implementations.
>
> Bartosz
next prev parent reply other threads:[~2025-10-06 21:55 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 14:51 [PATCH RFC 0/9] gpio: improve support for shared GPIOs Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 1/9] gpio: wcd934x: mark the GPIO controller as sleeping Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 2/9] string: provide strends() Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 3/9] gpiolib: define GPIOD_FLAG_SHARED Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 4/9] gpiolib: implement low-level, shared GPIO support Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 5/9] gpio: shared-proxy: implement the shared GPIO proxy driver Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 6/9] gpiolib: support shared GPIOs in core subsystem code Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 7/9] arm64: select HAVE_SHARED_GPIOS for ARCH_QCOM Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 8/9] ASoC: wsa881x: drop GPIOD_FLAGS_BIT_NONEXCLUSIVE flag from GPIO lookup Bartosz Golaszewski
2025-09-24 14:51 ` [PATCH RFC 9/9] ASoC: wsa883x: " Bartosz Golaszewski
2025-09-24 18:25 ` [PATCH RFC 0/9] gpio: improve support for shared GPIOs Dmitry Torokhov
2025-09-24 18:58 ` Bartosz Golaszewski
2025-10-06 15:43 ` Manivannan Sadhasivam
2025-10-06 16:10 ` Bartosz Golaszewski
2025-10-06 21:52 ` Srinivas Kandagatla
2025-10-06 22:09 ` Manivannan Sadhasivam
2025-10-07 12:29 ` Bartosz Golaszewski
2025-10-21 1:53 ` Manivannan Sadhasivam
2025-10-21 12:06 ` Bartosz Golaszewski
2025-10-21 12:19 ` Manivannan Sadhasivam
2025-10-21 12:22 ` Bartosz Golaszewski
2025-10-21 12:53 ` Manivannan Sadhasivam
2025-10-21 14:02 ` Bartosz Golaszewski
2025-10-21 15:56 ` Andy Shevchenko
2025-10-01 8:49 ` Linus Walleij
2025-10-01 10:53 ` Linus Walleij
2025-10-01 13:04 ` Bartosz Golaszewski
2025-10-04 13:31 ` Srinivas Kandagatla
2025-10-06 11:55 ` Bartosz Golaszewski
2025-10-06 21:55 ` Srinivas Kandagatla [this message]
2025-10-07 13:13 ` Bartosz Golaszewski
2025-10-07 13:18 ` Mark Brown
2025-10-07 13:21 ` Bartosz Golaszewski
2025-10-06 12:19 ` Mark Brown
2025-10-07 12:32 ` Srinivas Kandagatla
2025-10-09 10:12 ` (subset) " Bartosz Golaszewski
2025-10-17 17:26 ` Bartosz Golaszewski
2025-10-17 17:32 ` Mark Brown
2025-10-20 9:41 ` Bartosz Golaszewski
2025-10-21 14:08 ` Mark Brown
2025-10-21 14:42 ` Bartosz Golaszewski
2025-10-21 15:02 ` Mark Brown
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=80347dcf-419b-489e-9b0e-d901fbacc71a@kernel.org \
--to=srini@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mani@kernel.org \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=tiwai@suse.com \
--cc=westeri@kernel.org \
--cc=will@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).