Suspicious sequence of code in ibm_ocp_enet.c

Eugene Surovegin ebs at
Wed Nov 20 18:50:43 EST 2002


I found a strange sequence of code in ppc405_enet_open (devel_2_4 & devel_2_5).

init_rings is called _AFTER_ enabling MAL tx and rx channels:

static int
ppc405_enet_open(struct net_device *dev)

        ... some code skipped ...

         /* enable all MAL transmit and receive channels */

         /* set transmit and receive enable */
         out_be32(&emacp->em0mr0, EMAC_M0_TXE | EMAC_M0_RXE);


         printk(KERN_NOTICE "%s: IBM EMAC: open completed\n\n", dev->name);

         return 0;

I suspect that this can cause some trouble during opening the device if a
packet arrives just after enabling rx channel but before init_rings is
executed. Frankly, I'm pretty sure that this causes infrequent crashes on
our custom 405GP board.

I'd move call to init_rings(dev) just before enable_mal_chan(fep);

Any ideas, suggestions ?


  Eugene Surovegin <mailto:ebs at>

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list