From patchwork Wed Oct 14 17:40:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 36010 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id DEDAAB7B75 for ; Thu, 15 Oct 2009 04:51:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755229AbZJNRrR (ORCPT ); Wed, 14 Oct 2009 13:47:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755205AbZJNRrR (ORCPT ); Wed, 14 Oct 2009 13:47:17 -0400 Received: from mail-pz0-f188.google.com ([209.85.222.188]:60201 "EHLO mail-pz0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754981AbZJNRrR (ORCPT ); Wed, 14 Oct 2009 13:47:17 -0400 Received: by pzk26 with SMTP id 26so18393pzk.4 for ; Wed, 14 Oct 2009 10:46:40 -0700 (PDT) Received: by 10.115.100.22 with SMTP id c22mr15675895wam.58.1255542003780; Wed, 14 Oct 2009 10:40:03 -0700 (PDT) Received: from angua (S01060016b61d1226.cg.shawcable.net [68.146.92.145]) by mx.google.com with ESMTPS id 22sm999137pxi.14.2009.10.14.10.40.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Oct 2009 10:40:03 -0700 (PDT) Received: from [127.0.1.1] (unknown [IPv6:::1]) by angua (Postfix) with ESMTP id 1166411D94; Wed, 14 Oct 2009 10:40:01 -0700 (PDT) From: Grant Likely Subject: [PATCH] net/fec_mpc52xx: Fix kernel panic on FEC error To: linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, davem@davemloft.net Cc: John Bonesio , Grant Likely Date: Wed, 14 Oct 2009 11:40:00 -0600 Message-ID: <20091014173842.29148.27965.stgit@angua> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: John Bonesio 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. Signed-off-by: John Bonesio Signed-off-by: Grant Likely --- Hi David, This patch is a bug fix that definitely needs to go in for 2.6.32. I'll also be asking Greg to pick it up for the stable tree once it is in mainline. Thanks, g. drivers/net/fec_mpc52xx.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index c40113f..66dace6 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c @@ -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);