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

Commit a9a33b34 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ipa3: resolve the bw voting big value issue"

parents 877d5bce 05eaebf2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1418,6 +1418,8 @@ struct ipa3_uc_ctx {
	u32 ering_rp_local;
	u32 ering_wp;
	u32 ering_rp;
	struct ipa_wdi_bw_info info;
	uint64_t bw_info_max;
};

/**
+26 −10
Original line number Diff line number Diff line
@@ -362,16 +362,21 @@ static void ipa3_event_ring_hdlr(void)
			e_b->Protocol,
			e_b->Value.bw_param.ThresholdIndex,
			e_b->Value.bw_param.throughput);

			memset(&bw_info, 0, sizeof(struct ipa_inform_wlan_bw));
			/* check values */
			mul = 1000 * IPA_UC_MON_INTERVAL;
			if (e_b->Value.bw_param.throughput <
				ipa3_ctx->uc_ctx.bw_info_max*mul) {
				memset(&bw_info, 0,
					sizeof(struct ipa_inform_wlan_bw));
				bw_info.index =
					e_b->Value.bw_param.ThresholdIndex;
				mul = 1000 / IPA_UC_MON_INTERVAL;
				bw_info.throughput =
					e_b->Value.bw_param.throughput*mul;
				if (ipa3_inform_wlan_bw(&bw_info))
				IPAERR_RL("failed on index %d to wlan\n",
					IPAERR_RL("failed index %d to wlan\n",
					bw_info.index);
			}
		} else if (((struct eventElement_t *) rp_va)->Opcode
			== QUOTA_NOTIFY) {
			e_q = ((struct eventElement_t *) rp_va);
@@ -1353,10 +1358,21 @@ int ipa3_uc_bw_monitor(struct ipa_wdi_bw_info *info)
	bw_info->params.WdiBw.Stop = info->stop;
	IPADBG("stop bw-monitor? %d\n", bw_info->params.WdiBw.Stop);

	/* cache the bw info */
	ipa3_ctx->uc_ctx.info.num = info->num;
	ipa3_ctx->uc_ctx.info.stop = info->stop;
	ipa3_ctx->uc_ctx.bw_info_max = 0;

	for (i = 0; i < info->num; i++) {
		bw_info->params.WdiBw.BwThreshold[i] = info->threshold[i];
		IPADBG("%d-st, %lu\n", i, bw_info->params.WdiBw.BwThreshold[i]);
		ipa3_ctx->uc_ctx.info.threshold[i] = info->threshold[i];
		if (info->threshold[i] > ipa3_ctx->uc_ctx.bw_info_max)
			ipa3_ctx->uc_ctx.bw_info_max = info->threshold[i];
	}
	/* set max to both UL+DL */
	ipa3_ctx->uc_ctx.bw_info_max *= 2;
	IPADBG("bw-monitor max %lu\n", ipa3_ctx->uc_ctx.bw_info_max);

	bw_info->params.WdiBw.info.Num = 8;
	ind = ipa3_ctx->fnr_info.hw_counter_offset +