Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbbK3G5A (ORCPT ); Mon, 30 Nov 2015 01:57:00 -0500 Received: from mail.karo-electronics.de ([81.173.242.67]:64197 "EHLO mail.karo-electronics.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752176AbbK3G46 convert rfc822-to-8bit (ORCPT ); Mon, 30 Nov 2015 01:56:58 -0500 Date: Mon, 30 Nov 2015 07:56:17 +0100 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Duan Andy Cc: Andrew Lunn , "David S. Miller" , Fabio Estevam , Kevin Hao , Lucas Stach , Philippe Reynes , Russell King , Uwe Kleine-K?nig , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , Stefan Agner Subject: Re: [PATCH] net: fec: fix enet_out clock handling Message-ID: <20151130075617.0f880cd1@ipc1.ka-ro> In-Reply-To: References: <1448631550-943-1-git-send-email-LW@KARO-electronics.de> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1924 Lines: 41 Hi, > From: Lothar Waßmann 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@vger.kernel.org; netdev@vger.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 > > --- > > 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? Lothar Waßmann -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/