Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3405067pxb; Mon, 18 Oct 2021 14:40:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/eDTYbDVZOfVBcG7sf3bXYryaU1a3t/u7XIi/CdAZlURy7woFhu9WJ/ygmylE+4Gfgjf/ X-Received: by 2002:a17:90a:9744:: with SMTP id i4mr1670067pjw.241.1634593215076; Mon, 18 Oct 2021 14:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634593215; cv=none; d=google.com; s=arc-20160816; b=U5TD7tRrOF1AOxMpkgpTiQaM0Qq8D9Gbt517XLzuHVq13yYi66rh7kNOA6abYAdkWh K4de1+d8HeRdtEil/aPEz5VUV/9ARcBR5YB0LdFcMdfHy1Efc+11VOko0oWWnvH+pfhx zhlFgGytTdD3HJIjiYZR0nZt6oEWIMGxwjwHu+W04sho012xprWRbdH8j8DUCOHSpqG+ YKtXSXy2M7O70WgvVWHwKYP/YCvvyy0+5TIbWIvMJ3u0tsSSnmurhpY+tgaoze3BHGrt slmeH6WJpdiuKOcA4b8DI/D5rudbyBVKAYlLML/hmU4QIV5oWvq/P3l+OJ1KLdvml8zQ C4kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=WgZVH2o58S2b3z+JLYDkc0nTLqWy8/84Xlffw5Y2nuQ=; b=WNH4x4UOPVLyqeXTGwpCmqKuTi89DNVGdtRVFy0xQOWL6i/kAu05iizMOoNHtp9IPN +s+BjBVrl9Msmfi1hmZh2qj19P+x5TmBMg6rDaKBLvx4XlwY0I5JQ3s35hhTWFvebFpi 5uzqxmpwvPnE3Oo8zr0c1N0CrHROSD9YNjEv9RdeS2+GH6KEJsC2vyEF5z2u42PrVJEE eULc6UHASgqk6lQWdAQiBFjUSemyQj8sW3NlfZdW68B/NMB35JHkmuixD9StKHa+sA64 j+c18RWC2OBKKXgUd1Rcs+yMPTOCAydqBMZA3riAPiEsB9EKJywkStdFbRlIqJVukh9d owzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=TEKI4v8z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h191si6260183pge.456.2021.10.18.14.40.02; Mon, 18 Oct 2021 14:40:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=TEKI4v8z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233764AbhJRVkU (ORCPT + 99 others); Mon, 18 Oct 2021 17:40:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:45292 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233899AbhJRVkM (ORCPT ); Mon, 18 Oct 2021 17:40:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=WgZVH2o58S2b3z+JLYDkc0nTLqWy8/84Xlffw5Y2nuQ=; b=TEKI4v8zBXvSqIsZ0q6cWiLB1H ci08Ty4rj4zxQ29sKpqLyv/lIe2V5NZpJZMLiqJGy+nuMu3dUm3GU0jGeL5SuRqMbWVTaSxbDnkMw 1mHkEiYJIsnGZu4SVfJ+T/wZ986bl0Y0X/T/9DAQCViWH+JVTeJgoEXD+MitjWQycmQE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mcaKO-00B0ml-NW; Mon, 18 Oct 2021 23:37:52 +0200 Date: Mon, 18 Oct 2021 23:37:52 +0200 From: Andrew Lunn To: Luo Jie Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sricharan@codeaurora.org Subject: Re: [PATCH v3 08/13] net: phy: add qca8081 config_aneg Message-ID: References: <20211018033333.17677-1-luoj@codeaurora.org> <20211018033333.17677-9-luoj@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211018033333.17677-9-luoj@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 11:33:28AM +0800, Luo Jie wrote: > Reuse at803x phy driver config_aneg excepting > adding 2500M auto-negotiation. > > Signed-off-by: Luo Jie > --- > drivers/net/phy/at803x.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > index 0c22ef735230..c124d3fe40fb 100644 > --- a/drivers/net/phy/at803x.c > +++ b/drivers/net/phy/at803x.c > @@ -1084,7 +1084,30 @@ static int at803x_config_aneg(struct phy_device *phydev) > return ret; > } > > - return genphy_config_aneg(phydev); > + /* Do not restart auto-negotiation by setting ret to 0 defautly, > + * when calling __genphy_config_aneg later. > + */ > + ret = 0; > + > + if (phydev->drv->phy_id == QCA8081_PHY_ID) { > + int phy_ctrl = 0; > + > + /* The reg MII_BMCR also needs to be configured for force mode, the > + * genphy_config_aneg is also needed. > + */ > + if (phydev->autoneg == AUTONEG_DISABLE) > + genphy_c45_pma_setup_forced(phydev); > + > + if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, phydev->advertising)) > + phy_ctrl = MDIO_AN_10GBT_CTRL_ADV2_5G; > + > + ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, > + MDIO_AN_10GBT_CTRL_ADV2_5G, phy_ctrl); Does the PHY also have MDIO_MMD_AN, MDIO_AN_ADVERTISE ? I'm wondering if you can use genphy_c45_an_config_aneg() Andrew