From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: Re: [PATCH] fec: use interrupt for MDIO completion indication Date: Wed, 21 Jul 2010 14:51:13 +0200 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-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EVF5PPMfhYS0aIcm" Cc: Bryan Wu , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sascha Hauer , Greg Ungerer To: Baruch Siach Return-path: 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 Content-Disposition: inline In-Reply-To: <20100715040956.GA7690@jasper.tkos.co.il> Sender: netdev-owner@vger.kernel.org List-ID: --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > Thanks for this patch, we tested on our i.MX51 board with Ubuntu. It wo= rks=20 > > fine. > >=20 > > Wolfram, you can pick up this, too. -;) >=20 > 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =46rom: Wolfram Sang Subject: [PATCH] net/fec: restore interrupt mask after software-reset in fe= c_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[] =3D { #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ =20 +#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); =20 /* 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); } =20 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); } =20 static int __devinit --=20 1.7.1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D BUT, while it helps and may possibly be a quick fix for 2.6.35, resetting the chip in fec_stop() looks like a wrong thing to do for me. In the long run, it probably is better to make sure the chip is set up correctly during initialization, so the reset in fec_stop() is not needed at all. I had a quick shot at this, but seem to have missed something as it didn't work. As I will be away from the computers for two weeks in about 24 hours, I at least wanted to bring up the issue. Regards, Wolfram --=20 Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ | --EVF5PPMfhYS0aIcm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkxG7UEACgkQD27XaX1/VRsnwwCfTguT90rmNShIpAWhW9DY3KBA jeQAn0+qHXH4d77Xtpf4xnCX8LBLm7WY =22VA -----END PGP SIGNATURE----- --EVF5PPMfhYS0aIcm--