public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] drivers:misc: ti-st: fixes
@ 2011-08-09 19:38 pavan_savoy
  2011-08-09 19:38 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
  2011-08-09 20:31 ` [PATCH 0/8] drivers:misc: ti-st: fixes Greg KH
  0 siblings, 2 replies; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>


These are some of the fixes that have gone into the driver during various
testing, production validation stages.
Some are very minor and some impact performance.

Greg,
Packing more patches this time around. Please review

Pavan Savoy (7):
  drivers:misc: ti-st: avoid a misleading dbg msg
  drivers:misc:ti-st: platform hooks for chip states
  drivers:misc: ti-st: reinit completion on ver read
  drivers:misc: ti-st: reinit completion before send
  drivers:misc: ti-st: wait for completion at fail
  drivers:misc: ti-st: free skb on firmware download
  drivers:misc: ti-st: fix unexpected UART close

Vijay Badawadagi (1):
  drivers:misc: ti-st: fail-safe on wrong pkt type


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg
  2011-08-09 19:38 [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
@ 2011-08-09 19:38 ` pavan_savoy
  2011-08-09 19:38   ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
  2011-08-09 20:30   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg Greg KH
  2011-08-09 20:31 ` [PATCH 0/8] drivers:misc: ti-st: fixes Greg KH
  1 sibling, 2 replies; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Previously the private data of each protocol registered to use ST was
used to determine whether the protocol was registered to use shared
transport or otherwise.
However, now a flag is_registered is maintained to identify whether a
protocol intends to use ST.
Upon closing of the UART the error message relevant to this lack of
un-registration was misleading and this patch fixes that.

Change-Id: I1a452dccd7b4bd53cce923df5b61ce077b7aa466
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 54c91ff..c8e335d 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -717,7 +717,7 @@ static void st_tty_close(struct tty_struct *tty)
 	 */
 	spin_lock_irqsave(&st_gdata->lock, flags);
 	for (i = ST_BT; i < ST_MAX_CHANNELS; i++) {
-		if (st_gdata->list[i] != NULL)
+		if (st_gdata->is_registered[i] == true)
 			pr_err("%d not un-registered", i);
 		st_gdata->list[i] = NULL;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states
  2011-08-09 19:38 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
@ 2011-08-09 19:38   ` pavan_savoy
  2011-08-09 19:38     ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
  2011-08-09 20:30   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg Greg KH
  1 sibling, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Certain platform specific or Host-WiLink Interface specific actions would be
required to be taken when the chip is being enabled and after the chip is
disabled such as configuration of the mux modes for the GPIO of host connected
to the nshutdown of the chip or relinquishing UART after the chip is disabled.

Similar actions can also be taken when the chip is in deep sleep or when the
chip is awake. Performance enhancements such as configuring the host to run
faster when chip is awake and slower when chip is asleep can also be made
here.

Change-Id: I5baad900633e69740396bf1d6900feec4f2b596e
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |   12 ++++++++++++
 drivers/misc/ti-st/st_ll.c  |   19 +++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 38fd2f0..6884dd1 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -434,11 +434,17 @@ long st_kim_start(void *kim_data)
 {
 	long err = 0;
 	long retry = POR_RETRY_COUNT;
+	struct ti_st_plat_data	*pdata;
 	struct kim_data_s	*kim_gdata = (struct kim_data_s *)kim_data;
 
 	pr_info(" %s", __func__);
+	pdata = kim_gdata->kim_pdev->dev.platform_data;
 
 	do {
+		/* platform specific enabling code here */
+		if (pdata->chip_enable)
+			pdata->chip_enable(kim_gdata);
+
 		/* Configure BT nShutdown to HIGH state */
 		gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
 		mdelay(5);	/* FIXME: a proper toggle */
@@ -489,6 +495,8 @@ long st_kim_stop(void *kim_data)
 {
 	long err = 0;
 	struct kim_data_s	*kim_gdata = (struct kim_data_s *)kim_data;
+	struct ti_st_plat_data	*pdata =
+		kim_gdata->kim_pdev->dev.platform_data;
 
 	INIT_COMPLETION(kim_gdata->ldisc_installed);
 
@@ -515,6 +523,10 @@ long st_kim_stop(void *kim_data)
 	gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
 	mdelay(1);
 	gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
+
+	/* platform specific disable */
+	if (pdata->chip_disable)
+		pdata->chip_disable(kim_gdata);
 	return err;
 }
 
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c
index 3f24951..1ff460a 100644
--- a/drivers/misc/ti-st/st_ll.c
+++ b/drivers/misc/ti-st/st_ll.c
@@ -22,6 +22,7 @@
 #define pr_fmt(fmt) "(stll) :" fmt
 #include <linux/skbuff.h>
 #include <linux/module.h>
+#include <linux/platform_device.h>
 #include <linux/ti_wilink_st.h>
 
 /**********************************************************************/
@@ -37,6 +38,9 @@ static void send_ll_cmd(struct st_data_s *st_data,
 
 static void ll_device_want_to_sleep(struct st_data_s *st_data)
 {
+	struct kim_data_s	*kim_data;
+	struct ti_st_plat_data	*pdata;
+
 	pr_debug("%s", __func__);
 	/* sanity check */
 	if (st_data->ll_state != ST_LL_AWAKE)
@@ -46,10 +50,19 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data)
 	send_ll_cmd(st_data, LL_SLEEP_ACK);
 	/* update state */
 	st_data->ll_state = ST_LL_ASLEEP;
+
+	/* communicate to platform about chip asleep */
+	kim_data = st_data->kim_data;
+	pdata = kim_data->kim_pdev->dev.platform_data;
+	if (pdata->chip_asleep)
+		pdata->chip_asleep(NULL);
 }
 
 static void ll_device_want_to_wakeup(struct st_data_s *st_data)
 {
+	struct kim_data_s	*kim_data;
+	struct ti_st_plat_data	*pdata;
+
 	/* diff actions in diff states */
 	switch (st_data->ll_state) {
 	case ST_LL_ASLEEP:
@@ -70,6 +83,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data)
 	}
 	/* update state */
 	st_data->ll_state = ST_LL_AWAKE;
+
+	/* communicate to platform about chip wakeup */
+	kim_data = st_data->kim_data;
+	pdata = kim_data->kim_pdev->dev.platform_data;
+	if (pdata->chip_asleep)
+		pdata->chip_awake(NULL);
 }
 
 /**********************************************************************/
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read
  2011-08-09 19:38   ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
@ 2011-08-09 19:38     ` pavan_savoy
  2011-08-09 19:38       ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

After the version information has been read, the completion which assists in
wait_for_completion during the firmware send/wait sequence is being re-used
and hence this needs to be re-initialised for fool proof firmware download
retries.

Change-Id: Ia75485b83992ecbdd70cfcf15a41f551a1d86c56
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 6884dd1..e5639ca 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -210,6 +210,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
 		pr_err(" waiting for ver info- timed out ");
 		return -ETIMEDOUT;
 	}
+	INIT_COMPLETION(kim_gdata->kim_rcvd);
 
 	version =
 		MAKEWORD(kim_gdata->resp_buffer[13],
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type
  2011-08-09 19:38     ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
@ 2011-08-09 19:38       ` pavan_savoy
  2011-08-09 19:38         ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Vijay Badawadagi, Pavan Savoy

From: Vijay Badawadagi <bvijay@ti.com>

Texas Instrument's shared transport driver interpret incoming data from the
UART based on the various protocol drivers registered to the driver such as
btwilink driver or FM or GPS driver which provide logical channel IDs.

In case of bad-behavior from chip such as HCI Event response for a GPS command
or a HCI Event (h/w error event) for a FM response & In case of bad-behavior
from UART driver such as dropping data bytes a fail-safe is required to avoid
kernel panic.

Change-Id: I4a0b4b3152a27830ae85f986f5f2de922f007cd2
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Vijay Badawadagi <bvijay@ti.com>
---
 drivers/misc/ti-st/st_core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index c8e335d..1f973ce 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -338,6 +338,12 @@ void st_int_recv(void *disc_data,
 			/* Unknow packet? */
 		default:
 			type = *ptr;
+			if (st_gdata->list[type] == NULL) {
+				pr_err("chip/interface misbehavior dropping"
+					" frame starting with 0x%02x", type);
+				goto done;
+
+			}
 			st_gdata->rx_skb = alloc_skb(
 					st_gdata->list[type]->max_frame_size,
 					GFP_ATOMIC);
@@ -354,6 +360,7 @@ void st_int_recv(void *disc_data,
 		ptr++;
 		count--;
 	}
+done:
 	spin_unlock_irqrestore(&st_gdata->lock, flags);
 	pr_debug("done %s", __func__);
 	return;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/8] drivers:misc: ti-st: reinit completion before send
  2011-08-09 19:38       ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
@ 2011-08-09 19:38         ` pavan_savoy
  2011-08-09 19:38           ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

download firmware behaves differently at different times, when logs are
enabled and the system is loaded, the wait_for_completion is able to wait for
every send, However during other times the wait does not happen.

So, for reliability reinitializing the completion before every send, makes
sure the wait happens for every send.

fixes: OMAPS00245110

Change-Id: Iff96d806a06338aadad65c43c272c205660c78d1
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index e5639ca..1748a93 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -299,6 +299,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 
 		switch (((struct bts_action *)ptr)->type) {
 		case ACTION_SEND_COMMAND:	/* action send */
+			pr_debug("S");
 			action_ptr = &(((struct bts_action *)ptr)->data[0]);
 			if (unlikely
 			    (((struct hci_command *)action_ptr)->opcode ==
@@ -336,6 +337,10 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 				release_firmware(kim_gdata->fw_entry);
 				return -ETIMEDOUT;
 			}
+			/* reinit completion before sending for the
+			 * relevant wait
+			 */
+			INIT_COMPLETION(kim_gdata->kim_rcvd);
 
 			/*
 			 * Free space found in uart buffer, call st_int_write
@@ -362,6 +367,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 			}
 			break;
 		case ACTION_WAIT_EVENT:  /* wait */
+			pr_debug("W");
 			if (!wait_for_completion_timeout
 					(&kim_gdata->kim_rcvd,
 					 msecs_to_jiffies(CMD_RESP_TIME))) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail
  2011-08-09 19:38         ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
@ 2011-08-09 19:38           ` pavan_savoy
  2011-08-09 19:38             ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

When the line discipline install fails for reasons such as missing user-space
UIM or broken communication between UIM and ST driver, then the ST
attempts/retries to request for ldisc installation again.
based out of: OMAPS00246156

Change-Id: Ib1cd03ebd078bbbc2d93b68a37ba2ce1e7fa497e
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 1748a93..d8ca406 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -473,6 +473,12 @@ long st_kim_start(void *kim_data)
 			pr_info("ldisc_install = 0");
 			sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
 					NULL, "install");
+			/* the following wait is never going to be completed,
+			 * since the ldisc was never installed, hence serving
+			 * as a mdelay of LDISC_TIME msecs */
+			err = wait_for_completion_timeout
+				(&kim_gdata->ldisc_installed,
+				 msecs_to_jiffies(LDISC_TIME));
 			err = -ETIMEDOUT;
 			continue;
 		} else {
@@ -485,6 +491,13 @@ long st_kim_start(void *kim_data)
 				pr_info("ldisc_install = 0");
 				sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
 						NULL, "install");
+				/* this wait might be completed, though in the
+				 * tty_close() since the ldisc is already
+				 * installed */
+				err = wait_for_completion_timeout
+					(&kim_gdata->ldisc_installed,
+					 msecs_to_jiffies(LDISC_TIME));
+				err = -EINVAL;
 				continue;
 			} else {	/* on success don't retry */
 				break;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download
  2011-08-09 19:38           ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
@ 2011-08-09 19:38             ` pavan_savoy
  2011-08-09 19:39               ` [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:38 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

If during validation of the firmware download the data doesn't match what is
expected out of the chip, this calls for a firmware download failure and a
retry.
Free the SKB which collects response during such scenarios.

Change-Id: I78dc3bdc4ea87faa5dce7eea61371718999d3f87
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index d8ca406..3a35805 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -68,6 +68,7 @@ void validate_firmware_response(struct kim_data_s *kim_gdata)
 	if (unlikely(skb->data[5] != 0)) {
 		pr_err("no proper response during fw download");
 		pr_err("data6 %x", skb->data[5]);
+		kfree_skb(skb);
 		return;		/* keep waiting for the proper response */
 	}
 	/* becos of all the script being downloaded */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close
  2011-08-09 19:38             ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
@ 2011-08-09 19:39               ` pavan_savoy
  2011-08-09 19:39                 ` [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

If suppose the UIM were to die and hence UART were to close when the
Bluetooth/FM or GPS is turned on, prep the ST for a state where-in if
the UIM comes back up, Bluetooth/FM/GPS can be turned on.

Change-Id: If3a0f100c69d485c343e189c4a483db26961b6b7
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 1f973ce..ba168a7 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -727,6 +727,7 @@ static void st_tty_close(struct tty_struct *tty)
 		if (st_gdata->is_registered[i] == true)
 			pr_err("%d not un-registered", i);
 		st_gdata->list[i] = NULL;
+		st_gdata->is_registered[i] = false;
 	}
 	st_gdata->protos_registered = 0;
 	spin_unlock_irqrestore(&st_gdata->lock, flags);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 0/8] drivers:misc: ti-st: fixes
  2011-08-09 19:39               ` [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close pavan_savoy
@ 2011-08-09 19:39                 ` pavan_savoy
  2011-08-09 19:39                   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>


These are some of the fixes that have gone into the driver during various
testing, production validation stages.
Some are very minor and some impact performance.

Greg,
Packing more patches this time around. Please review

Pavan Savoy (7):
  drivers:misc: ti-st: avoid a misleading dbg msg
  drivers:misc:ti-st: platform hooks for chip states
  drivers:misc: ti-st: reinit completion on ver read
  drivers:misc: ti-st: reinit completion before send
  drivers:misc: ti-st: wait for completion at fail
  drivers:misc: ti-st: free skb on firmware download
  drivers:misc: ti-st: fix unexpected UART close

Vijay Badawadagi (1):
  drivers:misc: ti-st: fail-safe on wrong pkt type


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg
  2011-08-09 19:39                 ` [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
@ 2011-08-09 19:39                   ` pavan_savoy
  2011-08-09 19:39                     ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Previously the private data of each protocol registered to use ST was
used to determine whether the protocol was registered to use shared
transport or otherwise.
However, now a flag is_registered is maintained to identify whether a
protocol intends to use ST.
Upon closing of the UART the error message relevant to this lack of
un-registration was misleading and this patch fixes that.

Change-Id: I1a452dccd7b4bd53cce923df5b61ce077b7aa466
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 54c91ff..c8e335d 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -717,7 +717,7 @@ static void st_tty_close(struct tty_struct *tty)
 	 */
 	spin_lock_irqsave(&st_gdata->lock, flags);
 	for (i = ST_BT; i < ST_MAX_CHANNELS; i++) {
-		if (st_gdata->list[i] != NULL)
+		if (st_gdata->is_registered[i] == true)
 			pr_err("%d not un-registered", i);
 		st_gdata->list[i] = NULL;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states
  2011-08-09 19:39                   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
@ 2011-08-09 19:39                     ` pavan_savoy
  2011-08-09 19:39                       ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Certain platform specific or Host-WiLink Interface specific actions would be
required to be taken when the chip is being enabled and after the chip is
disabled such as configuration of the mux modes for the GPIO of host connected
to the nshutdown of the chip or relinquishing UART after the chip is disabled.

Similar actions can also be taken when the chip is in deep sleep or when the
chip is awake. Performance enhancements such as configuring the host to run
faster when chip is awake and slower when chip is asleep can also be made
here.

Change-Id: I5baad900633e69740396bf1d6900feec4f2b596e
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |   12 ++++++++++++
 drivers/misc/ti-st/st_ll.c  |   19 +++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 38fd2f0..6884dd1 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -434,11 +434,17 @@ long st_kim_start(void *kim_data)
 {
 	long err = 0;
 	long retry = POR_RETRY_COUNT;
+	struct ti_st_plat_data	*pdata;
 	struct kim_data_s	*kim_gdata = (struct kim_data_s *)kim_data;
 
 	pr_info(" %s", __func__);
+	pdata = kim_gdata->kim_pdev->dev.platform_data;
 
 	do {
+		/* platform specific enabling code here */
+		if (pdata->chip_enable)
+			pdata->chip_enable(kim_gdata);
+
 		/* Configure BT nShutdown to HIGH state */
 		gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
 		mdelay(5);	/* FIXME: a proper toggle */
@@ -489,6 +495,8 @@ long st_kim_stop(void *kim_data)
 {
 	long err = 0;
 	struct kim_data_s	*kim_gdata = (struct kim_data_s *)kim_data;
+	struct ti_st_plat_data	*pdata =
+		kim_gdata->kim_pdev->dev.platform_data;
 
 	INIT_COMPLETION(kim_gdata->ldisc_installed);
 
@@ -515,6 +523,10 @@ long st_kim_stop(void *kim_data)
 	gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
 	mdelay(1);
 	gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
+
+	/* platform specific disable */
+	if (pdata->chip_disable)
+		pdata->chip_disable(kim_gdata);
 	return err;
 }
 
diff --git a/drivers/misc/ti-st/st_ll.c b/drivers/misc/ti-st/st_ll.c
index 3f24951..1ff460a 100644
--- a/drivers/misc/ti-st/st_ll.c
+++ b/drivers/misc/ti-st/st_ll.c
@@ -22,6 +22,7 @@
 #define pr_fmt(fmt) "(stll) :" fmt
 #include <linux/skbuff.h>
 #include <linux/module.h>
+#include <linux/platform_device.h>
 #include <linux/ti_wilink_st.h>
 
 /**********************************************************************/
@@ -37,6 +38,9 @@ static void send_ll_cmd(struct st_data_s *st_data,
 
 static void ll_device_want_to_sleep(struct st_data_s *st_data)
 {
+	struct kim_data_s	*kim_data;
+	struct ti_st_plat_data	*pdata;
+
 	pr_debug("%s", __func__);
 	/* sanity check */
 	if (st_data->ll_state != ST_LL_AWAKE)
@@ -46,10 +50,19 @@ static void ll_device_want_to_sleep(struct st_data_s *st_data)
 	send_ll_cmd(st_data, LL_SLEEP_ACK);
 	/* update state */
 	st_data->ll_state = ST_LL_ASLEEP;
+
+	/* communicate to platform about chip asleep */
+	kim_data = st_data->kim_data;
+	pdata = kim_data->kim_pdev->dev.platform_data;
+	if (pdata->chip_asleep)
+		pdata->chip_asleep(NULL);
 }
 
 static void ll_device_want_to_wakeup(struct st_data_s *st_data)
 {
+	struct kim_data_s	*kim_data;
+	struct ti_st_plat_data	*pdata;
+
 	/* diff actions in diff states */
 	switch (st_data->ll_state) {
 	case ST_LL_ASLEEP:
@@ -70,6 +83,12 @@ static void ll_device_want_to_wakeup(struct st_data_s *st_data)
 	}
 	/* update state */
 	st_data->ll_state = ST_LL_AWAKE;
+
+	/* communicate to platform about chip wakeup */
+	kim_data = st_data->kim_data;
+	pdata = kim_data->kim_pdev->dev.platform_data;
+	if (pdata->chip_asleep)
+		pdata->chip_awake(NULL);
 }
 
 /**********************************************************************/
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read
  2011-08-09 19:39                     ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
@ 2011-08-09 19:39                       ` pavan_savoy
  2011-08-09 19:39                         ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

After the version information has been read, the completion which assists in
wait_for_completion during the firmware send/wait sequence is being re-used
and hence this needs to be re-initialised for fool proof firmware download
retries.

Change-Id: Ia75485b83992ecbdd70cfcf15a41f551a1d86c56
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 6884dd1..e5639ca 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -210,6 +210,7 @@ static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
 		pr_err(" waiting for ver info- timed out ");
 		return -ETIMEDOUT;
 	}
+	INIT_COMPLETION(kim_gdata->kim_rcvd);
 
 	version =
 		MAKEWORD(kim_gdata->resp_buffer[13],
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type
  2011-08-09 19:39                       ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
@ 2011-08-09 19:39                         ` pavan_savoy
  2011-08-09 19:39                           ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Vijay Badawadagi, Pavan Savoy

From: Vijay Badawadagi <bvijay@ti.com>

Texas Instrument's shared transport driver interpret incoming data from the
UART based on the various protocol drivers registered to the driver such as
btwilink driver or FM or GPS driver which provide logical channel IDs.

In case of bad-behavior from chip such as HCI Event response for a GPS command
or a HCI Event (h/w error event) for a FM response & In case of bad-behavior
from UART driver such as dropping data bytes a fail-safe is required to avoid
kernel panic.

Change-Id: I4a0b4b3152a27830ae85f986f5f2de922f007cd2
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Vijay Badawadagi <bvijay@ti.com>
---
 drivers/misc/ti-st/st_core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index c8e335d..1f973ce 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -338,6 +338,12 @@ void st_int_recv(void *disc_data,
 			/* Unknow packet? */
 		default:
 			type = *ptr;
+			if (st_gdata->list[type] == NULL) {
+				pr_err("chip/interface misbehavior dropping"
+					" frame starting with 0x%02x", type);
+				goto done;
+
+			}
 			st_gdata->rx_skb = alloc_skb(
 					st_gdata->list[type]->max_frame_size,
 					GFP_ATOMIC);
@@ -354,6 +360,7 @@ void st_int_recv(void *disc_data,
 		ptr++;
 		count--;
 	}
+done:
 	spin_unlock_irqrestore(&st_gdata->lock, flags);
 	pr_debug("done %s", __func__);
 	return;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 5/8] drivers:misc: ti-st: reinit completion before send
  2011-08-09 19:39                         ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
@ 2011-08-09 19:39                           ` pavan_savoy
  2011-08-09 19:39                             ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

download firmware behaves differently at different times, when logs are
enabled and the system is loaded, the wait_for_completion is able to wait for
every send, However during other times the wait does not happen.

So, for reliability reinitializing the completion before every send, makes
sure the wait happens for every send.

fixes: OMAPS00245110

Change-Id: Iff96d806a06338aadad65c43c272c205660c78d1
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index e5639ca..1748a93 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -299,6 +299,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 
 		switch (((struct bts_action *)ptr)->type) {
 		case ACTION_SEND_COMMAND:	/* action send */
+			pr_debug("S");
 			action_ptr = &(((struct bts_action *)ptr)->data[0]);
 			if (unlikely
 			    (((struct hci_command *)action_ptr)->opcode ==
@@ -336,6 +337,10 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 				release_firmware(kim_gdata->fw_entry);
 				return -ETIMEDOUT;
 			}
+			/* reinit completion before sending for the
+			 * relevant wait
+			 */
+			INIT_COMPLETION(kim_gdata->kim_rcvd);
 
 			/*
 			 * Free space found in uart buffer, call st_int_write
@@ -362,6 +367,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
 			}
 			break;
 		case ACTION_WAIT_EVENT:  /* wait */
+			pr_debug("W");
 			if (!wait_for_completion_timeout
 					(&kim_gdata->kim_rcvd,
 					 msecs_to_jiffies(CMD_RESP_TIME))) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail
  2011-08-09 19:39                           ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
@ 2011-08-09 19:39                             ` pavan_savoy
  2011-08-09 19:39                               ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

When the line discipline install fails for reasons such as missing user-space
UIM or broken communication between UIM and ST driver, then the ST
attempts/retries to request for ldisc installation again.
based out of: OMAPS00246156

Change-Id: Ib1cd03ebd078bbbc2d93b68a37ba2ce1e7fa497e
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index 1748a93..d8ca406 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -473,6 +473,12 @@ long st_kim_start(void *kim_data)
 			pr_info("ldisc_install = 0");
 			sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
 					NULL, "install");
+			/* the following wait is never going to be completed,
+			 * since the ldisc was never installed, hence serving
+			 * as a mdelay of LDISC_TIME msecs */
+			err = wait_for_completion_timeout
+				(&kim_gdata->ldisc_installed,
+				 msecs_to_jiffies(LDISC_TIME));
 			err = -ETIMEDOUT;
 			continue;
 		} else {
@@ -485,6 +491,13 @@ long st_kim_start(void *kim_data)
 				pr_info("ldisc_install = 0");
 				sysfs_notify(&kim_gdata->kim_pdev->dev.kobj,
 						NULL, "install");
+				/* this wait might be completed, though in the
+				 * tty_close() since the ldisc is already
+				 * installed */
+				err = wait_for_completion_timeout
+					(&kim_gdata->ldisc_installed,
+					 msecs_to_jiffies(LDISC_TIME));
+				err = -EINVAL;
 				continue;
 			} else {	/* on success don't retry */
 				break;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download
  2011-08-09 19:39                             ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
@ 2011-08-09 19:39                               ` pavan_savoy
  2011-08-09 19:39                                 ` [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close pavan_savoy
  0 siblings, 1 reply; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

If during validation of the firmware download the data doesn't match what is
expected out of the chip, this calls for a firmware download failure and a
retry.
Free the SKB which collects response during such scenarios.

Change-Id: I78dc3bdc4ea87faa5dce7eea61371718999d3f87
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_kim.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_kim.c b/drivers/misc/ti-st/st_kim.c
index d8ca406..3a35805 100644
--- a/drivers/misc/ti-st/st_kim.c
+++ b/drivers/misc/ti-st/st_kim.c
@@ -68,6 +68,7 @@ void validate_firmware_response(struct kim_data_s *kim_gdata)
 	if (unlikely(skb->data[5] != 0)) {
 		pr_err("no proper response during fw download");
 		pr_err("data6 %x", skb->data[5]);
+		kfree_skb(skb);
 		return;		/* keep waiting for the proper response */
 	}
 	/* becos of all the script being downloaded */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close
  2011-08-09 19:39                               ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
@ 2011-08-09 19:39                                 ` pavan_savoy
  0 siblings, 0 replies; 22+ messages in thread
From: pavan_savoy @ 2011-08-09 19:39 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

If suppose the UIM were to die and hence UART were to close when the
Bluetooth/FM or GPS is turned on, prep the ST for a state where-in if
the UIM comes back up, Bluetooth/FM/GPS can be turned on.

Change-Id: If3a0f100c69d485c343e189c4a483db26961b6b7
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 1f973ce..ba168a7 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -727,6 +727,7 @@ static void st_tty_close(struct tty_struct *tty)
 		if (st_gdata->is_registered[i] == true)
 			pr_err("%d not un-registered", i);
 		st_gdata->list[i] = NULL;
+		st_gdata->is_registered[i] = false;
 	}
 	st_gdata->protos_registered = 0;
 	spin_unlock_irqrestore(&st_gdata->lock, flags);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg
  2011-08-09 19:38 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
  2011-08-09 19:38   ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
@ 2011-08-09 20:30   ` Greg KH
  1 sibling, 0 replies; 22+ messages in thread
From: Greg KH @ 2011-08-09 20:30 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-kernel, pavan_savoy

On Tue, Aug 09, 2011 at 02:38:53PM -0500, pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Previously the private data of each protocol registered to use ST was
> used to determine whether the protocol was registered to use shared
> transport or otherwise.
> However, now a flag is_registered is maintained to identify whether a
> protocol intends to use ST.
> Upon closing of the UART the error message relevant to this lack of
> un-registration was misleading and this patch fixes that.
> 
> Change-Id: I1a452dccd7b4bd53cce923df5b61ce077b7aa466

What is this field for?  It's pretty irrelevant for upstream kernel
work, right?

Please remove.

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 0/8] drivers:misc: ti-st: fixes
  2011-08-09 19:38 [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
  2011-08-09 19:38 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
@ 2011-08-09 20:31 ` Greg KH
  2011-08-10  2:54   ` Pavan Savoy
  1 sibling, 1 reply; 22+ messages in thread
From: Greg KH @ 2011-08-09 20:31 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-kernel, pavan_savoy

On Tue, Aug 09, 2011 at 02:38:52PM -0500, pavan_savoy@ti.com wrote:
> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> 
> These are some of the fixes that have gone into the driver during various
> testing, production validation stages.
> Some are very minor and some impact performance.
> 
> Greg,
> Packing more patches this time around. Please review

You sent 2 series of this, why?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 0/8] drivers:misc: ti-st: fixes
  2011-08-09 20:31 ` [PATCH 0/8] drivers:misc: ti-st: fixes Greg KH
@ 2011-08-10  2:54   ` Pavan Savoy
  0 siblings, 0 replies; 22+ messages in thread
From: Pavan Savoy @ 2011-08-10  2:54 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Tue, Aug 9, 2011 at 3:31 PM, Greg KH <gregkh@suse.de> wrote:
> On Tue, Aug 09, 2011 at 02:38:52PM -0500, pavan_savoy@ti.com wrote:
>> From: Pavan Savoy <pavan_savoy@ti.com>
>>
>>
>> These are some of the fixes that have gone into the driver during various
>> testing, production validation stages.
>> Some are very minor and some impact performance.
>>
>> Greg,
>> Packing more patches this time around. Please review
>
> You sent 2 series of this, why?

It's a series of 8 patches, I'm also wondering what happened here &
why it showed up twice...
Also will remove the Change-Id commit message hooks from another
project  & resend ...

Thanks & Regards,
Pavan Savoy


> confused,
>
> greg k-h
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg
  2011-08-10 15:18 pavan_savoy
@ 2011-08-10 15:18 ` pavan_savoy
  0 siblings, 0 replies; 22+ messages in thread
From: pavan_savoy @ 2011-08-10 15:18 UTC (permalink / raw)
  To: gregkh, linux-kernel; +Cc: pavan_savoy, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Previously the private data of each protocol registered to use ST was
used to determine whether the protocol was registered to use shared
transport or otherwise.
However, now a flag is_registered is maintained to identify whether a
protocol intends to use ST.
Upon closing of the UART the error message relevant to this lack of
un-registration was misleading and this patch fixes that.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/misc/ti-st/st_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 54c91ff..c8e335d 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -717,7 +717,7 @@ static void st_tty_close(struct tty_struct *tty)
 	 */
 	spin_lock_irqsave(&st_gdata->lock, flags);
 	for (i = ST_BT; i < ST_MAX_CHANNELS; i++) {
-		if (st_gdata->list[i] != NULL)
+		if (st_gdata->is_registered[i] == true)
 			pr_err("%d not un-registered", i);
 		st_gdata->list[i] = NULL;
 	}
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2011-08-10 15:18 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-09 19:38 [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
2011-08-09 19:38 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
2011-08-09 19:38   ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
2011-08-09 19:38     ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
2011-08-09 19:38       ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
2011-08-09 19:38         ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
2011-08-09 19:38           ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
2011-08-09 19:38             ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
2011-08-09 19:39               ` [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close pavan_savoy
2011-08-09 19:39                 ` [PATCH 0/8] drivers:misc: ti-st: fixes pavan_savoy
2011-08-09 19:39                   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy
2011-08-09 19:39                     ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
2011-08-09 19:39                       ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
2011-08-09 19:39                         ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
2011-08-09 19:39                           ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy
2011-08-09 19:39                             ` [PATCH 6/8] drivers:misc: ti-st: wait for completion at fail pavan_savoy
2011-08-09 19:39                               ` [PATCH 7/8] drivers:misc: ti-st: free skb on firmware download pavan_savoy
2011-08-09 19:39                                 ` [PATCH 8/8] drivers:misc: ti-st: fix unexpected UART close pavan_savoy
2011-08-09 20:30   ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg Greg KH
2011-08-09 20:31 ` [PATCH 0/8] drivers:misc: ti-st: fixes Greg KH
2011-08-10  2:54   ` Pavan Savoy
  -- strict thread matches above, loose matches on Subject: below --
2011-08-10 15:18 pavan_savoy
2011-08-10 15:18 ` [PATCH 1/8] drivers:misc: ti-st: avoid a misleading dbg msg pavan_savoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox