-
Notifications
You must be signed in to change notification settings - Fork 35
sysfs: retain support even on older kernels #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
=======================================
+ Coverage 27.2% 27.6% +0.4%
=======================================
Files 96 96
Lines 11834 9481 -2353
=======================================
- Hits 3220 2613 -607
+ Misses 8479 6733 -1746
Partials 135 135 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| func (d *driverGPIO) Prerequisites() []string { | ||
| return []string{"ioctl-gpio"} | ||
| return nil |
There was a problem hiding this comment.
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...!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question. I think moving into After is the right call.
Includes new unit test that are conditionally compiled on linux. Mock in case of no chip available.
|
feedback on this issue would be appreciated. |
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.
23180a3 to
3d495b0
Compare
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
hostpackage 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).