Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp395935pxb; Tue, 19 Oct 2021 05:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdzEMl2zJSB+dwR8e3omrDzxV5TLeuNCHYDi+h5//RQUEls5TEqJjMTN37KWtQGa7/ltuI X-Received: by 2002:a50:e141:: with SMTP id i1mr54689067edl.157.1634645722738; Tue, 19 Oct 2021 05:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634645722; cv=none; d=google.com; s=arc-20160816; b=0PPXfNQeyIt8H5/K07hFZmR2cZ4yowfAozFgRVutyP7PSESGdEb+5/rnx1T0a7dm5g yDRlvF9YuyZJminb5ABdvXC+swgEfVNkJnHocZcEbwe4+K3evrvu3SuGKurBAvYsHTh/ JbGzP6TuvWlAb9GfevMIKrR1pch0L1F3PMqBU/MJhcrUFEODKwdJRE44wjh4z59hQyuV O2CCxJ862NNnIZcyCaHfLtqvVNtTtIJICzI3hrVDj0VQsVxT9a7JMagLu1qy3yhbHbs2 ilFvzRLa5nnHHyUWOTX4A/krd3NyiVZTKdVwvMKm1g+XwF8TEyZIi7IyPoi/HFUC6M9s vCog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=AAP0IMAw/zT/DZZ+e/k3WPaV5KaUEEwAiUGgzytam/c=; b=yk4eDuv/oLZw8XBlCmuufdA8KR2bM1Jk7dLCDY72u2hFNKmAQccF8bODQOhHrr7Zvk 7Sy0BYoqKCqZED/8jfhjjSDy8KCbAfE2uJSlhkzO8YT3LKtVC7xWbL8uUH9qU/nbujGt zamLezsXoIqw4C8fJ7JmdDVbjU2RpFsw8ozcZEiXC0cIxv0jrmCk+Y9hJqjVHeFQqK8U 6ihYsON/bTCTzMyD/iaKj3h5dj9o/ToKq8hLsFtn0MPB3dWFjYGkRndkU+CVaEfCmUOL kfjSi7PF96PsjxNm1OAzGLY6LDqpmcX76RPAp8hl3NfNAxJ+dY3RYf+vNlFZMTwx7YYy E7ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=aL2VbJE2; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si22832899edt.199.2021.10.19.05.14.56; Tue, 19 Oct 2021 05:15:22 -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=@mg.codeaurora.org header.s=smtp header.b=aL2VbJE2; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbhJSMPN (ORCPT + 99 others); Tue, 19 Oct 2021 08:15:13 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:30905 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbhJSMPM (ORCPT ); Tue, 19 Oct 2021 08:15:12 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1634645579; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=AAP0IMAw/zT/DZZ+e/k3WPaV5KaUEEwAiUGgzytam/c=; b=aL2VbJE2yjuhEIff9iJLcqHjh0Gc+6d2IoHR8QHgJcd1PQ3hpwU2pdemoeokxpSWrT95ve4L h/z38zE5xbYv5z6/OySzDad6b8df/mJbIwdR+OW8SlpqY6SbXeD9IzChP8Cc4y989FLyDTsB PUyNTr5NsJA5saTjvlZlI9o5wd8= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 616eb649bc30296958aedd54 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 19 Oct 2021 12:12:57 GMT Sender: quic_luoj=quicinc.com@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5C50DC43617; Tue, 19 Oct 2021 12:12:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.92.1.38] (unknown [180.166.53.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: luoj) by smtp.codeaurora.org (Postfix) with ESMTPSA id 45A6FC4338F; Tue, 19 Oct 2021 12:12:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org 45A6FC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=quicinc.com Subject: Re: [PATCH v3 08/13] net: phy: add qca8081 config_aneg To: Andrew Lunn , 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 References: <20211018033333.17677-1-luoj@codeaurora.org> <20211018033333.17677-9-luoj@codeaurora.org> From: Jie Luo Message-ID: <6a7cf7c3-f79f-b142-8900-05abd44ead65@quicinc.com> Date: Tue, 19 Oct 2021 20:12:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/19/2021 5:37 AM, Andrew Lunn wrote: > 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 Thanks Andrew for this comments, since the PHY does not have the regiser MDIO_AN_ADVERTISE, genphy_c45_an_config_aneg can't be used here.