msm: vidc: Flush the workqueue before shutting down clocks

Make sure that there is no pending work in work queue before
shutting down clocks. This ensures that all the interrupts
received from firmware have been take care. Workqueue is
flushed after the interrupt line is disabled.

CRs-Fixed: 476653
CRs-Fixed: 476275
CRs-Fixed: 475527
CRs-Fixed: 473829
CRs-Fixed: 477795

Change-Id: I8210b01c1f7d3a1616b69d5f8ff5766d740b48dc
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
diff --git a/drivers/media/platform/msm/vidc/venus_hfi.c b/drivers/media/platform/msm/vidc/venus_hfi.c
index 8031c74..66c3408 100644
--- a/drivers/media/platform/msm/vidc/venus_hfi.c
+++ b/drivers/media/platform/msm/vidc/venus_hfi.c
@@ -2749,6 +2749,7 @@
 		return;
 	}
 	if (device->resources.fw.cookie) {
+		flush_workqueue(device->vidc_workq);
 		venus_hfi_disable_clks(device);
 		venus_hfi_iommu_detach(device);
 		subsystem_put(device->resources.fw.cookie);