From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alvaro G. M." Subject: Re: Xilinx axienet + DP83620 in fiber mode won't set netif_carrier_on Date: Wed, 16 May 2018 16:24:02 +0200 Message-ID: <20180516142401.GA4752@salem.gmr.ssr.upm.es> References: <20180516091630.GA17469@salem.gmr.ssr.upm.es> <20180516131134.GF22000@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org To: Andrew Lunn Return-path: Received: from salem.gmr.ssr.upm.es ([138.4.36.7]:33336 "EHLO salem.gmr.ssr.upm.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbeEPOYF (ORCPT ); Wed, 16 May 2018 10:24:05 -0400 Content-Disposition: inline In-Reply-To: <20180516131134.GF22000@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, May 16, 2018 at 03:11:34PM +0200, Andrew Lunn wrote: > Hi Alvaro > > What should happen in general terms is that at some point the link to > the peer is established. phylib, the generic PHY code, polls the PHY > ever second, asking what the link state is. When the link changes from > down to up, phylib will call the link_adjust callback in the MAC, and > netif_carrier_on(). > > When the PHY reports the link has gone down, it does similar, calls > the adjust_link callback, and netif_carrier_off(). > > So what you need to do is find out why the PHY driver never reports > link up. Does the PHY even know when the link is up? Often SFF/SFP > modules have a Signal Detect pin, which is connected to a gpio. Do you > have something like that? If so, you should look at the PHYLINK code > and the SFP device which was added recently. I didn't know about the SFP device. I don't think this will help my specific case because my board didn't route the i2c bus from the SFP, so it basically sits there and does it thing alone, I can't communicate with it. I see that net/phy/marvell.c has a custom marvell_update_link that reads a different register to check for fiber connectivity instead of using genphy_update_link, which I see reads from MII_BMSR.BMSR_LSTATUS It looks like the DP83620 may do something similar, and the fiber status may be accesible from some other register. This starts to make sense, thanks for setting my on track! Best regards! -- Alvaro G. M.