2017-09-22 07:59 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0013734CentOS-7kernelpublic2017-09-13 22:30
Reporterpgreco 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformbananapiOSOS Version
Product Version7.3.1611 
Target VersionFixed in Version 
Summary0013734: wiringPiSetup: mmap (GPIO) failed: Operation not permitted
DescriptionOperation not permitted using gpio on kernel 4.9 (works ok on 4.4)

[root@bananapi ~]# uname -r
4.9.13-203.el7.armv7hl
[root@bananapi ~]# gpio readall
wiringPiSetup: mmap (GPIO) failed: Operation not permitted
--
[root@bananapi ~]# uname -r
4.4.34-201.el7.armv7hl
[root@bananapi ~]# gpio readall
+----------+-Rev3-+------+--------+------+-------+
| wiringPi | GPIO | Phys | Name | Mode | Value |
+----------+------+------+--------+------+-------+
| 0 | 17 | 11 | GPIO 0 | IN | Low |
| 1 | 18 | 12 | GPIO 1 | IN | Low |
| 2 | 27 | 13 | GPIO 2 | IN | Low |
| 3 | 22 | 15 | GPIO 3 | IN | High |
| 4 | 23 | 16 | GPIO 4 | IN | Low |
| 5 | 24 | 18 | GPIO 5 | IN | High |
| 6 | 25 | 22 | GPIO 6 | IN | Low |
| 7 | 4 | 7 | GPIO 7 | IN | Low |
| 8 | 2 | 3 | SDA | ALT5 | High |
| 9 | 3 | 5 | SCL | ALT5 | High |
| 10 | 8 | 24 | CE0 | ALT5 | Low |
| 11 | 7 | 26 | CE1 | ALT5 | Low |
| 12 | 10 | 19 | MOSI | ALT5 | Low |
| 13 | 9 | 21 | MISO | ALT5 | Low |
| 14 | 11 | 23 | SCLK | ALT5 | Low |
| 15 | 14 | 8 | TxD | ALT0 | Low |
| 16 | 15 | 10 | RxD | ALT0 | High |
| 17 | 28 | 3 | GPIO 8 | IN | Low |
| 18 | 29 | 4 | GPIO 9 | ALT4 | Low |
| 19 | 30 | 5 | GPIO10 | OUT | High |
| 20 | 31 | 6 | GPIO11 | ALT4 | Low |
+----------+------+------+--------+------+-------+
--
Also tested with the last 4.9.34-203, same error
Steps To Reproduce1) download,compile and install https://github.com/LeMaker/WiringBP
2) execute gpio readall or any program that uses the library.
TagsNo tags attached.
abrt_hash
URL
Attached Files

-Relationships
+Relationships

-Notes

~0030054

pgreco (reporter)

This is related to CONFIG_STRICT_DEVMEM=y, booting with iomem=relaxed solves this problem for me but I don't think it is the "right" solution.
The strange thing is that the "working" kernel also has CONFIG_STRICT_DEVMEM=y.
Starting to see if I can find the reason watching the code changes....

~0030056

pgreco (reporter)

Well, according to this https://github.com/torvalds/linux/commit/90a545e981267e917b9d698ce07affd69787db87#diff-e65af3c2754b397e1fece37c60cdf11f , it is intentional and booting with iomem=relaxed seems to be correct.
Either way, this is not a centos bug, it is a kernel "feature"
I think this should be closed.
+Notes

-Issue History
Date Modified Username Field Change
2017-08-29 11:45 pgreco New Issue
2017-09-13 22:00 pgreco Note Added: 0030054
2017-09-13 22:30 pgreco Note Added: 0030056
+Issue History