Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7426748ybp; Wed, 16 Oct 2019 08:29:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwc48TRg/AFEhcUo8ytNa3Y4vKF5llpHipicBKRmTHB6EqfnRtBCv0khut5w74a9zzOKmF7 X-Received: by 2002:a17:906:5a98:: with SMTP id l24mr41171901ejq.40.1571239768202; Wed, 16 Oct 2019 08:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571239768; cv=none; d=google.com; s=arc-20160816; b=LmNCeIGt2QdIjXMtad6gSu0aUQrBR2n/Sn35/KebBFIgAWXYtnwo6r4ky9tSdjmCeM 4wb81F1sMekezYhxVD7utV8DW8j2LwpNg7IaI+eKzApNYxI+m5yVDNQwMtOI0NEFJIKB lgN6ztG47+yBpusKAi/tPM5yZHcDMqNcuTe0A1hKp8baARh3pnPHKmvdcbCuAFdWUj3c iGnGpB1O/u1SnfYwn1f+5rdwHT4/GzACN9THZr1W0bzE1TM8azmL+91MS85irn7lqDy0 Wo99E+AUNBkbXQrugrCHJwVcskjV5B2C3XzAPGTbPQ3P7XCEcruuv4VLHxIPjVwPUDdL zEyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=u/DPJDrIf4UhJ2CXnH4/DBjA55NLgDM/BrDbflu2Mu8=; b=0rQcr+FK56n+Gy5CnaUXB6CCX/hM3f6byme5bT5keIS9JITt401+ofv++1u3mzUYr8 XbKNdGVfbEdHOYSx8HIctBFhxFaYPR19SdosRL+XlutlfDBNRgVKiBUowI2Xw+yck7+8 sr1Kj4xvgK2X+x3FkVlWjsjRftC3QpDLAxFXhnwJlWwkBy496T+UQ/2h/11kqYCPn/yH pmF/ZSEpwVf8C89ZZi7VrkNQdOoWqUmUN1fpXVhws8n7bQTMOd5awKcPXsqCsTb7g/Pw qhNC7nZpqSPDA1Xp+G/2z4818ZcmBQxzBI4Jvuxpfy4scdXUH+dsvbdjNiGqQWnAnbv+ +0cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d19si15256619ejr.163.2019.10.16.08.29.04; Wed, 16 Oct 2019 08:29:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392989AbfJPMYS convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 Oct 2019 08:24:18 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44751 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392980AbfJPMYR (ORCPT ); Wed, 16 Oct 2019 08:24:17 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iKiLU-0004AS-AG; Wed, 16 Oct 2019 14:24:04 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iKiLR-0005zs-CJ; Wed, 16 Oct 2019 14:24:01 +0200 Date: Wed, 16 Oct 2019 14:24:01 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Chris Snook , Florian Fainelli , James Hogan , Jay Cliburn , Mark Rutland , Paul Burton , Ralf Baechle , Rob Herring , Russell King , Vivien Didelot , Pengutronix Kernel Team , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org Subject: Re: [PATCH v1 1/4] net: ag71xx: port to phylink Message-ID: <20191016122401.jnldnlwruv7h5kgy@pengutronix.de> References: <20191014061549.3669-1-o.rempel@pengutronix.de> <20191014061549.3669-2-o.rempel@pengutronix.de> <20191016121216.GD4780@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT In-Reply-To: <20191016121216.GD4780@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 14:20:56 up 151 days, 18:39, 100 users, load average: 0.12, 0.11, 0.04 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 16, 2019 at 02:12:16PM +0200, Andrew Lunn wrote: > On Mon, Oct 14, 2019 at 08:15:46AM +0200, Oleksij Rempel wrote: > > The port to phylink was done as close as possible to initial > > functionality. > > Theoretically this HW can support flow control, practically seems to be not > > enough to just enable it. So, more work should be done. > > > > Signed-off-by: Oleksij Rempel > > Hi Oleksij > > Please include Russell King in Cc: in future. He was included in To:. Do you mean, I need to move him from To to Cc? > > -static void ag71xx_phy_link_adjust(struct net_device *ndev) > > +static void ag71xx_mac_validate(struct phylink_config *config, > > + unsigned long *supported, > > + struct phylink_link_state *state) > > { > > - struct ag71xx *ag = netdev_priv(ndev); > > + __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; > > + > > + if (state->interface != PHY_INTERFACE_MODE_NA && > > + state->interface != PHY_INTERFACE_MODE_GMII && > > + state->interface != PHY_INTERFACE_MODE_MII) { > > + bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS); > > + return; > > + } > > + > > + phylink_set(mask, MII); > > + > > + /* flow control is not supported */ > > > > - ag71xx_link_adjust(ag, true); > > + phylink_set(mask, 10baseT_Half); > > + phylink_set(mask, 10baseT_Full); > > + phylink_set(mask, 100baseT_Half); > > + phylink_set(mask, 100baseT_Full); > > + > > + phylink_set(mask, 1000baseT_Full); > > + phylink_set(mask, 1000baseX_Full); > > Can the MAC/PHY dynamically switch between MII and GMII? Maybe you > should only add 1G support when interface is GMII? OK, good point. > > @@ -1239,6 +1255,13 @@ static int ag71xx_open(struct net_device *ndev) > > unsigned int max_frame_len; > > int ret; > > > > + ret = phylink_of_phy_connect(ag->phylink, ag->pdev->dev.of_node, 0); > > + if (ret) { > > + netif_info(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n", > > + ret); > > netif_info seems wrong. _err()? Yes, will fix it. Regards, Oleksij. -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |