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>
}
dev_dbg(dev, "Registered to IRQ: %d\n", new_drvdata->irq);
+ init_completion(&new_drvdata->hw_queue_avail);
+
if (!plat_dev->dev.dma_mask)
plat_dev->dev.dma_mask = &plat_dev->dev.coherent_dma_mask;
int irq;
u32 irq_mask;
u32 fw_ver;
+ struct completion hw_queue_avail; /* wait for HW queue availability */
struct platform_device *plat_dev;
ssi_sram_addr_t mlli_sram_addr;
void *buff_mgr_handle;
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
{
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);