From: Julian Andres Klode Date: Tue, 27 Sep 2011 17:01:04 +0000 (+0200) Subject: staging: nvec: Add battery quirk to ignore incomplete responses X-Git-Tag: firefly_0821_release~3680^2~4313^2^2~312 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d6bdcf2e1019351cbc176e963b7756766bdd8721;p=firefly-linux-kernel-4.4.55.git staging: nvec: Add battery quirk to ignore incomplete responses The nvec_power system polls nvec for battery information. In some cases, that part seems to be overloaded and unable to respond fast in which case it sends an incomplete response. We need to mark the transfer as completed, though, in order to prevent endless retries which can kill nvec. Signed-off-by: Julian Andres Klode Acked-by: Marc Dietrich Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 8c01723d681a..a80f9935a3e1 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -446,6 +446,11 @@ static void nvec_rx_completed(struct nvec_chip *nvec) nvec_msg_free(nvec, nvec->rx); nvec->state = 0; + + /* Battery quirk - Often incomplete, and likes to crash */ + if (nvec->rx->data[0] == NVEC_BAT) + complete(&nvec->ec_transfer); + return; }