Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46cebc90 authored by Srinu Gorle's avatar Srinu Gorle Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: pm qos stability fixes for video driver



Stability issues are observed, if pm qos request removes without adding it.
Check pm qos request status before remove it.
The default request type PM_QOS_REQ_ALL_CORES is applicable to
all CPU cores that are online and would have a power impact when there are
more number of CPUs. Specify a request type as PM_QOS_REQ_AFFINE_IRQ.

CRs-Fixed: 995426
Change-Id: I738f201ed126c6be4076c582c37999362e1d0e88
Signed-off-by: default avatarSrinu Gorle <sgorle@codeaurora.org>
parent 25f64653
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -2211,9 +2211,14 @@ static int venus_hfi_core_init(void *device)
	if (rc || __iface_cmdq_write(dev, &version_pkt))
		dprintk(VIDC_WARN, "Failed to send image version pkt to f/w\n");

	if (dev->res->pm_qos_latency_us)
	if (dev->res->pm_qos_latency_us) {
#ifdef CONFIG_SMP
		dev->qos.type = PM_QOS_REQ_AFFINE_IRQ;
		dev->qos.irq = dev->hal_data->irq;
#endif
		pm_qos_add_request(&dev->qos, PM_QOS_CPU_DMA_LATENCY,
				dev->res->pm_qos_latency_us);
	}

	mutex_unlock(&dev->lock);
	return rc;
@@ -2237,7 +2242,8 @@ static int venus_hfi_core_release(void *dev)

	mutex_lock(&device->lock);

	if (device->res->pm_qos_latency_us)
	if (device->res->pm_qos_latency_us &&
		pm_qos_request_active(&device->qos))
		pm_qos_remove_request(&device->qos);
	__set_state(device, VENUS_STATE_DEINIT);
	__unload_fw(device);
@@ -4201,7 +4207,8 @@ static inline int __suspend(struct venus_hfi_device *device)

	dprintk(VIDC_DBG, "Entering power collapse\n");

	if (device->res->pm_qos_latency_us)
	if (device->res->pm_qos_latency_us &&
		pm_qos_request_active(&device->qos))
		pm_qos_remove_request(&device->qos);

	rc = __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND);
@@ -4263,9 +4270,14 @@ static inline int __resume(struct venus_hfi_device *device)
	 */
	__set_threshold_registers(device);

	if (device->res->pm_qos_latency_us)
	if (device->res->pm_qos_latency_us) {
#ifdef CONFIG_SMP
		device->qos.type = PM_QOS_REQ_AFFINE_IRQ;
		device->qos.irq = device->hal_data->irq;
#endif
		pm_qos_add_request(&device->qos, PM_QOS_CPU_DMA_LATENCY,
				device->res->pm_qos_latency_us);
	}
	dprintk(VIDC_INFO, "Resumed from power collapse\n");
exit:
	device->skip_pc_count = 0;