Kernel boot hangs by parallel flood pings
I'm using a 2.4.20 kernel (PPC).
When I run multiple 'ping -f' directed to my board during the kernel boots, sometimes it hangs with the following messages:
Memory BAT mapping: BAT2=64Mb, BAT3=32Mb, residual: 84Mb
Linux version 2.4.20-rthal5 (ru@styx) (gcc version 2.95.3 20010111 (prerelease/franzo/20010111)) #9 Tue Jan 11 17:09:22 CET 2005
On node 0 totalpages: 29859
zone(0): 29859 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: bootdev=aps0 ip=218.1.36.70:218.1.36.47:218.1.36.254:255.255.255.0::eth0:off panic=1 mem=119436k
Calibrating delay loop... 194.15 BogoMIPS
...
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache ha
^^^^^^^
the kernel boot hangs here
I have checked this with the BDI2000 and found that the kernel loops anywhere inside ip_route_input().
I think this is because the ethernet driver (fcc_enet.c)
enables the hardware too already inside it's init routine (fec_enet_init()).
In this way, frames may be received and forwarded to the upper layers with netif_rx(), before the TCP/IP was initialized.
I suggest to delay the lines
/* Enable transmit/receive */ fccp->fcc_gfmr |= FCC_GFMR_ENR | FCC_GFMR_ENT;
to the open entry point (fcc_enet_open()), which is triggered by 'ifconfig up' in the following way:
if(!((fccp->fcc_gfmr) & FCC_GFMR_ENR))
fccp->fcc_gfmr |= (FCC_GFMR_ENR | FCC_GFMR_ENT);By the way, fcc_enet_close() does _NOT_ stop the hardware. Hopefully, this is not a real problem.
Steffen
Signature · 10 lines
-------------------------------------------------------------- Steffen Rumler ICN CP D NT SW 3 Siemens AG Hofmannstr. 51 Email: [email protected] D-81359 Munich Phone: +49 89 722-44061 Germany Fax : +49 89 722-36703 --------------------------------------------------------------
Quoted 8 lines · Steffen Rumler
I'm using a 2.4.20 kernel (PPC).
When I run multiple 'ping -f' directed to my board during the kernel boots, sometimes it hangs with the following messages:
I have checked this with the BDI2000 and found that the kernel loops anywhere inside
ip_route_input().
This is a long-standing bug in the cpm and cmp2 drivers. I think it's also present in 2.6 as far as I remember.
I sent my own fix some time ago, you may find it in the archives as "[patch] Race condition #2 in arch/ppc/cpm2_io/fcc_enet.c".
Greetings,
Signature · 2 lines
Stefan Nickl Kontron Modular Computers
fcc_enet.c renamed from arch/ppc/cpm2_io/fcc_enet.c +1 -1
@@ -2095,10 +2095,10 @@ mii_send_receive(fcc_info_t *fip, uint cfor (i =0 , off =15 ; i <16 ; i++, off--) {FCC_PDATC_MDC (1 ); +udelay (1 ); retval <<=1 ;if (io->iop_pdatc & fip->fc_mdio) retval++; -udelay (1 );FCC_PDATC_MDC (0 );udelay (1 ); }
fcc_enet.c renamed from arch/ppc/cpm2_io/fcc_enet.c +10 -10
@@ -2008,16 +2008,6 @@ init_fcc_startup(fcc_info_t *fip, struct *(volatile uint *)(BCSR_ADDR +4 ) &= ~BCSR1_FETHIEN ; *(volatile uint *)(BCSR_ADDR +4 ) |=BCSR1_FETH_RST ;#endif - -#if defined(CONFIG_USE_MDIO ) || defined(CONFIG_TQM8260 ) -/* start in full duplex mode, and negotiate speed -*/ -fcc_restart (dev,1 ); -#else -/* start in half duplex mode -*/ -fcc_restart (dev,0 ); -#endif }#ifdef CONFIG_USE_MDIO
@@ -2155,6 +2145,16 @@ fcc_enet_open(struct net_device *dev) {struct fcc_enet_private *fep = dev->priv; +#if defined(CONFIG_USE_MDIO ) || defined(CONFIG_TQM8260 ) +/* start in full duplex mode, and negotiate speed +*/ +fcc_restart (dev,1 ); +#else +/* start in half duplex mode +*/ +fcc_restart (dev,0 ); +#endif +#ifdef CONFIG_USE_MDIO fep->sequence_done =0 ; fep->link =0 ;