summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Gupta <hemant.gupta@stericsson.com>2011-09-27 18:46:46 +0530
committerJonas ABERG <jonas.aberg@stericsson.com>2011-09-30 13:47:50 +0200
commitbae8c678a8f6a982cfe28bcb6f57bccd4dcb35b8 (patch)
treea8da0ded9c9ac02a55d50ad85e08d7efe37b2d89
parent851935557854755175e9d8955234c1c15ec06b13 (diff)
mfd/cg2900: Error opening HCI Raw Channel
This patch fixes the corner case issue in driver, due to which if the port is closed while data is being read, the driver state is not correct next time the port is re-opened. ST-Ericsson Linux next: Not tested, ER356425 ST-Ericsson ID: 356425 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I82090c25ce7dd3aea07bacd96856d62361bcd741 Signed-off-by: Hemant Gupta <hemant.gupta@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32208 Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Par-Gunnar HJALMDAHL <par-gunnar.p.hjalmdahl@stericsson.com>
-rw-r--r--drivers/staging/cg2900/bluetooth/cg2900_uart.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/staging/cg2900/bluetooth/cg2900_uart.c b/drivers/staging/cg2900/bluetooth/cg2900_uart.c
index 9ec839c79db..d64b0f0feaa 100644
--- a/drivers/staging/cg2900/bluetooth/cg2900_uart.c
+++ b/drivers/staging/cg2900/bluetooth/cg2900_uart.c
@@ -1421,6 +1421,16 @@ static void uart_set_chip_power(struct cg2900_chip_dev *dev, bool chip_on)
"New sleep_state: CHIP_POWERED_DOWN\n");
uart_info->sleep_state = CHIP_POWERED_DOWN;
}
+
+ /*
+ * Reset the uart_info state so that
+ * next packet can be handled
+ * correctly by driver.
+ */
+ uart_info->rx_state = W4_PACKET_TYPE;
+ uart_info->rx_count = 0;
+ kfree_skb(uart_info->rx_skb);
+ uart_info->rx_skb = NULL;
cg2900_disable_regulator(uart_info);
/*
* Setting baud rate to 0 will tell UART driver to shut off its