mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <pavan_savoy@ti.com>
To: <gregkh@suse.de>, <linux-kernel@vger.kernel.org>
Cc: <pavan_savoy@sify.com>, Pavan Savoy <pavan_savoy@ti.com>
Subject: [PATCH 5/8] drivers:misc: ti-st: reinit completion before send
Date: Tue, 9 Aug 2011 14:38:57 -0500	[thread overview]
Message-ID: <1312918749-29627-6-git-send-email-pavan_savoy@ti.com> (raw)
In-Reply-To: <1312918749-29627-5-git-send-email-pavan_savoy@ti.com>

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


  reply	other threads:[~2011-08-09 19:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` pavan_savoy [this message]
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
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
2011-08-10 15:18   ` [PATCH 2/8] drivers:misc:ti-st: platform hooks for chip states pavan_savoy
2011-08-10 15:18     ` [PATCH 3/8] drivers:misc: ti-st: reinit completion on ver read pavan_savoy
2011-08-10 15:18       ` [PATCH 4/8] drivers:misc: ti-st: fail-safe on wrong pkt type pavan_savoy
2011-08-10 15:18         ` [PATCH 5/8] drivers:misc: ti-st: reinit completion before send pavan_savoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312918749-29627-6-git-send-email-pavan_savoy@ti.com \
    --to=pavan_savoy@ti.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavan_savoy@sify.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®