* Suspicious sequence of code in ibm_ocp_enet.c
@ 2002-11-20 7:50 Eugene Surovegin
2002-11-20 15:32 ` David Gibson
0 siblings, 1 reply; 2+ messages in thread
From: Eugene Surovegin @ 2002-11-20 7:50 UTC (permalink / raw)
To: linuxppc-embedded
Hi!
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 */
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);
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 ?
Thanks,
Eugene Surovegin <mailto:ebs@innocent.com>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Suspicious sequence of code in ibm_ocp_enet.c
2002-11-20 7:50 Suspicious sequence of code in ibm_ocp_enet.c Eugene Surovegin
@ 2002-11-20 15:32 ` David Gibson
0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2002-11-20 15:32 UTC (permalink / raw)
To: linuxppc-embedded
On Tue, Nov 19, 2002 at 11:50:43PM -0800, Eugene Surovegin wrote:
>
> Hi!
>
> 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 */
> 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);
>
> 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 ?
It certainly looks dodgy. Try changing it and see what happens. Then
send a patch :-)
--
David Gibson | For every complex problem there is a
david@gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-20 15:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20 7:50 Suspicious sequence of code in ibm_ocp_enet.c Eugene Surovegin
2002-11-20 15:32 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).