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#720 - gpio-button-hotplug: missing debounce for IRQ GPIOs #7232

Closed
openwrt-bot opened this issue Apr 19, 2017 · 2 comments
Closed

FS#720 - gpio-button-hotplug: missing debounce for IRQ GPIOs #7232

openwrt-bot opened this issue Apr 19, 2017 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

charlemagnelasse:

I've noticed that some (multiple random) hardware in the fields suffers from weird factory resets without somebody pressing the button (it is physical not possible that someone could reach the button). I've noticed that it only happens with hardware that supports GPIO IRQs and which uses gpio-button-hotplug.

Problem seems to be that:

  • CPU registers a really short 1 on the GPIO line
  • IRQ is triggered
  • gpio-button-hotplug handles the IRQ and noticed that the GPIO line is 0
  • gpio-button-hotplug thinks that this was a button release after a really long button press
  • factory reset is triggered by /etc/rc.button/reset

It looks like this can be fixed by checking if the button was actually pressed before calculating the holding time and sending the userspace event.

But there is a possible second problem caused by the missing debounce. The (incorrect) 1 on the GPIO line could be there long enough that the interrupt handler registers a press then directly receives a button release. This would trigger a REBOOT (even when not wanted). This (maybe) can be fixed by using a 5ms timer until accepting a key press.

@openwrt-bot
Copy link
Author

atyg02:

hi Charlemagne Lasse,

Eventhough I have added 60 (ms) debounce-interval in the device tree, still my device reboots with a small pulse width of 8us, could you please help to fix the problem.

Thank you!!

Regards
Aman

@openwrt-bot
Copy link
Author

chunkeey:

Hello,

this should be fixed by: [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=afc056d7dc833bbd714386007db1bfcf48188954|gpio-button-hotplug: support interrupt properties]] and the following patches. Which have also been ported to openwrt-19.07.

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