Skip to contentSkip to conversation

tests: add enable_debounce_then_edge_detection

PATCH Applied Kent Gibson 2 participants 2 messages May 13, 2024 – May 15, 2024 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: add enable_debounce_then_edge_detection

A bug was recently discovered in the kernel that can result in the edge event fifo not being correctly initialised and stack contents being returned in edge events. The trigger for the bug is requesting a line with debounce, but not edge detection, and then reconfiguring the line to enable edge detection.

Add a test case that triggers the bug. This will fail on kernels that do not contain the fix for the bug. The test is located in a new test file, tests-kernel-uapi.c, intended to contain tests specifically testing some aspect of the kernel uAPI, not libgpiod itself.

---
 tests/Makefile.am         |   1 +
 tests/tests-kernel-uapi.c | 112 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)
 create mode 100644 tests/tests-kernel-uapi.c
tests/Makefile.am +1 -0
index 0680d5e..a5e1fe0 100644
@@ -24,6 +24,7 @@ gpiod_test_SOURCES = \
 	tests-chip-info.c \
 	tests-edge-event.c \
 	tests-info-event.c \
+	tests-kernel-uapi.c \
 	tests-line-config.c \
 	tests-line-info.c \
 	tests-line-request.c \
tests/tests-kernel-uapi.c new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
2.39.2
#1 lore raw

From: Bartosz Golaszewski <[email protected]>

Quoted 6 lines · Kent Gibson

A bug was recently discovered in the kernel that can result in the edge event fifo not being correctly initialised and stack contents being returned in edge events. The trigger for the bug is requesting a line with debounce, but not edge detection, and then reconfiguring the line to enable edge detection.

Quoted 6 lines

Add a test case that triggers the bug. This will fail on kernels that do not contain the fix for the bug. The test is located in a new test file, tests-kernel-uapi.c, intended to contain tests specifically testing some aspect of the kernel uAPI, not libgpiod itself.

[...]

Applied, thanks!

[1/1] tests: add enable_debounce_then_edge_detection

      commit: 0a552e7908896b7b96fd502052fa7289af9f6e7b

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>