Input: applespi - don't wait for responses to commands indefinitely.
authorRonald Tschalär <ronald@innovation.ch>
Fri, 19 Feb 2021 19:10:51 +0000 (11:10 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:11:32 +0000 (17:11 +0100)
commitcbeeedcfbacebbc1b84352e1fc33ff80b8917fd6
tree7e668718ca7c0e7c55f5399404376c42c67370bf
parentbc6759bd959dc62aea9933f5b54932d44bac80e0
Input: applespi - don't wait for responses to commands indefinitely.

[ Upstream commit 0ce1ac23149c6da939a5926c098c270c58c317a0 ]

The response to a command may never arrive or it may be corrupted (and
hence dropped) for some reason. While exceedingly rare, when it did
happen it blocked all further commands. One way to fix this was to
do a suspend/resume. However, recovering automatically seems like a
nicer option. Hence this puts a time limit (1 sec) on how long we're
willing to wait for a response, after which we assume it got lost.

Signed-off-by: Ronald Tschalär <ronald@innovation.ch>
Link: https://lore.kernel.org/r/20210217190718.11035-1-ronald@innovation.ch
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/keyboard/applespi.c