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

Commit e30ed885 authored by Bojun Pan's avatar Bojun Pan Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa4: capture the unclock gsi IPA register access



Add more protect on the unclock gsi IPA register access.
In case this is a valid access, assert before disabling
the IPA clock.

Change-Id: If2cc5a9942a5e457bbd8badaabde78138f676176
Signed-off-by: default avatarBojun Pan <bojunp@codeaurora.org>
parent 3eb4edcd
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -755,6 +755,8 @@ static void gsi_handle_irq(void)
	unsigned long cnt = 0;

	while (1) {
		if (!gsi_ctx->per.clk_status_cb())
			break;
		type = gsi_readl(gsi_ctx->base +
			GSI_EE_n_CNTXT_TYPE_IRQ_OFFS(ee));

@@ -2875,6 +2877,15 @@ int gsi_query_channel_db_addr(unsigned long chan_hdl,
}
EXPORT_SYMBOL(gsi_query_channel_db_addr);

int gsi_pending_irq_type(void)
{
	int ee = gsi_ctx->per.ee;

	return gsi_readl(gsi_ctx->base +
		GSI_EE_n_CNTXT_TYPE_IRQ_OFFS(ee));
}
EXPORT_SYMBOL(gsi_pending_irq_type);

int gsi_start_channel(unsigned long chan_hdl)
{
	enum gsi_ch_cmd_opcode op = GSI_CH_START;
+12 −0
Original line number Diff line number Diff line
@@ -4840,6 +4840,7 @@ void _ipa_disable_clks_v3_0(void)
void ipa3_disable_clks(void)
{
	int i;
	int type;

	if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_NORMAL) {
		IPAERR("not supported in this mode\n");
@@ -4854,6 +4855,17 @@ void ipa3_disable_clks(void)
	 */
	atomic_set(&ipa3_ctx->ipa_clk_vote, 0);

	/*
	 * If there is still pending gsi irq, this indicate
	 * issue on GSI FW side. We need to capture before
	 * turn off the ipa clock.
	 */
	type = gsi_pending_irq_type();
	if (type) {
		IPAERR("unexpected gsi irq type: %d\n", type);
		ipa_assert();
	}

	ipa3_ctx->ctrl->ipa3_disable_clks();

	ipa_pm_set_clock_index(0);