From: <gregkh@linuxfoundation.org>
To: bartosz.golaszewski@oss.qualcomm.com,warthog618@gmail.com
Cc: <stable@vger.kernel.org>
Subject: FAILED: patch "[PATCH] gpiolib: don't overwrite the entire flags field in" failed to apply to 6.12-stable tree
Date: Wed, 02 Dec 2026 14:06:27 +0100 [thread overview]
Message-ID: <2026120226-attitude-radial-6af0@gregkh> (raw)
The patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 8ed87a9adf48703b5729f9d020eb15fa79ffb099
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026120226-attitude-radial-6af0@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 8ed87a9adf48703b5729f9d020eb15fa79ffb099 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Date: Tue, 10 Nov 2026 14:47:01 +0100
Subject: [PATCH] gpiolib: don't overwrite the entire flags field in
gpiod_get_direction()
gpiod_get_direction() snapshots desc->flags with READ_ONCE(), updates
FLAG_IS_OUT in the local copy and writes the whole word back with
WRITE_ONCE(). Any bit that a concurrent user sets or clears atomically in
between - for instance: FLAG_USED_AS_IRQ from gpiochip_lock_as_irq() - is
silently lost.
Update FLAG_IS_OUT with a single atomic assign_bit() directly on
desc->flags. The earlier READ_ONCE() snapshot is only used for the
open-drain check and stays.
Cc: stable@vger.kernel.org
Fixes: 2559f2e09211 ("gpio: reinforce desc->flags handling")
Reviewed-by: Kent Gibson <warthog618@gmail.com>
Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-1-2f463bce8086@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index acd3a1710f84..91041ce0fd49 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -489,8 +489,7 @@ int gpiod_get_direction(struct gpio_desc *desc)
if (ret > 0)
ret = 1;
- assign_bit(GPIOD_FLAG_IS_OUT, &flags, !ret);
- WRITE_ONCE(desc->flags, flags);
+ assign_bit(GPIOD_FLAG_IS_OUT, &desc->flags, !ret);
return ret;
}
next reply other threads:[~2026-12-02 14:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 13:06 gregkh [this message]
2026-12-02 15:01 ` [PATCH 6.12.y] gpiolib: don't overwrite the entire flags field in gpiod_get_direction() Kent Gibson
2026-12-03 13:47 ` Sasha Levin
-- strict thread matches above, loose matches on Subject: below --
2026-12-02 13:06 FAILED: patch "[PATCH] gpiolib: don't overwrite the entire flags field in" failed to apply to 6.12-stable tree gregkh
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=2026120226-attitude-radial-6af0@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.