linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod][PATCH v2 0/2] gpioset: improve help
@ 2023-12-29  9:33 Kent Gibson
  2023-12-29  9:33 ` [libgpiod][PATCH v2 1/2] gpioset: reword note on post-exit behaviour Kent Gibson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kent Gibson @ 2023-12-29  9:33 UTC (permalink / raw)
  To: linux-gpio, brgl; +Cc: Kent Gibson

A couple of improvements to gpioset help.

The first is another swing at improving the description of the
behaviour when gpioset exits.

The second patch better describes the zero-terminated
sequence behaviour in the toggle option help.

Cheers,
Kent.

Changes v1 -> v2:
 - fixed the subject prefix.
 - added patch 2.

Kent Gibson (2):
  gpioset: reword note on post-exit behaviour
  gpioset: improve toggle option help

 tools/gpioset.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

--
2.39.2


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

* [libgpiod][PATCH v2 1/2] gpioset: reword note on post-exit behaviour
  2023-12-29  9:33 [libgpiod][PATCH v2 0/2] gpioset: improve help Kent Gibson
@ 2023-12-29  9:33 ` Kent Gibson
  2023-12-29  9:33 ` [libgpiod][PATCH v2 2/2] gpioset: improve toggle option help Kent Gibson
  2024-01-02 14:08 ` [libgpiod][PATCH v2 0/2] gpioset: improve help Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Kent Gibson @ 2023-12-29  9:33 UTC (permalink / raw)
  To: linux-gpio, brgl; +Cc: Kent Gibson

The note regarding the state of a line after gpioset exits is
confusing and unhelpful to the average reader, if not outright
incorrect.
A common mis-interpretation is that this behaviour is arbitrarily
chosen by spiteful implementors. The note also specifies that the line
reverts to default, but that is not always the case, or is at least
out of the control of gpioset or libgpiod.

Reword the note to constrain the scope to that relevant to the
likely reader, and to emphasize that the behaviour is inherent
in the kernel GPIO interface, not in the gpioset implementation.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpioset.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tools/gpioset.c b/tools/gpioset.c
index 9dc5aeb..f2f9a15 100644
--- a/tools/gpioset.c
+++ b/tools/gpioset.c
@@ -76,11 +76,10 @@ static void print_help(void)
 	print_period_help();
 	printf("\n");
 	printf("*Note*\n");
-	printf("    The state of a GPIO line controlled over the character device reverts to default\n");
-	printf("    when the last process referencing the file descriptor representing the device file exits.\n");
-	printf("    This means that it's wrong to run gpioset, have it exit and expect the line to continue\n");
-	printf("    being driven high or low. It may happen if given pin is floating but it must be interpreted\n");
-	printf("    as undefined behavior.\n");
+	printf("    It should not be assumed that a line will retain its state after gpioset exits.\n");
+	printf("    When a process exits, any GPIO lines it has requested are automatically released.\n");
+	printf("    Once released, the state of a line may be modified by the kernel or another process.\n");
+	printf("    To guarantee the requested value, by default gpioset does not exit.\n");
 }
 
 static int parse_drive_or_die(const char *option)
-- 
2.39.2


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

* [libgpiod][PATCH v2 2/2] gpioset: improve toggle option help
  2023-12-29  9:33 [libgpiod][PATCH v2 0/2] gpioset: improve help Kent Gibson
  2023-12-29  9:33 ` [libgpiod][PATCH v2 1/2] gpioset: reword note on post-exit behaviour Kent Gibson
@ 2023-12-29  9:33 ` Kent Gibson
  2024-01-02 14:08 ` [libgpiod][PATCH v2 0/2] gpioset: improve help Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Kent Gibson @ 2023-12-29  9:33 UTC (permalink / raw)
  To: linux-gpio, brgl; +Cc: Kent Gibson

Reword toggle option help to add that a 0 terminated sequence will
exit.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpioset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/gpioset.c b/tools/gpioset.c
index f2f9a15..863da4a 100644
--- a/tools/gpioset.c
+++ b/tools/gpioset.c
@@ -68,7 +68,7 @@ static void print_help(void)
 	printf("  -s, --strict\t\tabort if requested line names are not unique\n");
 	printf("  -t, --toggle <period>[,period]...\n");
 	printf("\t\t\ttoggle the line(s) after the specified period(s)\n");
-	printf("\t\t\tIf the last period is non-zero then the sequence repeats.\n");
+	printf("\t\t\tIf the last period is 0 then gpioset exits else the sequence repeats.\n");
 	printf("      --unquoted\tdon't quote line names\n");
 	printf("  -v, --version\t\toutput version information and exit\n");
 	printf("  -z, --daemonize\tset values then detach from the controlling terminal\n");
-- 
2.39.2


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

* Re: [libgpiod][PATCH v2 0/2] gpioset: improve help
  2023-12-29  9:33 [libgpiod][PATCH v2 0/2] gpioset: improve help Kent Gibson
  2023-12-29  9:33 ` [libgpiod][PATCH v2 1/2] gpioset: reword note on post-exit behaviour Kent Gibson
  2023-12-29  9:33 ` [libgpiod][PATCH v2 2/2] gpioset: improve toggle option help Kent Gibson
@ 2024-01-02 14:08 ` Bartosz Golaszewski
  2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2024-01-02 14:08 UTC (permalink / raw)
  To: Kent Gibson; +Cc: linux-gpio

On Fri, Dec 29, 2023 at 10:33 AM Kent Gibson <warthog618@gmail.com> wrote:
>
> A couple of improvements to gpioset help.
>
> The first is another swing at improving the description of the
> behaviour when gpioset exits.
>
> The second patch better describes the zero-terminated
> sequence behaviour in the toggle option help.
>
> Cheers,
> Kent.
>
> Changes v1 -> v2:
>  - fixed the subject prefix.
>  - added patch 2.
>
> Kent Gibson (2):
>   gpioset: reword note on post-exit behaviour
>   gpioset: improve toggle option help
>
>  tools/gpioset.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> --
> 2.39.2
>

Ah, this is the v2 for the gpioset patch. I applied these two instead.

Bart

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

end of thread, other threads:[~2024-01-02 14:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-29  9:33 [libgpiod][PATCH v2 0/2] gpioset: improve help Kent Gibson
2023-12-29  9:33 ` [libgpiod][PATCH v2 1/2] gpioset: reword note on post-exit behaviour Kent Gibson
2023-12-29  9:33 ` [libgpiod][PATCH v2 2/2] gpioset: improve toggle option help Kent Gibson
2024-01-02 14:08 ` [libgpiod][PATCH v2 0/2] gpioset: improve help Bartosz Golaszewski

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