linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: TODO: add an item about GPIO safe-state
@ 2022-09-14 15:11 Bartosz Golaszewski
  2022-09-14 15:20 ` Geert Uytterhoeven
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Bartosz Golaszewski @ 2022-09-14 15:11 UTC (permalink / raw)
  To: Kent Gibson, Linus Walleij, Andy Shevchenko, Drew Fustini,
	Marek Vasut, Geert Uytterhoeven
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

This adds a new TODO item for gpiolib and can also be used to start
a discussion about the need for it and implementation details.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/gpio/TODO | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index f87ff3fa8a53..6ab39c5cec9d 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -197,3 +197,25 @@ A small number of drivers have been converted (pl061, tegra186, msm,
 amd, apple), and can be used as examples of how to proceed with this
 conversion. Note that drivers using the generic irqchip framework
 cannot be converted yet, but watch this space!
+
+Safe-state of GPIOs
+
+During 2022 Linux Plumbers Conference's GPIO & pinctrl BOF it's been discussed
+that we don't have any middle ground between hogging GPIO lines and letting the
+user (either in-kernel or user-space) control them. Either the lines are forever
+reserved as hogs or their state is undefined unless requested.
+
+Currently the behavior of GPIOs that were not requested or were released is
+largely driver dependent (the provider driver decides whether the line's state
+is reverted to some predefined value or left as-is). This can be problematic
+as the output state of a line can damage physical hardware.
+
+This item is about proposing a solution, most likely in the form of a new device
+property called "safe-state" that would define the safe states of specific lines
+(e.g. output-high) but not block the line from being requested by users who 
+could then modify that default state. Once released the GPIO core would then
+put the line back into the "safe-state".
+
+While this could potentially be seen as defining policy in the device-tree, it's
+not anymore a policy than properties such as "regulator-always-on" or gpio-hogs
+themselves are.
-- 
2.34.1


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

end of thread, other threads:[~2022-09-16 14:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-14 15:11 [PATCH] gpiolib: TODO: add an item about GPIO safe-state Bartosz Golaszewski
2022-09-14 15:20 ` Geert Uytterhoeven
2022-09-14 15:22   ` Bartosz Golaszewski
2022-09-14 16:21 ` Kent Gibson
2022-09-14 16:25   ` Bartosz Golaszewski
2022-09-14 16:42     ` Kent Gibson
2022-09-15  7:44       ` Bartosz Golaszewski
2022-09-15  8:58 ` Linus Walleij
2022-09-16  7:11   ` Bartosz Golaszewski
2022-09-16 13:12     ` Linus Walleij
2022-09-16 13:47       ` Rob Herring
2022-09-16 14:00         ` Linus Walleij

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).