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

Commit 8856f9ff 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: scale IPA clocks without lock"

parents 6c165c03 f1115372
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -3553,16 +3553,32 @@ int ipa2_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	ipa_ctx->curr_ipa_clk_rate = clk_rate;
	IPADBG_LOW("setting clock rate to %u\n", ipa_ctx->curr_ipa_clk_rate);
	if (ipa_ctx->ipa_active_clients.cnt > 0) {
		struct ipa_active_client_logging_info log_info;

		/*
		 * clk_set_rate should be called with unlocked lock to allow
		 * clients to get a reference to IPA clock synchronously.
		 * Hold a reference to IPA clock here to make sure clock
		 * state does not change during set_rate.
		 */
		IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info);
		ipa_ctx->ipa_active_clients.cnt++;
		ipa2_active_clients_log_inc(&log_info, false);
		ipa_active_clients_unlock();

		clk_set_rate(ipa_clk, ipa_ctx->curr_ipa_clk_rate);
		if (ipa_ctx->ipa_hw_mode != IPA_HW_MODE_VIRTUAL)
			if (msm_bus_scale_client_update_request(
			    ipa_ctx->ipa_bus_hdl, ipa_get_bus_vote()))
				WARN_ON(1);
		/* remove the vote added here */
		IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	} else {
		IPADBG_LOW("clocks are gated, not setting rate\n");
	}
		 ipa_active_clients_unlock();
	}
	IPADBG_LOW("Done\n");

	return 0;
}

+17 −1
Original line number Diff line number Diff line
@@ -3696,16 +3696,32 @@ int ipa3_set_required_perf_profile(enum ipa_voltage_level floor_voltage,
	ipa3_ctx->curr_ipa_clk_rate = clk_rate;
	IPADBG_LOW("setting clock rate to %u\n", ipa3_ctx->curr_ipa_clk_rate);
	if (ipa3_ctx->ipa3_active_clients.cnt > 0) {
		struct ipa_active_client_logging_info log_info;

		/*
		 * clk_set_rate should be called with unlocked lock to allow
		 * clients to get a reference to IPA clock synchronously.
		 * Hold a reference to IPA clock here to make sure clock
		 * state does not change during set_rate.
		 */
		IPA_ACTIVE_CLIENTS_PREP_SIMPLE(log_info);
		ipa3_ctx->ipa3_active_clients.cnt++;
		ipa3_active_clients_log_inc(&log_info, false);
		ipa3_active_clients_unlock();

		clk_set_rate(ipa3_clk, ipa3_ctx->curr_ipa_clk_rate);
		if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_VIRTUAL)
			if (msm_bus_scale_client_update_request(
			    ipa3_ctx->ipa_bus_hdl, ipa3_get_bus_vote()))
				WARN_ON(1);
		/* remove the vote added here */
		IPA_ACTIVE_CLIENTS_DEC_SIMPLE();
	} else {
		IPADBG_LOW("clocks are gated, not setting rate\n");
	}
		ipa3_active_clients_unlock();
	}
	IPADBG_LOW("Done\n");

	return 0;
}