On Tue, Mar 06, 2007 at 02:42:02AM -0800, [EMAIL PROTECTED] wrote: > From: Giridhar Pemmasani <[EMAIL PROTECTED]> > > During initialization, mv643xx driver registers IRQ before setting up tx/rx > rings. This causes kernel oops because mv643xx_poll, which gets called > right after registering IRQ, calls netif_rx_complete, which accesses the rx > ring (I don't have the oops message anymore; I just remember this sequence > of calls). Attached (tested) patch first initializes the rx/tx rings and > then registers the IRQ.
I believe a better fix is to disable any pending interrupt sources before calling request_irq(). I sent the patch below to Giri for confirmation, but haven't heard back. I should've copied Andrew. Giri, have you had a chance to test this alternative patch? Thanks, -Dale > Date: Fri, 2 Mar 2007 17:03:53 -0700 > To: Giridhar Pemmasani <[EMAIL PROTECTED]> > Message-ID: <[EMAIL PROTECTED]> > In-Reply-To: <[EMAIL PROTECTED]> > > On Fri, Mar 02, 2007 at 04:52:06AM +0000, Giridhar Pemmasani wrote: > > During initialization, mv643xx driver registers IRQ before setting up tx/rx > > rings. This causes kernel oops because mv643xx_poll, which gets called > > right after registering IRQ, calls netif_rx_complete, which accesses the rx > > ring (I don't have the oops message anymore; I just remember this sequence > > of calls). Attached (tested) patch first initializes the rx/tx rings and > > then registers the IRQ. > > > > Giri > > > > Signed-off-by: Giridhar Pemmasani <[EMAIL PROTECTED]> > > Giridhar, does the following patch fix your problem, in place of the > patch you supplied? > > -Dale diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 3e045a6..192b390 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -787,6 +787,12 @@ static int mv643xx_eth_open(struct net_device *dev) unsigned int size; int err; + /* Clear any pending ethernet port interrupts */ + mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); + mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); + /* wait for previous write to complete */ + mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)); + err = request_irq(dev->irq, mv643xx_eth_int_handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); if (err) { @@ -875,10 +881,6 @@ static int mv643xx_eth_open(struct net_device *dev) mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ - /* Clear any pending ethernet port interrupts */ - mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); - mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); - eth_port_start(dev); /* Interrupt Coalescing */ - 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