Make RPi.GPIO work on arm64
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rpi.gpio (Ubuntu) |
Fix Released
|
Low
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned | ||
Cosmic |
Won't Fix
|
Low
|
Unassigned |
Bug Description
[Impact]
* RPi.GPIO currently does not work under arm64 kernels, simply due to hardware revision detection being slightly different.
* The patched version operates as expected under both armhf and arm64 kernels by querying /proc/device-
* This will also bump the version from 0.6.3 to 0.6.5 on bionic/cosmic. This fixes several nasty bugs around PWM handling and event detection. These issues didn't affect short-term experimentation with the library, but do affect long-running deployments (memory leak in PWM allocation, and a race-condition in setting up pin event detection).
[Test Case]
* On an arm64 kernel:
* Install present version of python3-rpi.gpio (0.6.3-1ubuntu4)
* Under python3 "from RPi import GPIO"
* Present version returns RuntimeError: This module can only be run on a Raspberry Pi
* Upgrade to proposed version (0.6.5-1ubuntu1)
* Under python3 "from RPi import GPIO"
* This should succeed
* Run test cases under test/ (note: external wiring/components required; check source header for requirements)
* Repeat procedure with armhf kernel to ensure no regression
[Regression Potential]
* On armhf kernels: low; the existing detection pathway is maintained for ancient kernels lacking /proc/device-
* On arm64 kernels: none; the existing version simply fails to import anyway
Changed in rpi.gpio (Ubuntu): | |
importance: | Undecided → Low |
description: | updated |
Changed in rpi.gpio (Ubuntu Bionic): | |
importance: | Undecided → Low |
Changed in rpi.gpio (Ubuntu Cosmic): | |
importance: | Undecided → Low |
Changed in rpi.gpio (Ubuntu): | |
status: | Fix Committed → Fix Released |
Changed in rpi.gpio (Ubuntu Bionic): | |
importance: | Low → Medium |
Changed in rpi.gpio (Ubuntu Cosmic): | |
status: | New → Won't Fix |
Changed in rpi.gpio (Ubuntu Bionic): | |
status: | New → In Progress |
The package looks good and I guess I'll just sponsor it as is. For a moment I was wondering about proposing a small change to the relevant patch: since currently when we're able to open /proc/device- tree/system/ linux,revision but are not able to read the contents, the patch forces an error. Was thinking that maybe we should fall-back to the cpuinfo check in this case as well. But then, I suppose that if the linux,revision is openable but unreadable, that's actually a bug and maybe one should actually error out. Besides, this might make the code less clean as for handling an edge-case. Might be worth considering, but I now lean towards just releasing this to disco as-is.