Hi Xin,
Xin Xie wrote:
Occasionally the system is crashing when connect to the network runing
30+ hours.
Found out it is due to two consecutive FEC RX irqs cause the stack
corruption of handle_IRQ_event routine. In the current fec RX/TX/MII
handler, spin_unlock_irq() will enable the IRQ at the end of function,
but the those functions will be continued called by the
fec_enet_interrupt as long as there is the IRQ status indicate there is
events. So inside the fec_enet_interrupt, there will be short period of
time IRQ enabled which should not happening because the IRQ handler is
registered with IRQF_DISABLED flags.
Changing the spin_lock_irq/spin_unlock_irq to spin_lock/spin_unlock
solves the problem.
Signed-off-by: Xin Xie <x...@nojapower.com.au>
Looks good. I'll apply locally, and push to mainline after the
upcoming merge of the fec platform changes.
Regards
Greg
--- a/drivers/net/fec.c 2009-02-10 08:34:04.000000000 +1000
+++ b/drivers/net/fec.c 2009-02-10 08:35:35.000000000 +1000
@@ -494,7 +494,7 @@ fec_enet_tx(struct net_device *dev)
struct sk_buff *skb;
fep = netdev_priv(dev);
- spin_lock_irq(&fep->hw_lock);
+ spin_lock(&fep->hw_lock);
bdp = fep->dirty_tx;
while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
@@ -553,7 +553,7 @@ fec_enet_tx(struct net_device *dev)
}
}
fep->dirty_tx = (cbd_t *)bdp;
- spin_unlock_irq(&fep->hw_lock);
+ spin_unlock(&fep->hw_lock);
}
@@ -580,7 +580,7 @@ fec_enet_rx(struct net_device *dev)
fep = netdev_priv(dev);
fecp = (volatile fec_t*)dev->base_addr;
- spin_lock_irq(&fep->hw_lock);
+ spin_lock(&fep->hw_lock);
/* First, grab all of the stats for the incoming packet.
* These get messed up if we get called due to a busy condition.
@@ -688,7 +688,7 @@ while (!((status = bdp->cbd_sc) & BD_ENE
fecp->fec_r_des_active = 0;
#endif
- spin_unlock_irq(&fep->hw_lock);
+ spin_unlock(&fep->hw_lock);
}
@@ -702,7 +702,7 @@ fec_enet_mii(struct net_device *dev)
uint mii_reg;
fep = netdev_priv(dev);
- spin_lock_irq(&fep->mii_lock);
+ spin_lock(&fep->mii_lock);
ep = fep->hwp;
mii_reg = ep->fec_mii_data;
@@ -723,7 +723,7 @@ fec_enet_mii(struct net_device *dev)
ep->fec_mii_data = mip->mii_regval;
unlock:
- spin_unlock_irq(&fep->mii_lock);
+ spin_unlock(&fep->mii_lock);
}
static int
Xin Xie
Embedded Software Engineer
Noja Power Switchgear Pty Ltd
Tel: +61 7 39078741
Email: x...@nojapower.com.au
------------------------------------------------------------------------
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
--
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: g...@snapgear.com
SnapGear, a McAfee Company PHONE: +61 7 3435 2888
825 Stanley St, FAX: +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev