@@ -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;
}
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