diff options
author | Alex Elder <elder@linaro.org> | 2021-02-01 20:28:48 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-02-03 04:42:36 +0300 |
commit | 4fef691c9b6ab5ed92b874bc6ddfb14a34c650ab (patch) | |
tree | bffbcadeba58c45c33a966f0b45d858acee5e3ab /drivers | |
parent | bd1ea1e46448992a4a3dfb6e6e2c410ca069a41c (diff) | |
download | linux-4fef691c9b6ab5ed92b874bc6ddfb14a34c650ab.tar.xz |
net: ipa: disable interrupt and NAPI after channel stop
Disable both the I/O completion interrupt and NAPI polling on a
channel *after* we successfully stop it rather than before. This
ensures a completion occurring just before the channel is stopped
gets processed.
Enable NAPI polling and the interrupt *before* starting a channel
rather than after, to be symmetric. A stopped channel won't
generate any completion interrupts anyway.
Enable NAPI before the interrupt and disable it afterward.
Signed-off-by: Alex Elder <elder@linaro.org>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ipa/gsi.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c index 049a63e21bca..9b3d5b639dac 100644 --- a/drivers/net/ipa/gsi.c +++ b/drivers/net/ipa/gsi.c @@ -860,15 +860,18 @@ static int __gsi_channel_start(struct gsi_channel *channel, bool start) struct gsi *gsi = channel->gsi; int ret; + napi_enable(&channel->napi); + 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); - napi_enable(&channel->napi); + if (ret) { + gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id); + napi_disable(&channel->napi); } return ret; @@ -908,14 +911,11 @@ static int __gsi_channel_stop(struct gsi_channel *channel, bool stop) int ret; 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); - napi_enable(&channel->napi); + if (!ret) { + gsi_irq_ieob_disable_one(gsi, channel->evt_ring_id); + napi_disable(&channel->napi); } return ret; |