mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Ambrozewicz <aambrozewicz@nvidia.com>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Kent Gibson <warthog618@gmail.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: clear the event clock flags when a line is released
Date: Fri, 16 Oct 2026 10:46:57 +0300	[thread overview]
Message-ID: <20261016074704.1860749-10-aambrozewicz@nvidia.com> (raw)
In-Reply-To: <sashiko-outbox-168236@kernel.org>

On Mon, Oct 12, 2026 at 02:05:49PM +0000, sashiko-bot@kernel.org wrote:
> In gpiod_free_commit(), the ownership synchronization token
> (GPIOD_FLAG_REQUESTED) is cleared in desc->flags via a WRITE_ONCE() before
> the function finishes cleaning up ancillary state (debounce_period_us) and
> emitting the GPIO_V2_LINE_CHANGED_RELEASED notification:

This is real, and older than this patch: once the cleared
GPIOD_FLAG_REQUESTED is visible, a new request can set
desc->debounce_period_us in edge_detector_setup() before the old one
resets it to 0, and the debounce code reads the period from there.

I'll send a fix with v2 of the chip-removal series, which touches the
same function: reset the period first, then write the flags with
release ordering, pairing with the test_and_set_bit() in
gpiod_request_commit(), so that a new owner sees the reset. The
RELEASED notification can still arrive after the new request's
REQUESTED one. Moving it before the flags update would report the line
as still requested in the RELEASED event, so the fix will describe
that rather than reorder it.

Adrian

  parent reply	other threads:[~2026-10-16  7:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 13:49 Adrian Ambrozewicz
     [not found] ` <sashiko-outbox-168236@kernel.org>
2026-10-16  7:46   ` Adrian Ambrozewicz [this message]
2026-10-16  9:03     ` Bartosz Golaszewski
2026-10-16  9:39       ` Adrian Ambrozewicz
2026-10-19  8:02 ` Bartosz Golaszewski

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=20261016074704.1860749-10-aambrozewicz@nvidia.com \
    --to=aambrozewicz@nvidia.com \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog618@gmail.com \
    /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

all inboxes | Powered by JetHome®