[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXsU_UN6g0Fdj4qx@rigel>
Date: Thu, 14 Dec 2023 22:45:17 +0800
From: Kent Gibson <warthog618@...il.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linus.walleij@...aro.org, andy@...nel.org
Subject: Re: [PATCH v2 2/5] gpiolib: cdev: relocate debounce_period_us from
struct gpio_desc
On Thu, Dec 14, 2023 at 03:29:28PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 14, 2023 at 10:58 AM Kent Gibson <warthog618@...il.com> wrote:
> >
> >
> > +/*
> > + * 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 {
> > + /* a rbtree of the struct lines containing the supplemental info */
> > + struct rb_root tree;
> > + /* covers tree */
> > + spinlock_t lock;
>
> Looks like this is never taken from atomic context? Can this be a mutex instead?
>
Correct, only from thread context.
Can be a mutex, but it only covers tree lookups which should be quick
as the tree is kept minimal, and I wouldn't expect it to ever get to the
mutex slowpath, so a spinlock seemed more appropriate.
Cheers,
Kent.
Powered by blists - more mailing lists