[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241016094311.GA210746@rigel>
Date: Wed, 16 Oct 2024 17:43:11 +0800
From: Kent Gibson <warthog618@...il.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
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 v3 6/6] gpiolib: notify user-space about in-kernel line
state changes
On Wed, Oct 16, 2024 at 11:22:07AM +0200, Bartosz Golaszewski wrote:
> On Wed, Oct 16, 2024 at 11:17 AM Kent Gibson <warthog618@...il.com> wrote:
> >
> > > >
> > >
> > > You mean, you get a CHANGED_CONFIG event but the debounce value is not
> > > in the associated line info?
> > >
> >
> > Correct.
> >
>
> Ok, let me see.
>
When setting from userspace the issue is that linereq_set_config() setting the
direction will emit, quite possibly before the debounce has been set. The
edge_detector_setup() that does set it can also emit, though only if the
hardware supports debounce. And then there could be a race between the
notifier being called and the period being set in the supinfo.
(the set will probably win that one)
Debounce set from the kernel side is going to be an issue as cdev
catches and stores the value from userspace to report in the supinfo - that
isn't the case for kernel calls to gpiod_set_config().
Seems moving the debounce value out of the desc and into cdev, which seemed a
good idea at the time, might come back and bite now if it is no longer
restricted to being cdev specific. Now there is an actual reason to
store it in the desc :(.
Cheers,
Kent.
Powered by blists - more mailing lists