From patchwork Wed Oct 14 17:43:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 36009 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 58A1CB7B75 for ; Thu, 15 Oct 2009 04:51:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754729AbZJNRoX (ORCPT ); Wed, 14 Oct 2009 13:44:23 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754706AbZJNRoX (ORCPT ); Wed, 14 Oct 2009 13:44:23 -0400 Received: from mail-pz0-f188.google.com ([209.85.222.188]:60129 "EHLO mail-pz0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641AbZJNRoW (ORCPT ); Wed, 14 Oct 2009 13:44:22 -0400 Received: by pzk26 with SMTP id 26so16181pzk.4 for ; Wed, 14 Oct 2009 10:43:45 -0700 (PDT) Received: by 10.114.242.5 with SMTP id p5mr15607447wah.66.1255542225749; Wed, 14 Oct 2009 10:43:45 -0700 (PDT) Received: from angua (S01060016b61d1226.cg.shawcable.net [68.146.92.145]) by mx.google.com with ESMTPS id 23sm213869pxi.5.2009.10.14.10.43.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Oct 2009 10:43:45 -0700 (PDT) Received: from [127.0.1.1] (unknown [IPv6:::1]) by angua (Postfix) with ESMTP id A4DF111D94; Wed, 14 Oct 2009 10:43:43 -0700 (PDT) From: Grant Likely Subject: [PATCH v2] 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:43:43 -0600 Message-ID: <20091014174224.29221.18830.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 --- 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(-) -- 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);