Skip to content

Commit

Permalink
staging: nvec: Add battery quirk to ignore incomplete responses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julian Andres Klode authored and Greg Kroah-Hartman committed Sep 30, 2011
1 parent 1e46e62 commit d6bdcf2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/staging/nvec/nvec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d6bdcf2

Please sign in to comment.