mirror of https://gitee.com/openkylin/linux.git
c1ada2ff80
In ltc2952_poweroff_handler it is theoretically possible that the timer fails to start on first pass (button press), but succeeds in starting on the second (button release). This will cause the button press to be misinterpreted, and will incorrectly shut down the system. Because a picture says more than a thousand words: Expected behavior: tmr: ++++++++++ btn: -----__________----- Faulty behavior: tmr: +++++ btn: -----__________----- Legend: + timer runs _ button pressed - button depressed To prevent this from happening, check the value of the gpio before starting the timer. If the button is active, we should start the timer, else we should stop it. The situation described can now still occur if the polarity of the input pin is set incorrectly, but that at least is predictable behavior and can be detected during the first tests. Signed-off-by: Frans Klaver <frans.klaver@xsens.com> Signed-off-by: Sebastian Reichel <sre@kernel.org> |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
arm-versatile-reboot.c | ||
as3722-poweroff.c | ||
at91-poweroff.c | ||
at91-reset.c | ||
axxia-reset.c | ||
brcmstb-reboot.c | ||
gpio-poweroff.c | ||
gpio-restart.c | ||
hisi-reboot.c | ||
imx-snvs-poweroff.c | ||
keystone-reset.c | ||
ltc2952-poweroff.c | ||
msm-poweroff.c | ||
qnap-poweroff.c | ||
restart-poweroff.c | ||
st-poweroff.c | ||
sun6i-reboot.c | ||
syscon-reboot.c | ||
vexpress-poweroff.c | ||
xgene-reboot.c |