Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp1764811imc; Fri, 22 Feb 2019 10:43:31 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4brtdPydnT8N+8bFlb8qu/APjfPMb3Sicsy67ahLhRPB6W6P35Bgh+XA90Vx0434bqDiL X-Received: by 2002:a65:6099:: with SMTP id t25mr5240767pgu.448.1550861010951; Fri, 22 Feb 2019 10:43:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550861010; cv=none; d=google.com; s=arc-20160816; b=XBm3IxdYLYHqGwKGZlS0jsAR+0lNTdqyErV4CSAc6xzrNc7e2wm+bvC7WO2ZRWES+R ooBnU+BcLsgX2cqYAtOszwDwnL3Ue0DJxtJm2sBBPjpoyycQ833B1hvyMZTw0F8X3Zq4 7NtubMQ3OlLe8ZvAsJGiNbvnspGPaFu3g4r+dyMYvgSGmkqZiq2R7TVxnlCC09W5/Ork 8bFMLoJ/7QkEuQaKqIdT9p1mt3Kqdu008Td0PF0o2gH/UrSWbjXV9nWl6jKjZgUnTylv NGbQHiWF51xa2Z6uzL5qVH4GCxdxtcGczMUT7uwscdsIKTh66at7F/aw+ZIgY0ksVlxE Wofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=TGjiaNf+TchAJ9Gtpr3tqaggBXdzik2vcZtd+3yyA38=; b=EJZSfUnD3obkhgkoHpkX+Cbtqp9ilm7eopP7hRPf3xx23sfXwK8rlvsXOSXTw8PJ4k A85OU4av4u1nW+thHyP5168PPSKsOdsnVR6ZDXErhlgCZbOUUVyBREdeLK8lk4UZwqYX c2yR5khxhaCjltmqCSZ16IiUcckzBnbK5RUnF0Wm0RM7xRt1iSRrH4Dx5Adpj7+GoKTC wrkOuBnxJhM6y6voHWYT45G9PoOOwSo4uJ86m/5i/kcuMgYRlnLagD9ylHZWppVc7CuH Zv0dJ2uFqZQYiTIlSD+T/q0sG0f2jRTpVKn4kGmOqK+LO6e6C8xPfaUK9V5Awuy2hcFj vF+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IPZWTvmk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si1920453pfi.248.2019.02.22.10.43.15; Fri, 22 Feb 2019 10:43:30 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IPZWTvmk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726441AbfBVSmj (ORCPT + 99 others); Fri, 22 Feb 2019 13:42:39 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39584 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725878AbfBVSmj (ORCPT ); Fri, 22 Feb 2019 13:42:39 -0500 Received: by mail-wr1-f68.google.com with SMTP id l5so3440635wrw.6; Fri, 22 Feb 2019 10:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=TGjiaNf+TchAJ9Gtpr3tqaggBXdzik2vcZtd+3yyA38=; b=IPZWTvmkrMYwaPO/jRG33qshvJWYRMqruTRJb+clDaZnpI1ghbvZl64rmb5HxoRNOp a5kZTm8JqKmiSEAeOXqKsyEWhulm7q9Ms2hpTSk949IG9Ol0his9RW6x/yNc7i4vRz7t MUzNEyA/hgoBVGC2R5ZD+N2JIbxydJ2I9jagvflxQyZEwzfmvYY/nIiD5jVyuTiG8+x1 4im4orCPAke8lJpk98ZZEJq7yFWp16SZIm2ckWtGsAHP92CL4fKOQk13e9YB/rCThKgF fwVH1VFaUp5PfrraFfpbVNwWTImzMP9ZWZrjyizCgYDyOWWhwkDdGiVat9Rl5M6mOcRi G2ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TGjiaNf+TchAJ9Gtpr3tqaggBXdzik2vcZtd+3yyA38=; b=g3KYTdURBNUuk34DWM3jqiIEvYgC6adSwJtwGlJkWoBDqfbEYbvEfKaUUOCv574OAA EtTwgiFwdcXz8lvSOWLxRE/mwxtuSb7IEBHzc4L1+Y5qrcBOBWj0tCcBF+6kVw7xMPK9 aR00aHrFGBjrYMm0j4yU4vX6kyUowkm7R9oQ/TlD06T5FtDafswv+f4ssgSkaL4aTmuB KRuL+7eXoDLiAY0Sab4gHnS9xGED2a4zUA7WJa7Abe74LSbbSa8IgDoI8oN8MTXXBN9Y joOyIJF4F6XHRs19UCOQIfqdFkc1qK3Swt+bIJ2EsXwmpeYcNfKX9hPyV/RNrb8FiRGH aTAA== X-Gm-Message-State: AHQUAuYLItLxN8hqNIz17ktL1SviXHXruTxMkcqOBd9k1SpVsMsRvEGG k+0n1S7eCMdFrrAa2ULF1p8= X-Received: by 2002:adf:ff81:: with SMTP id j1mr4038281wrr.261.1550860956942; Fri, 22 Feb 2019 10:42:36 -0800 (PST) Received: from ?IPv6:2003:ea:8bf1:e200:881a:e62a:a902:5b57? (p200300EA8BF1E200881AE62AA9025B57.dip0.t-ipconnect.de. [2003:ea:8bf1:e200:881a:e62a:a902:5b57]) by smtp.googlemail.com with ESMTPSA id m26sm1148509wmg.13.2019.02.22.10.42.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Feb 2019 10:42:35 -0800 (PST) Subject: Re: [PATCH net-next 1/7] net: phy: marvell10g: Use get_features to get the PHY abilities To: Maxime Chevallier , davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Florian Fainelli , Russell King , linux-arm-kernel@lists.infradead.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com References: <20190221095128.28188-1-maxime.chevallier@bootlin.com> <20190221095128.28188-2-maxime.chevallier@bootlin.com> From: Heiner Kallweit Message-ID: Date: Fri, 22 Feb 2019 19:42:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190221095128.28188-2-maxime.chevallier@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.02.2019 10:51, Maxime Chevallier wrote: > The Alaska family of 10G PHYs has more abilities than the ones listed in > PHY_10GBIT_FULL_FEATURES, the exact list depending on the model. > > Make use of the newly introduced .get_features call to build this list, > using genphy_c45_pma_read_abilities to build the list of supported > linkmodes, and adding autoneg ability based on what's reported by the AN > MMD. > > .config_init is still used to validate the interface_mode. > > Signed-off-by: Maxime Chevallier > --- > drivers/net/phy/marvell10g.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c > index 9ea27acf05ad..65ef469adf58 100644 > --- a/drivers/net/phy/marvell10g.c > +++ b/drivers/net/phy/marvell10g.c > @@ -233,8 +233,6 @@ static int mv3310_resume(struct phy_device *phydev) > > static int mv3310_config_init(struct phy_device *phydev) > { > - int ret, val; > - > /* Check that the PHY interface type is compatible */ > if (phydev->interface != PHY_INTERFACE_MODE_SGMII && > phydev->interface != PHY_INTERFACE_MODE_XAUI && > @@ -242,6 +240,12 @@ static int mv3310_config_init(struct phy_device *phydev) > phydev->interface != PHY_INTERFACE_MODE_10GKR) > return -ENODEV; > > + return 0; > +} > + > +static int mv3310_get_features(struct phy_device *phydev) > +{ After my just submitted patch to include the aneg capability checking in genphy_c45_pma_read_abilities() function mv3310_get_features() isn't needed any longer and can be replaced with the generic one. But we can make this change afterwards, then you don't have to rework your series. Also I'm not sure whether there will be a 5.0-rc8 or whether beginning of next week we'll see 5.0. In the latter case we're a little bit in a hurry because the merge window will start very soon. > + int ret, val; > if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) { > val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1); > if (val < 0) > @@ -429,7 +433,7 @@ static struct phy_driver mv3310_drivers[] = { > .phy_id = 0x002b09aa, > .phy_id_mask = MARVELL_PHY_ID_MASK, > .name = "mv88x3310", > - .features = PHY_10GBIT_FEATURES, > + .get_features = mv3310_get_features, > .soft_reset = gen10g_no_soft_reset, > .config_init = mv3310_config_init, > .probe = mv3310_probe, >