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

Commit 86851335 authored by Ashok Vuyyuru's avatar Ashok Vuyyuru Committed by Gerrit - the friendly Code Review server
Browse files

msm: ipa4: Fix to update the polling mode for coalescing channel



When default wan consumer pipe polling mode was changed, not updating
the polling mode for coalescing pipe. As both the pipes are sharing
a common event ring because of that observing warning logs, it was
leading to watchdog bite. Add changes to update the polling mode
for coalescing channel when wan default pipe polling mode changed.

Change-Id: I8630c9866cb7925d21ff7fd9dc68fcb03a98cbc5
Signed-off-by: default avatarAshok Vuyyuru <avuyyuru@codeaurora.org>
parent 3adfbb92
Loading
Loading
Loading
Loading
+23 −3
Original line number Diff line number Diff line
@@ -2419,6 +2419,11 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl,
	ctx->stats.dp.last_timestamp = jiffies_to_msecs(jiffies);
	atomic_inc(&gsi_ctx->num_chan);

	if (props->prot == GSI_CHAN_PROT_GCI) {
		gsi_ctx->coal_info.ch_id = props->ch_id;
		gsi_ctx->coal_info.evchid = props->evt_ring_hdl;
	}

	return GSI_STATUS_SUCCESS;
}
EXPORT_SYMBOL(gsi_alloc_channel);
@@ -3150,6 +3155,10 @@ int gsi_dealloc_channel(unsigned long chan_hdl)
		atomic_dec(&ctx->evtr->chan_ref_cnt);
	atomic_dec(&gsi_ctx->num_chan);

	if (ctx->props.prot == GSI_CHAN_PROT_GCI) {
		gsi_ctx->coal_info.ch_id = GSI_CHAN_MAX;
		gsi_ctx->coal_info.evchid = GSI_EVT_RING_MAX;
	}
	return GSI_STATUS_SUCCESS;
}
EXPORT_SYMBOL(gsi_dealloc_channel);
@@ -3684,7 +3693,7 @@ EXPORT_SYMBOL(gsi_poll_n_channel);

int gsi_config_channel_mode(unsigned long chan_hdl, enum gsi_chan_mode mode)
{
	struct gsi_chan_ctx *ctx;
	struct gsi_chan_ctx *ctx, *coal_ctx;
	enum gsi_chan_mode curr;
	unsigned long flags;
	enum gsi_chan_mode chan_mode;
@@ -3730,8 +3739,14 @@ int gsi_config_channel_mode(unsigned long chan_hdl, enum gsi_chan_mode mode)
		gsi_writel(1 << ctx->evtr->id, gsi_ctx->base +
			GSI_EE_n_CNTXT_SRC_IEOB_IRQ_CLR_OFFS(gsi_ctx->per.ee));
		atomic_set(&ctx->poll_mode, mode);
		if ((ctx->props.prot == GSI_CHAN_PROT_GCI) && ctx->evtr->chan)
		if ((ctx->props.prot == GSI_CHAN_PROT_GCI) && ctx->evtr->chan) {
			atomic_set(&ctx->evtr->chan->poll_mode, mode);
		} else if (gsi_ctx->coal_info.evchid == ctx->evtr->id) {
			coal_ctx = &gsi_ctx->chan[gsi_ctx->coal_info.ch_id];
			if (coal_ctx != NULL)
				atomic_set(&coal_ctx->poll_mode, mode);
		}

		GSIDBG("set gsi_ctx evtr_id %d to %d mode\n",
			ctx->evtr->id, mode);
		ctx->stats.callback_to_poll++;
@@ -3740,8 +3755,13 @@ int gsi_config_channel_mode(unsigned long chan_hdl, enum gsi_chan_mode mode)
	if (curr == GSI_CHAN_MODE_POLL &&
			mode == GSI_CHAN_MODE_CALLBACK) {
		atomic_set(&ctx->poll_mode, mode);
		if ((ctx->props.prot == GSI_CHAN_PROT_GCI) && ctx->evtr->chan)
		if ((ctx->props.prot == GSI_CHAN_PROT_GCI) && ctx->evtr->chan) {
			atomic_set(&ctx->evtr->chan->poll_mode, mode);
		} else if (gsi_ctx->coal_info.evchid == ctx->evtr->id) {
			coal_ctx = &gsi_ctx->chan[gsi_ctx->coal_info.ch_id];
			if (coal_ctx != NULL)
				atomic_set(&coal_ctx->poll_mode, mode);
		}
		__gsi_config_ieob_irq(gsi_ctx->per.ee, 1 << ctx->evtr->id, ~0);
		GSIDBG("set gsi_ctx evtr_id %d to %d mode\n",
			ctx->evtr->id, mode);
+6 −0
Original line number Diff line number Diff line
@@ -199,6 +199,11 @@ struct gsi_generic_ee_cmd_debug_stats {
	unsigned long halt_channel;
};

struct gsi_coal_chan_info {
	uint8_t ch_id;
	uint8_t evchid;
};

struct gsi_ctx {
	void __iomem *base;
	struct device *dev;
@@ -222,6 +227,7 @@ struct gsi_ctx {
	struct completion gen_ee_cmd_compl;
	void *ipc_logbuf;
	void *ipc_logbuf_low;
	struct gsi_coal_chan_info coal_info;
	/*
	 * The following used only on emulation systems.
	 */