Skip to content
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

FS#1271 - ar71xx/mikrotik: GPIO setup broken by commit e66c47fb14f56be48366d1206b54724ab6dc2502 #6215

Closed
openwrt-bot opened this issue Jan 14, 2018 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

joaochainho:

Commit [[https://github.com/openwrt/openwrt/commit/e66c47fb14f56be48366d1206b54724ab6dc2502|e66c47fb14f56be48366d1206b54724ab6dc2502]] broke the GPIO setup on at least some MikroTik devices: RB750UPr2, RB951Ui-2nD.
GPIOs are not being configured during boot. Reverting this commit, everything works fine again.

root@OpenWrt:~# /etc/init.d/gpio_switch reload /etc/rc.common: eval: line 1: can't create /sys/class/gpio/gpio45/direction: Permission denied /etc/rc.common: eval: line 1: can't create /sys/class/gpio/gpio14/direction: Permission denied

root@ OpenWrt:# ls /sys/class/gpio/gpio14/
active_low device subsystem uevent value
root@ OpenWrt:
# ls /sys/class/gpio/gpio45/
active_low device subsystem uevent value

@openwrt-bot
Copy link
Author

sumpfralle:

The [[https://www.mjmwired.net/kernel/Documentation/gpio/sysfs.txt|sysfs documentation]] of the GPIO interface contains the following note regarding the "directions" interface:

Note that this attribute will not exist if the kernel doesn't support changing the direction of a GPIO [..]

Thus I assume, that the direction of the two pins of the above Mikrotik devices are not configurable.

Thus before the referenced commit, the write access to "direction" failed, but it was remedied by the successive write access to "value". Now we only write to "direction", thus there is no write access to "value" anymore, which could fix the situation for fixed-direction GPIOs.

Probably we should check if "direction" is missing and write to "value" directly, in this case.

@openwrt-bot
Copy link
Author

mkresin:

Depending on your preference, please build an image including the last two commit from the master branch of [[https://git.openwrt.org/?p=openwrt/staging/mkresin.git;a=summary|my staging tree]] and test if the issue is fixed for you.

Alternatively use a precompiled image from https://www.kresin.me/files/ar71xx/ which includes the mentioned commits.

@openwrt-bot
Copy link
Author

joaochainho:

Hi @mathias, I've tested your commits and they fix the issue. GPIOs are now being set up correctly.
Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant