diff mbox series

[net-next,5/9] net: ipa: disable IEOB interrupt after channel stop

Message ID 20210129202019.2099259-6-elder@linaro.org
State New
Headers show
Series net: ipa: don't disable NAPI in suspend | expand

Commit Message

Alex Elder Jan. 29, 2021, 8:20 p.m. UTC
Disable the I/O completion interrupt on a channel *after* we
successfully stop it rather than before.  This ensures a completion
occurring just before the channel is stopped triggers an interrupt.

Enable the interrupt *before* starting a channel rather than after,
to be symmetric.  A stopped channel won't generate any completion
interrupts anyway.

Signed-off-by: Alex Elder <elder@linaro.org>

---
 drivers/net/ipa/gsi.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

-- 
2.27.0
diff mbox series

Patch

diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
index 565c785e33a25..1a02936b4db06 100644
--- a/drivers/net/ipa/gsi.c
+++ b/drivers/net/ipa/gsi.c
@@ -860,16 +860,18 @@  static int __gsi_channel_start(struct gsi_channel *channel, bool start)
 	struct gsi *gsi = channel->gsi;
 	int ret;
 
+	gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id);
+
 	mutex_lock(&gsi->mutex);
 
 	ret = start ? gsi_channel_start_command(channel) : 0;
 
 	mutex_unlock(&gsi->mutex);
 
-	if (!ret) {
-		gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id);
+	if (ret)
+		gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id);
+	else
 		napi_enable(&channel->napi);
-	}
 
 	return ret;
 }
@@ -909,14 +911,13 @@  static int __gsi_channel_stop(struct gsi_channel *channel, bool stop)
 
 	gsi_channel_trans_quiesce(channel);
 	napi_disable(&channel->napi);
-	gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id);
 
 	ret = stop ? gsi_channel_stop_retry(channel) : 0;
 
-	if (ret) {
-		gsi_irq_ieob_enable_one(gsi, channel->evt_ring_id);
+	if (ret)
 		napi_enable(&channel->napi);
-	}
+	else
+		gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id);
 
 	return ret;
 }