From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Khem Raj <raj.khem@gmail.com>,
Bruce Ashfield <bruce.ashfield@gmail.com>,
openembedded-devel@lists.openembedded.org
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [meta-python][PATCH 2/2] python3-gpiod: fix ptest failure
Date: Tue, 4 Feb 2025 09:47:42 +0100 [thread overview]
Message-ID: <20250204084742.26325-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20250204084742.26325-1-brgl@bgdev.pl>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
instantiated device depends on") revealed an issue in libgpiod bindings
tests where a GPIO simulator device is not disabled before removing its
configfs entries.
Add a patch (already submitted upstream) that fixes the observed ptest
failures.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
...tests-disable-device-before-releasin.patch | 49 +++++++++++++++++++
.../python/python3-gpiod_2.2.3.bb | 5 +-
2 files changed, 53 insertions(+), 1 deletion(-)
create mode 100644 meta-python/recipes-devtools/python/python3-gpiod/0001-bindings-python-tests-disable-device-before-releasin.patch
diff --git a/meta-python/recipes-devtools/python/python3-gpiod/0001-bindings-python-tests-disable-device-before-releasin.patch b/meta-python/recipes-devtools/python/python3-gpiod/0001-bindings-python-tests-disable-device-before-releasin.patch
new file mode 100644
index 0000000000..9025e0d72d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-gpiod/0001-bindings-python-tests-disable-device-before-releasin.patch
@@ -0,0 +1,49 @@
+From ad91b034e7575074998b3e480b592e3ae6d00def Mon Sep 17 00:00:00 2001
+From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Date: Tue, 4 Feb 2025 09:36:13 +0100
+Subject: [PATCH] bindings: python: tests: disable device before releasing the
+ bank
+
+Linux kernel commit 8bd76b3d3f3a ("gpio: sim: lock up configfs that an
+instantiated device depends on") uncovered an issue in Python bindings
+tests where the GPIO simulator device is not disabled before removing its
+configfs entries. Reorder the operations in chip_finalize() in order to
+disable the device first (if needed) before releasing any other
+resources.
+
+Upstream-Status: Submitted [https://lore.kernel.org/all/20250203-fix-gpiosim-in-bindings-v1-2-d2c9e0f3a29d@linaro.org/]
+
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+---
+ tests/gpiosim/ext.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tests/gpiosim/ext.c b/tests/gpiosim/ext.c
+index 272e6f7..cb5611a 100644
+--- a/tests/gpiosim/ext.c
++++ b/tests/gpiosim/ext.c
+@@ -96,15 +96,16 @@ static int chip_init(chip_object *self,
+
+ static void chip_finalize(chip_object *self)
+ {
+- if (self->bank)
+- gpiosim_bank_unref(self->bank);
+-
+ if (self->dev) {
+ if (gpiosim_dev_is_live(self->dev))
+ gpiosim_dev_disable(self->dev);
+-
+- gpiosim_dev_unref(self->dev);
+ }
++
++ if (self->bank)
++ gpiosim_bank_unref(self->bank);
++
++ if (self->dev)
++ gpiosim_dev_unref(self->dev);
+ }
+
+ static void chip_dealloc(PyObject *self)
+--
+2.45.2
+
diff --git a/meta-python/recipes-devtools/python/python3-gpiod_2.2.3.bb b/meta-python/recipes-devtools/python/python3-gpiod_2.2.3.bb
index 58908ad0d5..bdc7e52ca5 100644
--- a/meta-python/recipes-devtools/python/python3-gpiod_2.2.3.bb
+++ b/meta-python/recipes-devtools/python/python3-gpiod_2.2.3.bb
@@ -5,7 +5,10 @@ LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0"
# package is spun out.
LIC_FILES_CHKSUM = "file://setup.py;beginline=241;endline=241;md5=f5ddb56912b7f20bf94aa4d1bdcd3533"
-SRC_URI += "file://run-ptest"
+SRC_URI += " \
+ file://run-ptest \
+ file://0001-bindings-python-tests-disable-device-before-releasin.patch \
+"
SRC_URI[sha256sum] = "b916c3741dfc4dbcf6224b39e50765f672b137896287715709d49e9f063304c5"
--
2.45.2
prev parent reply other threads:[~2025-02-04 8:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 8:47 [meta-oe][PATCH 1/2] libgpiod: fix ptests failure Bartosz Golaszewski
2025-02-04 8:47 ` Bartosz Golaszewski [this message]
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=20250204084742.26325-2-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=bruce.ashfield@gmail.com \
--cc=openembedded-devel@lists.openembedded.org \
--cc=raj.khem@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.