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

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

Merge "msm: gsi: gsi channel mode switch spinlock fix"

parents c38b0af7 1c624689
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -2787,21 +2787,27 @@ int gsi_config_channel_mode(unsigned long chan_hdl, enum gsi_chan_mode mode)
		return -GSI_STATUS_UNSUPPORTED_OP;
	}

	spin_lock_irqsave(&gsi_ctx->slock, flags);
	if (curr == GSI_CHAN_MODE_CALLBACK &&
			mode == GSI_CHAN_MODE_POLL) {
		spin_lock_irqsave(&gsi_ctx->slock, flags);
		__gsi_config_ieob_irq(gsi_ctx->per.ee, 1 << ctx->evtr->id, 0);
		spin_unlock_irqrestore(&gsi_ctx->slock, flags);
		spin_lock_irqsave(&ctx->ring.slock, flags);
		atomic_set(&ctx->poll_mode, mode);
		spin_unlock_irqrestore(&ctx->ring.slock, flags);
		ctx->stats.callback_to_poll++;
	}

	if (curr == GSI_CHAN_MODE_POLL &&
			mode == GSI_CHAN_MODE_CALLBACK) {
		spin_lock_irqsave(&ctx->ring.slock, flags);
		atomic_set(&ctx->poll_mode, mode);
		spin_unlock_irqrestore(&ctx->ring.slock, flags);
		spin_lock_irqsave(&gsi_ctx->slock, flags);
		__gsi_config_ieob_irq(gsi_ctx->per.ee, 1 << ctx->evtr->id, ~0);
		spin_unlock_irqrestore(&gsi_ctx->slock, flags);
		ctx->stats.poll_to_callback++;
	}
	spin_unlock_irqrestore(&gsi_ctx->slock, flags);

	return GSI_STATUS_SUCCESS;
}