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

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

Merge "msm: ipa3: add lock for num_q6_rule"

parents d00ae8d9 557e64b1
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -538,6 +538,8 @@ int ipa3_copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01
{
	int i;

	/* prevent multi-threads accessing rmnet_ipa3_ctx->num_q6_rules */
	mutex_lock(&rmnet_ipa3_ctx->add_mux_channel_lock);
	if (rule_req->filter_spec_ex_list_valid == true) {
		rmnet_ipa3_ctx->num_q6_rules =
			rule_req->filter_spec_ex_list_len;
@@ -546,6 +548,7 @@ int ipa3_copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01
	} else {
		rmnet_ipa3_ctx->num_q6_rules = 0;
		IPAWANERR("got no UL rules from modem\n");
		mutex_unlock(&rmnet_ipa3_ctx->add_mux_channel_lock);
		return -EINVAL;
	}

@@ -597,9 +600,11 @@ int ipa3_copy_ul_filter_rule_to_ipa(struct ipa_install_fltr_rule_req_msg_v01
	rmnet_ipa3_ctx->num_q6_rules = 0;
	memset(ipa3_qmi_ctx->q6_ul_filter_rule, 0,
		sizeof(ipa3_qmi_ctx->q6_ul_filter_rule));
	mutex_unlock(&rmnet_ipa3_ctx->add_mux_channel_lock);
	return -EINVAL;

success:
	mutex_unlock(&rmnet_ipa3_ctx->add_mux_channel_lock);
	return 0;
}

@@ -1393,8 +1398,12 @@ static int handle3_egress_format(struct net_device *dev,

	if (rmnet_ipa3_ctx->num_q6_rules != 0) {
		/* already got Q6 UL filter rules*/
		if (ipa3_qmi_ctx->modem_cfg_emb_pipe_flt == false)
		if (ipa3_qmi_ctx->modem_cfg_emb_pipe_flt == false) {
			/* prevent multi-threads accessing num_q6_rules */
			mutex_lock(&rmnet_ipa3_ctx->add_mux_channel_lock);
			rc = ipa3_wwan_add_ul_flt_rule_to_ipa();
			mutex_unlock(&rmnet_ipa3_ctx->add_mux_channel_lock);
		}
		if (rc)
			IPAWANERR("install UL rules failed\n");
		else