forcedeth: napi schedule lock fix
This patch fixes a potential race condition between scheduling napi and completing napi poll. The call to netif_rx_schedule should be under protection of the lock (as is the completion), otherwise, interrupts could be masked off. Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1b6725dea7
commit
eb10a78182
|
@ -3405,10 +3405,10 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
|
||||||
|
|
||||||
#ifdef CONFIG_FORCEDETH_NAPI
|
#ifdef CONFIG_FORCEDETH_NAPI
|
||||||
if (events & NVREG_IRQ_RX_ALL) {
|
if (events & NVREG_IRQ_RX_ALL) {
|
||||||
|
spin_lock(&np->lock);
|
||||||
netif_rx_schedule(&np->napi);
|
netif_rx_schedule(&np->napi);
|
||||||
|
|
||||||
/* Disable furthur receive irq's */
|
/* Disable furthur receive irq's */
|
||||||
spin_lock(&np->lock);
|
|
||||||
np->irqmask &= ~NVREG_IRQ_RX_ALL;
|
np->irqmask &= ~NVREG_IRQ_RX_ALL;
|
||||||
|
|
||||||
if (np->msi_flags & NV_MSI_X_ENABLED)
|
if (np->msi_flags & NV_MSI_X_ENABLED)
|
||||||
|
@ -3522,10 +3522,10 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
|
||||||
|
|
||||||
#ifdef CONFIG_FORCEDETH_NAPI
|
#ifdef CONFIG_FORCEDETH_NAPI
|
||||||
if (events & NVREG_IRQ_RX_ALL) {
|
if (events & NVREG_IRQ_RX_ALL) {
|
||||||
|
spin_lock(&np->lock);
|
||||||
netif_rx_schedule(&np->napi);
|
netif_rx_schedule(&np->napi);
|
||||||
|
|
||||||
/* Disable furthur receive irq's */
|
/* Disable furthur receive irq's */
|
||||||
spin_lock(&np->lock);
|
|
||||||
np->irqmask &= ~NVREG_IRQ_RX_ALL;
|
np->irqmask &= ~NVREG_IRQ_RX_ALL;
|
||||||
|
|
||||||
if (np->msi_flags & NV_MSI_X_ENABLED)
|
if (np->msi_flags & NV_MSI_X_ENABLED)
|
||||||
|
|
Loading…
Reference in a new issue