[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210129202019.2099259-6-elder@linaro.org>
Date: Fri, 29 Jan 2021 14:20:15 -0600
From: Alex Elder <elder@...aro.org>
To: davem@...emloft.net, kuba@...nel.org
Cc: elder@...nel.org, evgreen@...omium.org, bjorn.andersson@...aro.org,
cpratapa@...eaurora.org, subashab@...eaurora.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next 5/9] net: ipa: disable IEOB interrupt after channel stop
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@...aro.org>
---
drivers/net/ipa/gsi.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
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;
}
--
2.27.0
Powered by blists - more mailing lists