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

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

Merge "gpu: ion: Skip wrong usage check for secure buffers"

parents 65783c6a 6d88d827
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -492,7 +492,7 @@ static int ion_secure_cma_allocate(struct ion_heap *heap,
	if (buf) {
	if (buf) {
		int ret;
		int ret;


		ret = msm_ion_secure_table(buf->table, 0, 0, true);
		ret = msm_ion_secure_table(buf->table, 0, 0);
		if (ret) {
		if (ret) {
			/*
			/*
			 * Don't treat the secure buffer failing here as an
			 * Don't treat the secure buffer failing here as an
+2 −2
Original line number Original line Diff line number Diff line
@@ -75,7 +75,7 @@ int ion_cp_secure_buffer(struct ion_buffer *buffer, int version, void *data,
int ion_cp_unsecure_buffer(struct ion_buffer *buffer, int force_unsecure);
int ion_cp_unsecure_buffer(struct ion_buffer *buffer, int force_unsecure);


int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
			int flags, bool skip_usage);
			int flags);


int msm_ion_unsecure_table(struct sg_table *table);
int msm_ion_unsecure_table(struct sg_table *table);


@@ -114,7 +114,7 @@ static inline int ion_cp_unsecure_buffer(struct ion_buffer *buffer,
}
}


int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
			int flags, bool skip_usage)
			int flags)
{
{
	return -ENODEV;
	return -ENODEV;
}
}
+2 −11
Original line number Original line Diff line number Diff line
@@ -175,7 +175,7 @@ static int secure_buffer_change_table(struct sg_table *table,
}
}


int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
			int flags, bool skip_usage_check)
			int flags)
{
{
	struct secure_meta *meta;
	struct secure_meta *meta;
	int ret;
	int ret;
@@ -184,15 +184,6 @@ int msm_ion_secure_table(struct sg_table *table, enum cp_mem_usage usage,
	meta = secure_meta_lookup(table);
	meta = secure_meta_lookup(table);


	if (meta) {
	if (meta) {
		if (meta->usage != usage && !skip_usage_check) {
			pr_err("%s: Trying to re-secure buffer with different values",
				__func__);
			pr_err("Last secured usage: %d current %d\n",
				meta->usage, usage);
			ret = -EINVAL;
			goto out;
		}

		kref_get(&meta->ref);
		kref_get(&meta->ref);
		ret = 0;
		ret = 0;
	} else {
	} else {
@@ -233,7 +224,7 @@ int msm_ion_secure_buffer(struct ion_client *client, struct ion_handle *handle,
		goto out;
		goto out;
	}
	}


	ret = msm_ion_secure_table(table, usage, flags, false);
	ret = msm_ion_secure_table(table, usage, flags);
out:
out:
	return ret;
	return ret;
}
}