Skip to content

Use a supported GPIO event clock on Linux 5.10 - #73

Open
dhairyajangir wants to merge 1 commit into
vsergeev:masterfrom
dhairyajangir:fix/gpio-v2-clock-linux-5-10
Open

dhairyajangir wants to merge 1 commit into
vsergeev:masterfrom
dhairyajangir:fix/gpio-v2-clock-linux-5-10

Conversation

@dhairyajangir

Copy link
Copy Markdown

GPIO ABI v2 is available in Linux 5.10, but the realtime event clock flag arrived in 5.11. The current default therefore makes both-edge requests fail with EINVAL on 5.10 unless callers explicitly select monotonic.

Default to monotonic on 5.10 and retain realtime on newer kernels. Explicit clock choices still reach the kernel unchanged, including realtime on vendor kernels that backport it.

On Debian 5.10.223 in QEMU, the original default failed through both the constructor and edge setter. The patched default read rising and falling events with monotonic timestamps. On Linux 7.0.0-42, the realtime default and both explicit clock choices continued to work. All eight repository CI-mode suites passed on Python 3.12 and 3.14, and mypy passed.

Fixes #70.

AI assisted with investigation, testing, and the patch.

@dhairyajangir

Copy link
Copy Markdown
Author

Could a maintainer authorize the Tests workflow for b6322bf when convenient? The workflow is awaiting authorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting edge on cdevV2 GPIO raises an OSError 22 of "Invalid Argument"

1 participant