From: Kent Gibson <warthog618@gmail.com>
To: Andy Shevchenko <andy@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
brgl@bgdev.pl, linus.walleij@linaro.org
Subject: Re: [PATCH v3 1/5] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc
Date: Sat, 16 Dec 2023 07:33:37 +0800 [thread overview]
Message-ID: <ZXziUYicXaENTDk_@rigel> (raw)
In-Reply-To: <ZXyAQq7tVaOFI2Vs@smile.fi.intel.com>
On Fri, Dec 15, 2023 at 06:35:14PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 15, 2023 at 10:38:01AM +0800, Kent Gibson wrote:
> > Store the debounce period for a requested line locally, rather than in
> > the debounce_period_us field in the gpiolib struct gpio_desc.
> >
> > Add a global tree of lines containing supplemental line information
> > to make the debounce period available to be reported by the
> > GPIO_V2_GET_LINEINFO_IOCTL and the line change notifier.
>
> LGTM, a few minor comments below.
>
> ...
>
> > +/*
>
> (now you can have a kernel doc :-)
>
Maybe you can, but I can't.
> > + * a rbtree of the struct lines containing supplemental info.
> > + * Used to populate gpio_v2_line_info with cdev specific fields not contained
> > + * in the struct gpio_desc.
> > + * A line is determined to contain supplemental information by
> > + * line_is_supplemental().
> > + */
> > +static struct rb_root supinfo_tree = RB_ROOT;
> > +/* covers supinfo_tree */
> > +DEFINE_SPINLOCK(supinfo_lock);
>
> Shouldn't this also be static?
>
Indeed.
> ...
>
> > + guard(spinlock)(&supinfo_lock);
>
> + cleanup.h ?
>
Bah, I could've sworn I added that in, but it isn't evident in any of
the patches all the way back to v1, so apparently not.
> ...
>
> > +static void supinfo_to_lineinfo(struct gpio_desc *desc,
> > + struct gpio_v2_line_info *info)
> > +{
> > + struct gpio_v2_line_attribute *attr;
> > + struct line *line;
> > +
> > + guard(spinlock)(&supinfo_lock);
> > +
> > + line = supinfo_find(desc);
> > + if (line) {
>
> if (!line)
> return;
>
> ?
Will do.
>
> > + attr = &info->attrs[info->num_attrs];
> > + attr->id = GPIO_V2_LINE_ATTR_ID_DEBOUNCE;
> > + attr->debounce_period_us = READ_ONCE(line->debounce_period_us);
> > + info->num_attrs++;
> > + }
> > +}
>
Cheers,
Kent.
> --
> With Best Regards,
> Andy Shevchenko
>
>
next prev parent reply other threads:[~2023-12-15 23:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-15 2:38 [PATCH v3 0/5] gpiolib: cdev: relocate debounce_period_us Kent Gibson
2023-12-15 2:38 ` [PATCH v3 1/5] gpiolib: cdev: relocate debounce_period_us from struct gpio_desc Kent Gibson
2023-12-15 16:35 ` Andy Shevchenko
2023-12-15 23:33 ` Kent Gibson [this message]
2023-12-15 2:38 ` [PATCH v3 2/5] gpiolib: remove " Kent Gibson
2023-12-15 2:38 ` [PATCH v3 3/5] gpiolib: cdev: reduce locking in gpio_desc_to_lineinfo() Kent Gibson
2023-12-15 16:36 ` Andy Shevchenko
2023-12-15 23:27 ` Kent Gibson
2023-12-15 2:38 ` [PATCH v3 4/5] gpiolib: cdev: fully adopt guard() and scoped_guard() Kent Gibson
2023-12-15 2:38 ` [PATCH v3 5/5] gpiolib: cdev: improve documentation of get/set values Kent Gibson
2023-12-15 16:43 ` [PATCH v3 0/5] gpiolib: cdev: relocate debounce_period_us Andy Shevchenko
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=ZXziUYicXaENTDk_@rigel \
--to=warthog618@gmail.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--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).