From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 3/3] gpio: TODO: track the removal of GPIOD_FLAGS_BIT_NONEXCLUSIVE
Date: Mon, 31 Mar 2025 11:00:11 +0200 [thread overview]
Message-ID: <20250331-gpio-todo-remove-nonexclusive-v1-3-25f72675f304@linaro.org> (raw)
In-Reply-To: <20250331-gpio-todo-remove-nonexclusive-v1-0-25f72675f304@linaro.org>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This flag should be replaced by a better mechanism that counts the users
and properly manages the resources. The pwrseq subsystem is a good
candidate. GPIOs themselves should remain a unique resource. Add a task
for tracking the removal of GPIOD_FLAGS_BIT_NONEXCLUSIVE.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/TODO | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index b5f0a7a2e1bf1..5385071901993 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -186,3 +186,17 @@ their hardware offsets within the chip.
Encourage users to switch to using them and eventually remove the existing
global export/unexport attribues.
+
+-------------------------------------------------------------------------------
+
+Remove GPIOD_FLAGS_BIT_NONEXCLUSIVE
+
+This flag is an awful workaround that was created for some regulator
+corner-cases but got out of hand and is now used in at least 33 places
+treewide. Unlike what the intuition may tell users, it's not a reference
+counted mechanisms like what clocks or regulators use but just a raw access
+to the same GPIO descriptor from multiple places with no synchronization (other
+than what the underying driver offers). It doesn't even correctly support
+releasing the supposedly non-exclusive GPIOs. This whole thing should go and be
+replaced with a better solution - for exampe: using the relatively new power
+sequencing subsystem.
--
2.45.2
next prev parent reply other threads:[~2025-03-31 9:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 9:00 [PATCH 0/3] gpio: deprecate and track the removal of the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag Bartosz Golaszewski
2025-03-31 9:00 ` [PATCH 1/3] gpio: deprecate " Bartosz Golaszewski
2025-03-31 9:00 ` [PATCH 2/3] MAINTAINERS: add another keyword for the GPIO subsystem Bartosz Golaszewski
2025-03-31 9:00 ` Bartosz Golaszewski [this message]
2025-03-31 22:48 ` [PATCH 3/3] gpio: TODO: track the removal of GPIOD_FLAGS_BIT_NONEXCLUSIVE Linus Walleij
2025-04-01 8:57 ` Bartosz Golaszewski
2025-04-04 9:02 ` Linus Walleij
2025-04-07 12:38 ` Bartosz Golaszewski
2025-04-15 8:43 ` Linus Walleij
2025-04-17 18:45 ` Bartosz Golaszewski
2025-03-31 22:15 ` [PATCH 0/3] gpio: deprecate and track the removal of the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag Linus Walleij
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=20250331-gpio-todo-remove-nonexclusive-v1-3-25f72675f304@linaro.org \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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 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).