Commit 2f81a02c authored by Pavan Savoy's avatar Pavan Savoy Committed by Greg Kroah-Hartman

drivers:misc: ti-st: reinit completion before send

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.
Signed-off-by: default avatarPavan Savoy <pavan_savoy@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 78bb9697
...@@ -299,6 +299,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -299,6 +299,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
switch (((struct bts_action *)ptr)->type) { switch (((struct bts_action *)ptr)->type) {
case ACTION_SEND_COMMAND: /* action send */ case ACTION_SEND_COMMAND: /* action send */
pr_debug("S");
action_ptr = &(((struct bts_action *)ptr)->data[0]); action_ptr = &(((struct bts_action *)ptr)->data[0]);
if (unlikely if (unlikely
(((struct hci_command *)action_ptr)->opcode == (((struct hci_command *)action_ptr)->opcode ==
...@@ -336,6 +337,10 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -336,6 +337,10 @@ static long download_firmware(struct kim_data_s *kim_gdata)
release_firmware(kim_gdata->fw_entry); release_firmware(kim_gdata->fw_entry);
return -ETIMEDOUT; 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 * Free space found in uart buffer, call st_int_write
...@@ -362,6 +367,7 @@ static long download_firmware(struct kim_data_s *kim_gdata) ...@@ -362,6 +367,7 @@ static long download_firmware(struct kim_data_s *kim_gdata)
} }
break; break;
case ACTION_WAIT_EVENT: /* wait */ case ACTION_WAIT_EVENT: /* wait */
pr_debug("W");
if (!wait_for_completion_timeout if (!wait_for_completion_timeout
(&kim_gdata->kim_rcvd, (&kim_gdata->kim_rcvd,
msecs_to_jiffies(CMD_RESP_TIME))) { msecs_to_jiffies(CMD_RESP_TIME))) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment