[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BN3PR0301MB1219E3C63A4F2AE460C3EC1EF5000@BN3PR0301MB1219.namprd03.prod.outlook.com>
Date: Mon, 30 Nov 2015 07:31:19 +0000
From: Duan Andy <fugang.duan@...escale.com>
To: Lothar Waßmann <LW@...O-electronics.de>
CC: Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Fabio Estevam <Fabio.Estevam@...escale.com>,
Kevin Hao <haokexin@...il.com>,
Lucas Stach <l.stach@...gutronix.de>,
Philippe Reynes <tremyfr@...il.com>,
Russell King <rmk+kernel@....linux.org.uk>,
Uwe Kleine-K?nig <u.kleine-koenig@...gutronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Stefan Agner <stefan@...er.ch>
Subject: RE: [PATCH] net: fec: fix enet_out clock handling
From: Lothar Waßmann <LW@...O-electronics.de> Sent: Monday, November 30, 2015 2:56 PM
> To: Duan Fugang-B38611
> Cc: Andrew Lunn; David S. Miller; Estevam Fabio-R49496; Kevin Hao; Lucas
> Stach; Philippe Reynes; Russell King; Uwe Kleine-K?nig; linux-
> kernel@...r.kernel.org; netdev@...r.kernel.org; Stefan Agner
> Subject: Re: [PATCH] net: fec: fix enet_out clock handling
>
> Hi,
>
> > From: Lothar Waßmann <LW@...O-electronics.de> Sent: Friday, November
> > 27, 2015 9:39 PM
> > > To: Andrew Lunn; David S. Miller; Estevam Fabio-R49496; Kevin Hao;
> > > Lothar Waßmann; Lucas Stach; Duan Fugang-B38611; Philippe Reynes;
> > > Russell King; Uwe Kleine-König; linux-kernel@...r.kernel.org;
> > > netdev@...r.kernel.org; Stefan Agner
> > > Subject: [PATCH] net: fec: fix enet_out clock handling
> > >
> > > When ENET_OUT is being used as reference clock for an external PHY,
> > > the clock must not be disabled while the PHY is active. Otherwise
> > > the PHY may lose its internal state and require a reset to become
> functional again.
> > >
> > > A symptom for this bug is a network interface that constantly
> > > toggles between UP and DOWN state:
> > > fec 800f0000.ethernet eth0: Link is Up - 100Mbps/Full - flow control
> > > rx/tx fec 800f0000.ethernet eth0: Link is Down fec 800f0000.ethernet
> eth0:
> > > Link is Up - 100Mbps/Full - flow control rx/tx fec 800f0000.ethernet
> eth0:
> > > Link is Down [...]
> > >
> > > Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
> > > ---
> > > drivers/net/ethernet/freescale/fec_main.c | 34
> > > +++++++++++++------------
> > > ------
> > > 1 file changed, 14 insertions(+), 20 deletions(-)
> > >
> >
> > When MAC is not ready with clocks disabled, it is not necessary to
> supply clock for PHY. In fact, PHY also is not ready, why does it need
> clock ?
> > For your problem, you must add PHY reset in your dts file to resolve
> your problem.
> >
> The phy-reset-gpio property is set in the DTB. But fec_reset_phy() which
> asserts the RESET is only called from within the probe() function.
> It should probably be called from fec_restart() instead?
>
After enet_out clock enable, you can call fec_reset_phy() do phy reset. Don't put it in .fec_restart() function because
Cable hotplug test cause phy registers reset to HW default status.
Regards,
Andy
Powered by blists - more mailing lists