From patchwork Wed Jul 21 12:51:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 59437 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 04483B70BC for ; Wed, 21 Jul 2010 22:51:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862Ab0GUMv1 (ORCPT ); Wed, 21 Jul 2010 08:51:27 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:45481 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210Ab0GUMvZ (ORCPT ); Wed, 21 Jul 2010 08:51:25 -0400 Received: from [2001:6f8:1178:2:221:70ff:fe71:1890] (helo=pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.71) (envelope-from ) id 1ObYlW-00034l-5m; Wed, 21 Jul 2010 14:51:14 +0200 Date: Wed, 21 Jul 2010 14:51:13 +0200 From: Wolfram Sang To: Baruch Siach Cc: Bryan Wu , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sascha Hauer , Greg Ungerer Subject: Re: [PATCH] fec: use interrupt for MDIO completion indication Message-ID: <20100721125113.GA2651@pengutronix.de> References: <006416d38a8e51ba8dd8631613a991528dc7976a.1278918594.git.baruch@tkos.co.il> <4C3E812C.10303@canonical.com> <20100715040956.GA7690@jasper.tkos.co.il> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100715040956.GA7690@jasper.tkos.co.il> User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: 2001:6f8:1178:2:221:70ff:fe71:1890 X-SA-Exim-Mail-From: w.sang@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > > Thanks for this patch, we tested on our i.MX51 board with Ubuntu. It works > > fine. > > > > Wolfram, you can pick up this, too. -;) > > Dave has already applied this patch to his net-next tree. Bryan, thanks for letting me know, I missed this one. However, have you guys ever tried pulling the cable off/on or restarting the interface with 'ifconfig down/up'? This always caused a stalled PHY for me. This patch helps: ========================== From: Wolfram Sang Subject: [PATCH] net/fec: restore interrupt mask after software-reset in fec_stop() After the change from mdio polling to irq, it became necessary to restore the interrupt mask after resetting the chip in fec_stop(). Otherwise, with all irqs disabled, no communication with the PHY will be possible after e.g. un-/replugging the cable and the device gets stalled. Signed-off-by: Wolfram Sang --- drivers/net/fec.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 391a553..768b840 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -118,6 +118,8 @@ static unsigned char fec_mac_default[] = { #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ +#define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII) + /* The FEC stores dest/src/type, data, and checksum for receive packets. */ #define PKT_MAXBUF_SIZE 1518 @@ -1213,8 +1215,7 @@ fec_restart(struct net_device *dev, int duplex) writel(0, fep->hwp + FEC_R_DES_ACTIVE); /* Enable interrupts we wish to service */ - writel(FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII, - fep->hwp + FEC_IMASK); + writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); } static void @@ -1233,8 +1234,8 @@ fec_stop(struct net_device *dev) /* Whack a reset. We should wait for this. */ writel(1, fep->hwp + FEC_ECNTRL); udelay(10); - writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); + writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); } static int __devinit