staging: nvec: Add battery quirk to ignore incomplete responses
authorJulian Andres Klode <jak@jak-linux.org>
Tue, 27 Sep 2011 17:01:04 +0000 (19:01 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 30 Sep 2011 00:41:38 +0000 (17:41 -0700)
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 <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/nvec/nvec.c

index 8c01723d681a38098c1a73af457a38df040b4c66..a80f9935a3e14d5225ef183de295304d5f4959fd 100644 (file)
@@ -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;
        }