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-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d6bdcf2e1019351cbc176e963b7756766bdd8721;p=mv-sheeva.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 8c01723d681..a80f9935a3e 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; }