From: Ben Hutchings Date: Tue, 31 Mar 2009 22:07:21 +0000 (-0700) Subject: sfc: Call netif_napi_add() before registering our interrupt handler X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e765cb4a07356e4f01cc57959c3c798a586f749;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sfc: Call netif_napi_add() before registering our interrupt handler If we use a shared legacy IRQ then our interrupt handler may be called as soon as it is registered even though IRQs are disabled on the NIC. Now that the legacy interrupt handler also checks for event delivery, it may decide to schedule polling in this case. Ensure that the NAPI context is valid but disabled at this point. Signed-off-by: Ben Hutchings Signed-off-by: David S. Miller --- diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 00c23b1babca..dee23b159df2 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c @@ -448,6 +448,9 @@ static void efx_init_channels(struct efx_nic *efx) WARN_ON(channel->rx_pkt != NULL); efx_rx_strategy(channel); + + netif_napi_add(channel->napi_dev, &channel->napi_str, + efx_poll, napi_weight); } } @@ -462,10 +465,6 @@ static void efx_start_channel(struct efx_channel *channel) EFX_LOG(channel->efx, "starting chan %d\n", channel->channel); - if (!(channel->efx->net_dev->flags & IFF_UP)) - netif_napi_add(channel->napi_dev, &channel->napi_str, - efx_poll, napi_weight); - /* The interrupt handler for this channel may set work_pending * as soon as we enable it. Make sure it's cleared before * then. Similarly, make sure it sees the enabled flag set. */