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

Commit 3fb9747e authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: fix a race condition in OCMEM free function"

parents 1e8ab90d d06a77ac
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -2323,8 +2323,9 @@ static int venus_hfi_core_release(void *device)
				"%s: Power enable failed\n", __func__);
			return -EIO;
		}

		mutex_lock(&dev->resource_lock);
		rc = __unset_free_ocmem(dev);
		mutex_unlock(&dev->resource_lock);
		if (rc)
			dprintk(VIDC_ERR,
					"Failed to unset and free OCMEM in core release, rc : %d\n",
@@ -3070,7 +3071,9 @@ static void venus_hfi_pm_hndlr(struct work_struct *work)

	dprintk(VIDC_DBG, "Prepare for power collapse\n");

	mutex_lock(&device->resource_lock);
	rc = __unset_free_ocmem(device);
	mutex_unlock(&device->resource_lock);
	if (rc) {
		dprintk(VIDC_ERR,
			"Failed to unset and free OCMEM for PC, rc : %d\n", rc);
@@ -4225,6 +4228,7 @@ static void *venus_hfi_add_device(u32 device_id,
	mutex_init(&hdevice->read_lock);
	mutex_init(&hdevice->write_lock);
	mutex_init(&hdevice->session_lock);
	mutex_init(&hdevice->resource_lock);

	if (hal_ctxt.dev_count == 0)
		INIT_LIST_HEAD(&hal_ctxt.dev_head);
+1 −1
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ struct venus_hfi_device {
	bool power_enabled;
	struct mutex read_lock;
	struct mutex write_lock;
	struct mutex clk_pwr_lock;
	struct mutex resource_lock;
	struct mutex session_lock;
	msm_vidc_callback callback;
	struct vidc_mem_addr iface_q_table;