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

Commit 9de5ec1c authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal
Browse files

msm: vidc: Use sid to create instance debugfs directory



Currently, instance pointer value is used to create an instance debugfs
name. Using instance pointer causes multiple instances to have the same
debugfs name when kptr restriction is applied. Use instance sid instead
of pointer value to create a unique debugfs name during concurrencies.
Also, use %pK instead of %p in other places.

Change-Id: I098f641e9a548bcb8bf6d939422607cdc194adb3
Signed-off-by: default avatarMihir Ganu <mganu@codeaurora.org>
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent 1eac758b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1035,7 +1035,7 @@ int msm_comm_scale_clocks_and_bus(struct msm_vidc_inst *inst, bool do_bw_calc)
int msm_dcvs_try_enable(struct msm_vidc_inst *inst)
{
	if (!inst || !inst->core) {
		d_vpr_e("%s: Invalid args: %p\n", __func__, inst);
		d_vpr_e("%s: Invalid args: %pK\n", __func__, inst);
		return -EINVAL;
	}

+3 −3
Original line number Diff line number Diff line
@@ -479,7 +479,7 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst,
		d_vpr_e("%s: invalid params\n", __func__);
		goto exit;
	}
	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "inst_%p", inst);
	snprintf(debugfs_name, MAX_DEBUGFS_NAME, "inst_%d", inst->sid);

	idata = kzalloc(sizeof(struct core_inst_pair), GFP_KERNEL);
	if (!idata) {
@@ -491,14 +491,14 @@ struct dentry *msm_vidc_debugfs_init_inst(struct msm_vidc_inst *inst,
	idata->inst = inst;

	dir = debugfs_create_dir(debugfs_name, parent);
	if (!dir) {
	if (IS_ERR_OR_NULL(dir)) {
		s_vpr_e(inst->sid, "Failed to create debugfs for msm_vidc\n");
		goto failed_create_dir;
	}

	info = debugfs_create_file("info", 0444, dir,
			idata, &inst_info_fops);
	if (!info) {
	if (IS_ERR_OR_NULL(info)) {
		s_vpr_e(inst->sid, "debugfs_create_file: fail\n");
		goto failed_create_file;
	}