summaryrefslogtreecommitdiff
path: root/drivers/staging/ccree/ssi_request_mgr.c
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2017-11-13 17:45:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-27 11:20:40 +0300
commitd59c6d9cee8c8c66a0fe67e025a32266cc963e16 (patch)
tree720d87d7e64e8ad39366ec134ef7e581187ecba3 /drivers/staging/ccree/ssi_request_mgr.c
parent5a83a3937bb06c46a67a05dbc4ddbd433ed11a7c (diff)
downloadlinux-d59c6d9cee8c8c66a0fe67e025a32266cc963e16.tar.xz
staging: ccree: replace msleep with a completion
When the driver would try to queue commands to the HW FIFO but ran out of slots it would use msleep as a delay until the FIFO would clear. This is messy and not accurate. Replace the msleep with a proper completion on the event of command completion which should indicate at least one slot is free. Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ccree/ssi_request_mgr.c')
-rw-r--r--drivers/staging/ccree/ssi_request_mgr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/ccree/ssi_request_mgr.c b/drivers/staging/ccree/ssi_request_mgr.c
index a2a82ef9e143..0882efd208ab 100644
--- a/drivers/staging/ccree/ssi_request_mgr.c
+++ b/drivers/staging/ccree/ssi_request_mgr.c
@@ -312,8 +312,9 @@ int send_request(
return rc;
}
- /* HW queue is full - short sleep */
- msleep(1);
+ /* HW queue is full - wait for it to clear up */
+ wait_for_completion_interruptible(&drvdata->hw_queue_avail);
+ reinit_completion(&drvdata->hw_queue_avail);
} while (1);
/* Additional completion descriptor is needed incase caller did not
@@ -452,6 +453,8 @@ void complete_request(struct ssi_drvdata *drvdata)
{
struct ssi_request_mgr_handle *request_mgr_handle =
drvdata->request_mgr_handle;
+
+ complete(&drvdata->hw_queue_avail);
#ifdef COMP_IN_WQ
queue_delayed_work(request_mgr_handle->workq,
&request_mgr_handle->compwork, 0);