Skip to content

Conversation

kaespi
Copy link

@kaespi kaespi commented Sep 6, 2025

The ioctl-gpio driver was declared a prerequisite of the sysfs-gpio driver. But since on older Linux kernels (earlier than 5.10) the GPIO v2 interface is not yet available. Therefore, the ioctl-gpio driver is not available for such systems. To still support the sysfs access for those make the ioctl-gpio driver independent of the sysfs-gpio driver.

Note: the ioctl-gpio driver is still attempted to load.

This renders #39 (implemented in #59) a bit more backwards compatabile.

Background: we're using periph.io on our embedded Linux with kernel 5.4.193. It was all working fine until we recently upgraded the host package from 3.8.2 to 3.8.5. Suddenly nothing was working anymore. We noticed the error is in the initialization of the ioctl-gpio driver which uses the GPIO v2 interface, which is not yet available on our kernel. Since we only use the sysfs-gpio driver we removed the dependency on ioctl-gpio and all was working fine again. Therefore, I guess more people would want to have backwards compatibility (in particular since the change was introduced in 3.8.2 -> 3.8.3 which is supposed to be non-breaking, I guess).

The ioctl-gpio driver was declared a prerequisite of the sysfs-gpio driver. But since on older Linux kernels (earlier than 5.10) the GPIO v2 interface is not yet available. Therefore, the ioctl-gpio driver is not available for such systems. To still support the sysfs access for those make the ioctl-gpio driver independent of the sysfs-gpio driver.

Note: the ioctl-gpio driver is still attempted to load.
Copy link

codecov bot commented Sep 6, 2025

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.2%. Comparing base (9cd28b7) to head (23180a3).

Files with missing lines Patch % Lines
gpioioctl/gpio.go 0.0% 8 Missing ⚠️

❌ Your project check has failed because the head coverage (27.2%) is below the target coverage (60.0%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##            main     #71     +/-   ##
=======================================
- Coverage   27.2%   27.2%   -0.0%     
=======================================
  Files         96      96             
  Lines      11834   11838      +4     
=======================================
  Hits        3220    3220             
- Misses      8479    8483      +4     
  Partials     135     135             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


func (d *driverGPIO) Prerequisites() []string {
return []string{"ioctl-gpio"}
return nil
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's really some dependency on ioctl-gpio we could move it to the After() below...!?

kaespi referenced this pull request Sep 9, 2025
Includes new unit test that are conditionally compiled on linux. Mock in case of no chip available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants