linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	bartosz.golaszewski@linaro.org,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Marco Felsch <m.felsch@pengutronix.de>,
	christophe.leroy@csgroup.eu, linux-gpio@vger.kernel.org,
	kernel@pengutronix.de, shawnguo@kernel.org
Subject: Re: GPIO static allocation warning with v6.2-rcX
Date: Sun, 29 Jan 2023 19:33:39 +0100	[thread overview]
Message-ID: <20230129183339.GY24167@pengutronix.de> (raw)
In-Reply-To: <20230126104927.GE23347@pengutronix.de>

On Thu, Jan 26, 2023 at 11:49:27AM +0100, Sascha Hauer wrote:
> What's missing is a way to let a GPIO stay in the current state when I
> release a GPIO chip. Unlike the new features you listed above this is a
> feature that the sysfs API offers and that's important for us.

An example where it is used is labgrid: our test automation controller
(LXA-TAC) doesn't run any software for controlling power of the device-
under-test; to switch on a DuT, labgrid does

  ssh tac echo 1 > /sys/some/path/to/gpio

While this could also be done with a daemon offering a dbus api, this
would be significantly more complex. In a critical environment, one
needs to make sure that the daemon process never fails, otherwhise the
power of the DuT would maybe be in a random state. Then of course one
can add a watchdog, but with the current sysfs interface it's really
simple. Of course that would also work if the new interface would offer
a "keep this line as it is" feature, but adding a dbus daemon just for
keeping the state of a pin sounds overcomplex when the kernel could also
provide that functionality.

Another example that came up on friday when we talked about this is a
motor for an airplane: It doesn't have only one "safe state" it could
fall back to if something fails (i.e. daemon disappears). The safe state
on power-on (with uninitialized external hardware) might be different
from the one on the ground (motor-off) or while being in the air
(motor-on). Of course one would probably not build an airplane without
further safety mechanics, but we have several less-desasterous-but-
still-very-expensive-in-the-case-of-failure use cases in the field, like
multi hundret kilowatt motors in agricultural or heavy construction
machine equipment being switched on/off by a GPIO that cause significant
loss of material / work on failure.

I hope those examples help a bit to understand the issues. As Sascha
said: when the new interface provides the same features sysfs offers
today, without adding tons of new complexity, increasing the pressure on
people to move there is perfectly fine. 

rsc
-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |

  reply	other threads:[~2023-01-29 18:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 10:46 GPIO static allocation warning with v6.2-rcX Marco Felsch
2023-01-23 14:55 ` Bartosz Golaszewski
2023-01-23 14:56   ` Bartosz Golaszewski
2023-01-25  9:35   ` Sascha Hauer
2023-01-25 13:56     ` Bartosz Golaszewski
2023-01-26 10:27       ` Sascha Hauer
2023-01-26  1:57     ` Kent Gibson
2023-01-26 10:14       ` Sascha Hauer
2023-01-26 10:26         ` Kent Gibson
2023-01-26  9:35     ` Linus Walleij
2023-01-26 10:49       ` Sascha Hauer
2023-01-29 18:33         ` Robert Schwebel [this message]
2023-01-30 10:19           ` Linus Walleij
2023-01-30 11:02             ` Marco Felsch
2023-01-30 15:01               ` Linus Walleij
2023-01-30 15:45                 ` Rob Herring
2023-01-31  7:21                   ` Alexander Stein
2023-01-30 17:26                 ` Andy Shevchenko
2023-01-30 16:48             ` Uwe Kleine-König
2023-01-30 17:21               ` Bartosz Golaszewski
2023-01-30 23:26               ` Linus Walleij
2023-03-02  2:19           ` Kent Gibson
2023-03-02 15:40             ` Andy Shevchenko
2023-01-26  9:42     ` 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=20230129183339.GY24167@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=christophe.leroy@csgroup.eu \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=sha@pengutronix.de \
    --cc=shawnguo@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).