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

Commit 8163b477 authored by Vikash Garodia's avatar Vikash Garodia
Browse files

msm: vidc: ensure venus clocks are enabled while release buffer



While interframe clock gating, venus clock are gated ON and
OFF based on firmware response. It may happen that venus
clocks are disabled while iommu driver unmaps output buffers.
This may lead to unclocked memory access.
Venus clocks should be enabled while releasing output buffers.

Change-Id: Ib7a04c2d3600ae91a229730e2caffbff9c8353ca
CRs-Fixed: 645657
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent e3727e00
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1401,11 +1401,21 @@ static int venus_hfi_power_enable(void *dev)
		dprintk(VIDC_ERR, "Invalid params: %p\n", device);
		return -EINVAL;
	}

	mutex_lock(&device->clk_pwr_lock);
	if (!device->power_enabled)
	if (!device->power_enabled) {
		rc = venus_hfi_power_on(device);
	mutex_unlock(&device->clk_pwr_lock);
		if (rc) {
			dprintk(VIDC_ERR, "Failed venus power on");
			goto fail_power_on;
		}
	}
	rc = venus_hfi_clk_gating_off(device);
	if (rc)
		dprintk(VIDC_ERR, "%s : Clock enable failed\n", __func__);

fail_power_on:
	mutex_unlock(&device->clk_pwr_lock);
	return rc;
}