net/fec_mpc52xx: Fix kernel panic on FEC error
Subsystems (2)
PATCH v2 1/1 net/fec_mpc52xx: Fix kernel panic on FEC error
From: John Bonesio <[email protected]>
The MDIO bus cannot be accessed at interrupt context, but on an FEC error, the fec_mpc52xx driver reset function also tries to reset the PHY. Since the error is detected at IRQ context, and the PHY functions try to sleep, the kernel ends up panicking.
Resetting the PHY on an FEC error isn't even necessary. This patch solves the problem by removing the PHY reset entirely.
---
v2: fixed stupid misspelling of John's email address. No changes to content.
drivers/net/fec_mpc52xx.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/net/fec_mpc52xx.c +0 -6
@@ -759,12 +759,6 @@ static void mpc52xx_fec_reset(struct net_device *dev)mpc52xx_fec_hw_init (dev); -if (priv->phydev) { -phy_stop (priv->phydev); -phy_write (priv->phydev,MII_BMCR ,BMCR_RESET ); -phy_start (priv->phydev); - } -bcom_fec_rx_reset (priv->rx_dmatsk);bcom_fec_tx_reset (priv->tx_dmatsk);
Quoted 9 lines · Grant Likely
From: John Bonesio <[email protected]>
The MDIO bus cannot be accessed at interrupt context, but on an FEC error, the
fec_mpc52xxdriver reset function also tries to reset the PHY. Since the error is detected at IRQ context, and the PHY functions try to sleep, the kernel ends up panicking.Resetting the PHY on an FEC error isn't even necessary. This patch solves the problem by removing the PHY reset entirely.
There is also no need to free and re-allocate the RX buffers in mpc52xx_fec_reset().
Wolfgang.
Quoted 8 lines · Wolfgang Grandegger
Quoted 7 lines · Grant Likely
From: John Bonesio <[email protected]>
The MDIO bus cannot be accessed at interrupt context, but on an FEC error, the
fec_mpc52xxdriver reset function also tries to reset the PHY. Since the error is detected at IRQ context, and the PHY functions try to sleep, the kernel ends up panicking.
Quoted 5 lines
Quoted 2 lines
Resetting the PHY on an FEC error isn't even necessary. This patch solves the problem by removing the PHY reset entirely.
There is also no need to free and re-allocate the RX buffers in
mpc52xx_fec_reset().
Write and test a patch for me! :-)
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
From: Grant Likely <[email protected]>
Date: Wed, 14 Oct 2009 11:43:43 -0600
Quoted 7 lines
From: John Bonesio <[email protected]>
The MDIO bus cannot be accessed at interrupt context, but on an FEC error, the
fec_mpc52xxdriver reset function also tries to reset the PHY. Since the error is detected at IRQ context, and the PHY functions try to sleep, the kernel ends up panicking.
Quoted 5 lines
Resetting the PHY on an FEC error isn't even necessary. This patch solves the problem by removing the PHY reset entirely.
Signed-off-by John Bonesio <[email protected]>Signed-off-by Grant Likely <[email protected]>
Applied, thanks.