[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=Me2Mqj40PLw_q-PgEbyTqsFVNX69iQ73Pz4REG+a8XD4A@mail.gmail.com>
Date: Mon, 14 Oct 2024 09:47:07 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Kent Gibson <warthog618@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 4/6] gpio: cdev: put emitting the line state events on
a workqueue
On Mon, Oct 14, 2024 at 4:09 AM Kent Gibson <warthog618@...il.com> wrote:
>
> > +
> > + scoped_guard(srcu, &ctx->gdev->srcu) {
> > + gc = srcu_dereference(ctx->gdev->chip, &ctx->gdev->srcu);
> > + if (!gc)
> > + return;
> > +
> > + /*
> > + * We're doing this late because it's a sleeping function. Pin
> > + * functions are in general much more static and while it's not
> > + * 100% bullet-proof, it's good enough for most cases.
> > + */
> > + if (!pinctrl_gpio_can_use_line(gc, ctx->chg.info.offset))
> > + ctx->chg.info.flags |= GPIO_V2_LINE_FLAG_USED;
> > + }
> > +
>
> This block should be conditional on GPIO_V2_LINE_FLAG_USED not already
> being set - most of the time it will be and then this is pointless work.
>
Good point, thanks!
Bart
Powered by blists - more mailing lists