This fixes a major bug in the Sun GEM Ether driver's netpoll implementation. When both polled and interrupt driven i/o are used simultaneously, for example when using kgdb over Ether with active NFS mounts, a condition easily arises where the bug is hit.
The problem is that gem_poll() expects an rx softnet_data structure to have been allocated (via __netif_rx_schedule()) prior to its being called. The existing gem driver code uses gem_interrupt() to set things up for gem_poll(), but unfortunately, gem_interrupt() doesn't know about this, and so doesn't allocate the required structure when it finds no bits set in the interrupt status register. gem_poll() then move on its way and tries to delete the non-existent softnet_data structure. Signed-off-by: Geoff Levand <[EMAIL PROTECTED]> --- orig/drivers/net/sungem.c +++ mod/drivers/net/sungem.c @@ -945,12 +945,12 @@ if (netif_rx_schedule_prep(dev)) { u32 gem_status = readl(gp->regs + GREG_STAT); + gp->status = gem_status; - if (gem_status == 0) { + if ((gem_status & ~GREG_STAT_TXNR) == 0) { spin_unlock_irqrestore(&gp->lock, flags); return IRQ_NONE; } - gp->status = gem_status; gem_disable_ints(gp); __netif_rx_schedule(dev); } @@ -970,7 +970,8 @@ /* gem_interrupt is safe to reentrance so no need * to disable_irq here. */ - gem_interrupt(dev->irq, dev, NULL); + if(gem_interrupt(dev->irq, dev, NULL) == IRQ_NONE) + __netif_rx_schedule(dev); } #endif - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html