Skip to contentSkip to conversation

correct initialization sequence in ppc405_enet_open

PATCH In review Eugene Surovegin 2 participants 2 messages Nov 21, 2002 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 correct initialization sequence in ppc405_enet_open

Hi!

This patch fixes problem in drivers/net/ibm_ocp/ibm_ocp_enet.c. Ring buffers initialization (init_rings) is called _after_ enabling MAL rx channel.
If a packet arrives just after MAL was enabled but before init_rings initialized buffers, you can see random crashes during EMAC open or receive descriptor error interrupt.

This bug affects all systems that use drivers/net/ibm_ocp/ibm_ocp_enet.c (405GP based, 440GP based, etc).
This patch is against current devel_2_4, but I think should apply without any problems to devel_2_5 also.

Thanks.

===== drivers/net/ibm_ocp/ibm_ocp_enet.c 1.55 vs edited =====

drivers/net/ibm_ocp/ibm_ocp_enet.c Wed Nov 20 21:34:30 2002 renamed from drivers/net/ibm_ocp/ibm_ocp_enet.c Thu Aug 22 11:29:32 2002 +0 -0
@@ -375,13 +375,15 @@
                request_irq(BL_MAL_RXEOB,ppc405_eth_rxeob,0,"OCP EMAC RX
EOB",dev);
        }
-       /* enable all MAL transmit and receive channels */
+       /* init buffer descriptors rings */
+       init_rings(dev);

+ /* enable all MAL transmit and receive channels */

        enable_mal_chan(fep);

        /* set transmit and receive enable */
        out_be32(&emacp->em0mr0, EMAC_M0_TXE | EMAC_M0_RXE);
-       init_rings(dev);
+
        netif_start_queue(dev);
        printk(KERN_NOTICE "%s: IBM EMAC: open completed\n\n", dev->name);

Eugene Surovegin <mailto:[email protected]>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 4 lines · Eugene Surovegin

Hi!

This patch fixes problem in drivers/net/ibm_ocp/ibm_ocp_enet.c.

<snip>

Quoted 2 lines

This patch is against current devel_2_4, but I think should apply without any problems to devel_2_5 also.

Looks good, applied to both trees.

Thanks,
--
Matt Porter
[email protected]
This is Linux Country. On a quiet night, you can hear Windows reboot.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/