From: Andrew Lunn Subject: Re: [PATCH net-next 7/9] net: stmmac: Integrate XGMAC into main driver flow Date: Wed, 1 Aug 2018 17:23:30 +0200 Message-ID: <20180801152330.GE32125@lunn.ch> References: <39b57ee542fc20a1c457c12e6011dc239dda8725.1533125016.git.joabreu@synopsys.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, "David S. Miller" , Joao Pinto , Giuseppe Cavallaro , Alexandre Torgue To: Jose Abreu Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:52908 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389627AbeHARJr (ORCPT ); Wed, 1 Aug 2018 13:09:47 -0400 Content-Disposition: inline In-Reply-To: <39b57ee542fc20a1c457c12e6011dc239dda8725.1533125016.git.joabreu@synopsys.com> Sender: netdev-owner@vger.kernel.org List-ID: > @@ -842,6 +863,12 @@ static void stmmac_adjust_link(struct net_device *dev) > new_state = true; > ctrl &= ~priv->hw->link.speed_mask; > switch (phydev->speed) { > + case SPEED_10000: > + ctrl |= priv->hw->link.speed10000; > + break; > + case SPEED_2500: > + ctrl |= priv->hw->link.speed2500; > + break; > case SPEED_1000: > ctrl |= priv->hw->link.speed1000; > break; Hi Jose What PHY did you test this with? 10G phys change the interface mode when the speed change. In general, 10/100/1000G copper uses SGMII. A 1G SFP optical module generally wants 1000Base-X. 2.5G wants 2500Base-X, 10G copper wants 10GKR, etc. So your adjust link callback needs to look at phydev->interface and reconfigure the MAC as requested. You might also want to consider moving from phylib to phylink. It has a better interface for things like this, and makes support for SFP interfaces much easier. A MAC which supports 10G is likely to be used with SFPs... Andrew