Re: [PATCH net 2/2] net: ipa: re-enable NAPI before enabling interrupt

From: Jakub Kicinski
Date: Thu Jan 07 2021 - 21:38:47 EST


On Thu, 7 Jan 2021 15:43:25 -0600 Alex Elder wrote:
> @@ -743,21 +743,21 @@ static void gsi_channel_freeze(struct gsi_channel *channel)
> set_bit(GSI_CHANNEL_FLAG_STOPPING, channel->flags);
> smp_mb__after_atomic(); /* Ensure gsi_channel_poll() sees new value */
>
> - napi_disable(&channel->napi);
> -
> gsi_irq_ieob_disable(channel->gsi, channel->evt_ring_id);
> +
> + napi_disable(&channel->napi);
> }

So patch 1 is entirely for the purpose of keeping the code symmetric
here? I can't think of other reason why masking this IRQ couldn't be
left after NAPI is disabled, and that should work as you expect.

> /* Allow transactions to be used on the channel again. */
> static void gsi_channel_thaw(struct gsi_channel *channel)
> {
> - gsi_irq_ieob_enable(channel->gsi, channel->evt_ring_id);
> -
> /* Allow the NAPI poll loop to re-enable interrupts again */
> clear_bit(GSI_CHANNEL_FLAG_STOPPING, channel->flags);
> smp_mb__after_atomic(); /* Ensure gsi_channel_poll() sees new value */
>
> napi_enable(&channel->napi);
> +
> + gsi_irq_ieob_enable(channel->gsi, channel->evt_ring_id);
> }