From: Andrew Jeffery <andrew@aj.id.au>
To: linux-aspeed@lists.ozlabs.org
Subject: [RFC PATCH 3/5] gpio: gpiolib: Add chardev support for maintaining GPIO values on reset
Date: Fri, 20 Oct 2017 19:32:53 +1030 [thread overview]
Message-ID: <1508490173.24322.53.camel@aj.id.au> (raw)
In-Reply-To: <CACRpkdY4F-ocFxomLEsVyGA0odGooWysQq5MHi9qwUt6E_VDzA@mail.gmail.com>
On Fri, 2017-10-20 at 09:27 +0200, Linus Walleij wrote:
> I paged Bartosz and Michael on this, they are experts on the use cases for
> the character device and their opinions are likely more valuable than mine.
>
> > On Fri, Oct 20, 2017 at 5:37 AM, Andrew Jeffery <andrew@aj.id.au> wrote:
> > Similar to devicetree support, add flags and mappings to expose reset
> > tolerance configuration through the chardev interface.
> >
> > Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
>
> (...)
>
> > + * Unconditionally configure reset tolerance, as it's possible
> > + * that the tolerance flag itself becomes tolerant to resets.
> > + * Thus it could remain set from a previous environment, but
> > + * the current environment may not expect it so.
> > + */
> > + ret = gpiod_set_reset_tolerant(desc,
> > + !!(lflags & GPIOHANDLE_REQUEST_RESET_TOLERANT));
> > + if (ret < 0)
> > + goto out_free_descs;
>
> First, as noted in the first patch, IMO we should just go for persistance,
> i.e. you want to flag to the system to keep the line persistent in any case,
> no matter if the system goes to sleep or resets.
>
> So the usecase is going to be a control system or similar, a makerspace
> project, an industrial product of some kind, driving GPIO from userspace.
>
> I don't see it as helpful to give userspace control over whether the line
> is persistent or not. It is more reasonable to assume persistance for
> userspace use cases, don't you think? Whether the system goes to sleep
> or the gpiochip resets should not make a door suddenly close or the
> lights in the christmas tree go out, right? I think if the gpiochip supports
> persistance of any kind, we should try to use it and not have userspace
> provide flags for that.
Right. I guess the counter argument to your examples is if the gpio is
controlling any active process that we don't want to continue if we've
lost the capacity to monitor some other inputs (some kind of dead-man's
switch). But maybe the argument is that should be implemented in the
kernel anyway?
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20171020/1336ba91/attachment.sig>
next prev parent reply other threads:[~2017-10-20 9:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 3:37 [RFC PATCH 0/5] gpio: Expose reset tolerance capability Andrew Jeffery
2017-10-20 3:37 ` [RFC PATCH 1/5] gpio: gpiolib: Add core support for maintaining GPIO values on reset Andrew Jeffery
2017-10-20 7:17 ` Linus Walleij
2017-10-20 7:43 ` Linus Walleij
2017-10-20 8:32 ` Andrew Jeffery
2017-10-25 8:11 ` Charles Keepax
2017-10-26 0:00 ` Andrew Jeffery
2017-10-20 8:24 ` Andrew Jeffery
2017-10-20 3:37 ` [RFC PATCH 2/5] gpio: gpiolib: Add OF " Andrew Jeffery
2017-10-20 7:18 ` Linus Walleij
2017-10-20 7:29 ` Andrew Jeffery
2017-10-20 3:37 ` [RFC PATCH 3/5] gpio: gpiolib: Add chardev " Andrew Jeffery
2017-10-20 7:27 ` Linus Walleij
2017-10-20 9:02 ` Andrew Jeffery [this message]
2017-10-25 8:14 ` Charles Keepax
2017-10-26 0:05 ` Andrew Jeffery
2017-10-26 9:10 ` Charles Keepax
2017-10-31 9:59 ` Linus Walleij
2017-10-20 3:37 ` [RFC PATCH 4/5] gpio: gpiolib: Add sysfs " Andrew Jeffery
2017-10-20 7:29 ` Linus Walleij
2017-10-20 7:40 ` Andrew Jeffery
2017-10-20 3:37 ` [RFC PATCH 5/5] gpio: aspeed: Add support for reset tolerance Andrew Jeffery
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=1508490173.24322.53.camel@aj.id.au \
--to=andrew@aj.id.au \
--cc=linux-aspeed@lists.ozlabs.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