From patchwork Thu Dec 3 11:13:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Tyagi X-Patchwork-Id: 107130 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.11619.1796296553528089225 for ; Thu, 03 Dec 2026 03:15:53 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=KWDHs4Ux; spf=pass (domain: gmail.com, ip: 209.85.215.170, mailfrom: ankur.tyagi85@gmail.com) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-cdb75699c7cso5511528a12.2 for ; Thu, 03 Dec 2026 03:15:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796296553; x=1796901353; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=3BqHBjy0CjFNBlUIL0m3bcwhmNQjd6roaDUzg+rF+24=; b=KWDHs4UxKGUKWWQp/FfRmENLOeQsflG/13miBhxWpOCnPAHoPxAdC0JCG7uv4uUTzU 3dd6OqjUKBvRoBTwEhLEerRvkXWGEUWv16xT/+b1gn5Dv0pu+Rw3imI0kBROn/2qZ6LW ivKhWso4D6LrrAG34KjFQeIKcBwWQ+ZaMDNCLobOCL4htplXz0mIPQmJguNfgfBXnYLK cSsRfMMJgSZlp+Syn5hk/FGmg3wvpwX5Sx0p8HRSrPXjbtFUAJwUjgcx1TSwfeqEVmNw VaPJt1l4m5Y+qhWkzxyMh/q4IeirtDl+iXQjTs2coc63g2uTF6tMNyEgLajr11TF8JC4 4YCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796296553; x=1796901353; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=3BqHBjy0CjFNBlUIL0m3bcwhmNQjd6roaDUzg+rF+24=; b=2t4A/twBhHA0M5AGocyZ7izYNi/UcEfjgxJ9Sl5V5yYgs2u09Fr5F0XddWR1N0hD5i l8ZdCvNnEFGN0dTmR85S4GFv+V6bqUropLClnh0u5HuFmwKPwugjRPGrpzrHe/4p1iSN P6XL0x2Nzizdc2v8PLfnhvkoVPRkpGkS91ulI0DioyUK8HtDgzJlUo5oQ6rxbn7MH/JT YnPXYI7D82QU4x+r+l4K9G5xPHNw7tEvdsyb27zhtBxWwLscwADsusAry0u1pM/dEmNj AhCOQa44ewFz6KqYzogOgN1dVhQlvhFSfSPStrDp44VcN4z5Wy7M4ZTepJoz3sGF0MKU DqpQ== X-Gm-Message-State: APuU4Z91hT2u23iNdumPysJcPHgE2RgDx7kKfJaqHYN7rOTgPWE5NJPc Ab7wSiqUa4jR6D19jjNm2Mulwtpoy4Cu1SWpHjLmECg32oT3PNpUxc7a+m+0/MSX X-Gm-Gg: AZFdTZe01VjPkM51+11nnF6AQqMnzujdy4NjmWuuiln0jRjTxJp6hR6wuADUSfHcmed Jl8/hIpRCuc1ja3TGkOd7QL7+aURy/RpMuFYcH16QHIuJAeEdPD30F6bsMnwDjov+Ndv1d7eMHP H6znZH3WXi4pvO0/ehnL7nPBRXr5d4B93+qSqdOu5u3s1j8NJu0CGZnQB25SzzqUQlofKKe4UF+ bwUTv9u/osyBF6TC7uW9oAE26Iun1lC5cCZ58gveW4KoIBFKOSKipkQBMHFjUqEE2FkqqKHPIZR yV7I0sOXSHXILuSSlJXuFARXt4DeFptboCW/VOTjBwLHo/Kl6bw6kbFhAOWKwC+OTBNBcdnJNjm eINgRy+3WQuWa+H8VrBFvNAq/R/5kbsGrarUzBmRtckZ+X1LfC0JVsvNuuXzYqJaFLZgPGQxI3L l1/RleyoHo6E5THplrl9c12XgD/0jDaH3lNT5A7MrI7XhpfKlIXAGfjgxChMS/QgQVUru/o6t9y 8j9ldd+hhlVajJapKA8hGNojT612dha59m6EH8qFqEYdfdbFYCUgECIAG32WIX8oA0UBrlYiD5G aBA535wK7luT/jfGqkLvOawlij/nzuwlY+X6mxtIEPzOGrgnlH1l/+JY0QGREEoB/0Fu8pBcs5M 2+m/RZ80gErYEN4WrU+9Fkg== X-Received: by 2002:a17:90b:2f8c:b0:3b3:af8e:ea8d with SMTP id 98e67ed59e1d1-3b41c92a403mr43182710a91.39.1796296552800; Thu, 03 Dec 2026 03:15:52 -0800 (PST) Return-Path: Received: from NVAPF55DW0D-IPD.. ([147.161.219.8]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65b94sm3890436a91.12.2026.12.03.03.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 03:15:52 -0800 (PST) From: ankur.tyagi85@gmail.com To: openembedded-devel@lists.openembedded.org Cc: Khem Raj , Ankur Tyagi Subject: [oe][meta-oe][blacksail][PATCH 31/95] libgpiod: Fix intermittent gpiocli monitor ptest failures Date: Fri, 4 Dec 2026 00:13:02 +1300 Message-ID: <20261203111406.4182597-31-ankur.tyagi85@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261203111406.4182597-1-ankur.tyagi85@gmail.com> References: <20261203111406.4182597-1-ankur.tyagi85@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Thu, 03 Dec 2026 11:15:58 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133921 From: Khem Raj test_monitor_all_lines_on_request and test_monitor_multiple_lines_by_name toggle one line twice, with another line in between, before reading any event. gpio-sim delivers both changes of the first line as one interrupt when they happen before it is handled, so the rising edge is lost: ASSERT: '41610700648 falling "foo" 41610665414 rising 4' did not match '[0-9]+ rising\s+"foo"' ASSERT: '45056166795 falling "foo" 45056147828 rising "xyz"' did not match '[0-9]+ rising\s+"foo"' Wait for each event before triggering the next one. In a qemux86-64 guest this took the tests from 12 and 13 of 20 runs failing to none, and ptest-runner libgpiod passed 12 of 12 runs on the rebuilt image. The fix is the v2 patch sent upstream, which squashes the two tests' fixes into one commit as the maintainer asked. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj (cherry picked from commit e10a938eb1c72b843f50e6acbe8dfbb2ce63c34c) Signed-off-by: Ankur Tyagi --- ...s-wait-for-each-event-in-the-gpiocli.patch | 82 +++++++++++++++++++ .../libgpiod/libgpiod_2.3.2.bb | 1 + 2 files changed, 83 insertions(+) create mode 100644 meta-oe/recipes-support/libgpiod/libgpiod-2.x/0001-dbus-client-tests-wait-for-each-event-in-the-gpiocli.patch diff --git a/meta-oe/recipes-support/libgpiod/libgpiod-2.x/0001-dbus-client-tests-wait-for-each-event-in-the-gpiocli.patch b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/0001-dbus-client-tests-wait-for-each-event-in-the-gpiocli.patch new file mode 100644 index 0000000000..394a73baf5 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod-2.x/0001-dbus-client-tests-wait-for-each-event-in-the-gpiocli.patch @@ -0,0 +1,82 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 25 Nov 2026 15:37:49 -0800 +Subject: [PATCH] dbus: client: tests: wait for each event in the gpiocli + monitor tests + +test_monitor_all_lines_on_request and test_monitor_multiple_lines_by_name +pull one line up, a second line up and the first line down again in +quick succession and only then read the monitor output. gpio-sim raises +the line interrupts through irq_sim, so two changes of the same line +that happen before the interrupt is handled are delivered as one +interrupt, and as edge detection is set to both edges the kernel derives +the edge type from the line value read in the handler. The rising edge +on the first line is then lost and only a falling edge is reported, +timestamped after the rising edge on the second line: + + ASSERT: '41610700648 falling "foo" 41610665414 rising 4' did not + match '[0-9]+ rising\s+"foo"' + + ASSERT: '45056166795 falling "foo" 45056147828 rising "xyz"' did not + match '[0-9]+ rising\s+"foo"' + +The tests fail intermittently, in 12 and 13 of 20 runs respectively, in a +qemux86-64 guest. + +Wait for each event before triggering the next one, like the gpiomon +tests in gpio-tools-test.bash do. In test_monitor_multiple_lines_by_name, +matching the next line of output instead of searching all of it also +makes the test verify that the change of line bar, which is not +monitored, is ignored. + +Fixes: a5ab76da1e0a ("dbus: add the D-Bus daemon, command-line client and tests") +Upstream-Status: Submitted [https://lore.kernel.org/linux-gpio/20261125234308.4052324-1-raj.khem@gmail.com/] +AI-Generated: Uses Claude Code +Signed-off-by: Khem Raj +--- + dbus/client/gpiocli-test.bash | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/dbus/client/gpiocli-test.bash b/dbus/client/gpiocli-test.bash +index 5160f57..ebddcbf 100755 +--- a/dbus/client/gpiocli-test.bash ++++ b/dbus/client/gpiocli-test.bash +@@ -1376,14 +1376,14 @@ test_monitor_multiple_lines_by_name() { + dut_run gpiocli monitor foo xyz + + gpiosim_set_pull sim0 1 pull-up ++ dut_regex_match "[0-9]+ rising\\s+\"foo\"" ++ + gpiosim_set_pull sim0 5 pull-up # This should be ignored + gpiosim_set_pull sim0 11 pull-up +- gpiosim_set_pull sim0 1 pull-down ++ dut_regex_match "[0-9]+ rising\\s+\"xyz\"" + +- dut_read +- output_regex_match "[0-9]+ rising\\s+\"foo\"" +- output_regex_match "[0-9]+ rising\\s+\"xyz\"" +- output_regex_match "[0-9]+ falling\\s+\"foo\"" ++ gpiosim_set_pull sim0 1 pull-down ++ dut_regex_match "[0-9]+ falling\\s+\"foo\"" + + gpiodbus_release_request "$request" + } +@@ -1421,13 +1421,13 @@ test_monitor_all_lines_on_request() { + dut_run gpiocli monitor -r "$request" + + gpiosim_set_pull sim0 1 pull-up ++ dut_regex_match "[0-9]+ rising\\s+\"foo\"" ++ + gpiosim_set_pull sim0 4 pull-up +- gpiosim_set_pull sim0 1 pull-down ++ dut_regex_match "[0-9]+ rising\\s+4" + +- dut_read +- output_regex_match "[0-9]+ rising\\s+\"foo\"" +- output_regex_match "[0-9]+ rising\\s+4" +- output_regex_match "[0-9]+ falling\\s+\"foo\"" ++ gpiosim_set_pull sim0 1 pull-down ++ dut_regex_match "[0-9]+ falling\\s+\"foo\"" + + gpiodbus_release_request "$request" + } diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.3.2.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.3.2.bb index eb1c454f8c..244e6ff7dc 100644 --- a/meta-oe/recipes-support/libgpiod/libgpiod_2.3.2.bb +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.3.2.bb @@ -25,6 +25,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-2.x:" SRC_URI += " \ file://gpio-manager.init \ + file://0001-dbus-client-tests-wait-for-each-event-in-the-gpiocli.patch \ " SRC_URI[sha256sum] = "dc48fb87cd72019745acb201599caf559556b5d913844df0ed011067d19e9a6b"