Skip to content

Commit

Permalink
sfc: Call netif_napi_add() before registering our interrupt handler
Browse files Browse the repository at this point in the history
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 <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Mar 31, 2009
1 parent c9cacec commit 7e765cb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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. */
Expand Down

0 comments on commit 7e765cb

Please sign in to comment.