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

Commit bc9ac858 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 to release the IPA clock"

parents 220b8c97 121d32db
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -3023,9 +3023,15 @@ void ipa_suspend_handler(enum ipa_irq_type interrupt,
				 * pipe will be unsuspended as part of
				 * enabling IPA clocks
				 */
				if (!atomic_read(
					&ipa_ctx->sps_pm.dec_clients)
					) {
					ipa_inc_client_enable_clks();
				ipa_ctx->sps_pm.dec_clients = true;
					atomic_set(
						&ipa_ctx->sps_pm.dec_clients,
						1);
					ipa_sps_process_irq_schedule_rel();
				}
			} else {
				resource = ipa2_get_rm_resource_from_ep(i);
				res = ipa_rm_request_resource_with_timer(
@@ -3088,11 +3094,12 @@ static int apps_cons_request_resource(void)
static void ipa_sps_release_resource(struct work_struct *work)
{
	/* check whether still need to decrease client usage */
	if (ipa_ctx->sps_pm.dec_clients) {
	if (atomic_read(&ipa_ctx->sps_pm.dec_clients)) {
		if (atomic_read(&ipa_ctx->sps_pm.eot_activity)) {
			IPADBG("EOT pending Re-scheduling\n");
			ipa_sps_process_irq_schedule_rel();
		} else {
			ipa_ctx->sps_pm.dec_clients = false;
			atomic_set(&ipa_ctx->sps_pm.dec_clients, 0);
			ipa_dec_client_disable_clks();
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -1071,7 +1071,7 @@ struct ipa_uc_wdi_ctx {
 *  the inactivity timer
 */
struct ipa_sps_pm {
	bool dec_clients;
	atomic_t dec_clients;
	atomic_t eot_activity;
};

+12 −5
Original line number Diff line number Diff line
@@ -2991,9 +2991,15 @@ void ipa3_suspend_handler(enum ipa_irq_type interrupt,
				 * pipe will be unsuspended as part of
				 * enabling IPA clocks
				 */
				if (!atomic_read(
					&ipa3_ctx->transport_pm.dec_clients)
					) {
					ipa3_inc_client_enable_clks();
				ipa3_ctx->transport_pm.dec_clients = true;
					atomic_set(
					&ipa3_ctx->transport_pm.dec_clients,
					1);
					ipa3_sps_process_irq_schedule_rel();
				}
			} else {
				resource = ipa3_get_rm_resource_from_ep(i);
				res =
@@ -3057,11 +3063,12 @@ static int ipa3_apps_cons_request_resource(void)
static void ipa3_sps_release_resource(struct work_struct *work)
{
	/* check whether still need to decrease client usage */
	if (ipa3_ctx->transport_pm.dec_clients) {
	if (atomic_read(&ipa3_ctx->transport_pm.dec_clients)) {
		if (atomic_read(&ipa3_ctx->transport_pm.eot_activity)) {
			IPADBG("EOT pending Re-scheduling\n");
			ipa3_sps_process_irq_schedule_rel();
		} else {
			ipa3_ctx->transport_pm.dec_clients = false;
			atomic_set(&ipa3_ctx->transport_pm.dec_clients, 0);
			ipa3_dec_client_disable_clks();
		}
	}
+1 −1
Original line number Diff line number Diff line
@@ -1218,7 +1218,7 @@ struct ipa3_transport_pm {
	spinlock_t lock;
	bool res_granted;
	bool res_rel_in_prog;
	bool dec_clients;
	atomic_t dec_clients;
	atomic_t eot_activity;
};