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

LEDE Bugs lede-bugs at lists.infradead.org
Wed Apr 19 06:21:00 PDT 2017


A new Flyspray task has been opened.  Details are below. 

User who did this - Charlemagne Lasse (charlemagnelasse) 

Attached to Project - LEDE Project
Summary - gpio-button-hotplug: missing debounce for IRQ GPIOs
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - 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.

More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=720



More information about the lede-bugs mailing list