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

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

Merge "msm: ipa: fix IPA driver processing context delete logic"

parents 7c87b109 694e664b
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -645,6 +645,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
	return 0;

bad_len:
	if (add_ref_hdr)
		hdr_entry->ref_cnt--;
	entry->cookie = 0;
	kmem_cache_free(ipa_ctx->hdr_proc_ctx_cache, entry);
@@ -825,7 +826,7 @@ static int __ipa_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr)
	}

	if (release_hdr)
		__ipa_release_hdr(entry->hdr->id);
		__ipa_del_hdr(entry->hdr->id);

	/* move the offset entry to appropriate free list */
	list_move(&entry->offset_entry->link,
@@ -1153,12 +1154,19 @@ int ipa2_reset_hdr(void)
			&ipa_ctx->hdr_tbl.head_hdr_entry_list, link) {

		/* do not remove the default header */
		if (!strcmp(entry->name, IPA_LAN_RX_HDR_NAME))
		if (!strcmp(entry->name, IPA_LAN_RX_HDR_NAME)) {
			if (entry->is_hdr_proc_ctx) {
				mutex_unlock(&ipa_ctx->lock);
				WARN_ON(1);
				IPAERR("default header is proc ctx\n");
				return -EFAULT;
			}
			continue;
		}

		if (ipa_id_find(entry->id) == NULL) {
			WARN_ON(1);
			mutex_unlock(&ipa_ctx->lock);
			WARN_ON(1);
			return -EFAULT;
		}
		if (entry->is_hdr_proc_ctx) {
@@ -1211,8 +1219,8 @@ int ipa2_reset_hdr(void)
		link) {

		if (ipa_id_find(ctx_entry->id) == NULL) {
			WARN_ON(1);
			mutex_unlock(&ipa_ctx->lock);
			WARN_ON(1);
			return -EFAULT;
		}
		list_del(&ctx_entry->link);
@@ -1375,8 +1383,8 @@ int ipa2_put_hdr(u32 hdr_hdl)
		goto bail;
	}

	if (entry == NULL || entry->cookie != IPA_COOKIE) {
		IPAERR("bad params\n");
	if (entry->cookie != IPA_COOKIE) {
		IPAERR("invalid header entry\n");
		result = -EINVAL;
		goto bail;
	}
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ struct ipa_rt_tbl {
 * @is_partial: flag indicating if header table entry is partial
 * @is_hdr_proc_ctx: false - hdr entry resides in hdr table,
 * true - hdr entry resides in DDR and pointed to by proc ctx
 * @phys_base: physical address of entry in SRAM when is_hdr_proc_ctx is true,
 * @phys_base: physical address of entry in DDR when is_hdr_proc_ctx is true,
 * else 0
 * @proc_ctx: processing context header
 * @offset_entry: entry's offset
+4 −0
Original line number Diff line number Diff line
@@ -1029,6 +1029,10 @@ static int __ipa_add_rt_rule(enum ipa_ip_type ip, const char *name,
	return 0;

ipa_insert_failed:
	if (entry->hdr)
		entry->hdr->ref_cnt--;
	else if (entry->proc_ctx)
		entry->proc_ctx->ref_cnt--;
	list_del(&entry->link);
	kmem_cache_free(ipa_ctx->rt_rule_cache, entry);
error:
+15 −7
Original line number Diff line number Diff line
@@ -415,6 +415,7 @@ static int __ipa_add_hdr_proc_ctx(struct ipa_hdr_proc_ctx_add *proc_ctx,
	return 0;

bad_len:
	if (add_ref_hdr)
		hdr_entry->ref_cnt--;
	entry->cookie = 0;
	kmem_cache_free(ipa3_ctx->hdr_proc_ctx_cache, entry);
@@ -586,7 +587,7 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl, bool release_hdr)
	}

	if (release_hdr)
		__ipa3_release_hdr(entry->hdr->id);
		__ipa3_del_hdr(entry->hdr->id);

	/* move the offset entry to appropriate free list */
	list_move(&entry->offset_entry->link,
@@ -890,12 +891,19 @@ int ipa3_reset_hdr(void)
			&ipa3_ctx->hdr_tbl.head_hdr_entry_list, link) {

		/* do not remove the default header */
		if (!strcmp(entry->name, IPA_LAN_RX_HDR_NAME))
		if (!strcmp(entry->name, IPA_LAN_RX_HDR_NAME)) {
			if (entry->is_hdr_proc_ctx) {
				IPAERR("default header is proc ctx\n");
				mutex_unlock(&ipa3_ctx->lock);
				WARN_ON(1);
				return -EFAULT;
			}
			continue;
		}

		if (ipa3_id_find(entry->id) == NULL) {
			WARN_ON(1);
			mutex_unlock(&ipa3_ctx->lock);
			WARN_ON(1);
			return -EFAULT;
		}
		if (entry->is_hdr_proc_ctx) {
@@ -948,8 +956,8 @@ int ipa3_reset_hdr(void)
		link) {

		if (ipa3_id_find(ctx_entry->id) == NULL) {
			WARN_ON(1);
			mutex_unlock(&ipa3_ctx->lock);
			WARN_ON(1);
			return -EFAULT;
		}
		list_del(&ctx_entry->link);
@@ -1112,8 +1120,8 @@ int ipa3_put_hdr(u32 hdr_hdl)
		goto bail;
	}

	if (entry == NULL || entry->cookie != IPA_COOKIE) {
		IPAERR("bad params\n");
	if (entry->cookie != IPA_COOKIE) {
		IPAERR("invalid header entry\n");
		result = -EINVAL;
		goto bail;
	}
+1 −1
Original line number Diff line number Diff line
@@ -307,7 +307,7 @@ struct ipa3_rt_tbl {
 * @is_partial: flag indicating if header table entry is partial
 * @is_hdr_proc_ctx: false - hdr entry resides in hdr table,
 * true - hdr entry resides in DDR and pointed to by proc ctx
 * @phys_base: physical address of entry in SRAM when is_hdr_proc_ctx is true,
 * @phys_base: physical address of entry in DDR when is_hdr_proc_ctx is true,
 * else 0
 * @proc_ctx: processing context header
 * @offset_entry: entry's offset
Loading