[PATCH 27/30] staging: nvec: Add battery quirk to ignore incomplete responses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 drivers/staging/nvec/nvec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 73db97c..77e2d8f 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -442,6 +442,10 @@ 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;
 	}
 
-- 
1.7.5.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux