Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2906383iog; Mon, 27 Jun 2022 05:30:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1thgh8aWujE4WS7bUD95damLi2yFa7CgmHHnMnu1CDbqZngdzBvhQhDjqUFpVkgu3HbdqvC X-Received: by 2002:a05:6a00:179e:b0:518:9e1d:1cbd with SMTP id s30-20020a056a00179e00b005189e1d1cbdmr14740871pfg.12.1656333056144; Mon, 27 Jun 2022 05:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333056; cv=none; d=google.com; s=arc-20160816; b=z3jgw4C3Lboy8BePeFtRMF/XdwHsvvtdQmI886sLlCAjlx3xilhDZCH9QAYg6zSiu8 G2F0vbrBR2nv3CHenkXMQaj7i4S3iEQD49Z5iMy7+W2BQjGP6sBYZFS4rcocGXVsIupm X5lycmERBf54pPaHouhItCvETaGamsYeGwMLWvYO6Je6nplZQpi7Z1OkrDRxuIJaCNkz jez0T5SP2cIG5x5ck9NlR9HTJ9udr345m0jtjICWJ+SSJnO2hmN+EkLdbs8IwqeRUw5Z ixMvCT8mg8B/PhbNLH/YxN1/etoM5Jr8Iqg+zYg8Ta7IZ0I5HsaOABg1imJ3kJVfcrKE yDSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EN+9HQEGm51P10Owre/AY4+WwggTfxtgezBb00huPiY=; b=ouDJO7O0uwbLZZ90HnvzFnq/easABj+nr66lJcj3RldrKnAPAhSHuJpPv80BfGDTMA aHb7OOnlOeFoo0CUTEf3c/+PcesoD/V/jiq4zn09V0hHnBa3vcZTWONQmQ5Aepap1HTG XslNnBa4YLzvuY7RE4ic/o6R52C8ovxvkVlIp8FvsbzLlznsg7XvFkgbgod5DE+4R0wf FATLK5tQ4xyPZeTUFs2IMm2mIWELVIcTeXwzNNdhGO1r/VQcM751+v74201HgqXGNVfU WyBGskc4UpZnAnXzsjU/LSEQmom0X4Tzsaw6yzRW4SV7NNJrYzvjHcSkGjdwb/pArOEd xwJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pmNVL2qW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a056a00081300b00525626fe8c0si17084458pfk.365.2022.06.27.05.30.43; Mon, 27 Jun 2022 05:30:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pmNVL2qW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234667AbiF0LYX (ORCPT + 99 others); Mon, 27 Jun 2022 07:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234691AbiF0LYJ (ORCPT ); Mon, 27 Jun 2022 07:24:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D959C6570; Mon, 27 Jun 2022 04:24:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8CF36B81116; Mon, 27 Jun 2022 11:24:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBE36C3411D; Mon, 27 Jun 2022 11:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329043; bh=mMkmVKer74gbOMIKTqwBA5hzA8580mKSYpCDSXeUC7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmNVL2qWI8jCTfEnC0h7FQPL2SWvQxSccD5dHuWlgZAhChonkdE8PnxwfKeBgA5/M Wpw2ONMS3PPQL4kZ4BfTl0A8AHqs8KRbPX4u4Eezq4mWrl8Ip0mU+hKPWhmCl/P++E vjDccQQhIZdGjPWoTC9BkodguA+O9xqwDomO0Xvc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ondrej Spacek , Claudiu Manoil , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 030/102] phy: aquantia: Fix AN when higher speeds than 1G are not advertised Date: Mon, 27 Jun 2022 13:20:41 +0200 Message-Id: <20220627111934.360247127@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Claudiu Manoil [ Upstream commit 9b7fd1670a94a57d974795acebde843a5c1a354e ] Even when the eth port is resticted to work with speeds not higher than 1G, and so the eth driver is requesting the phy (via phylink) to advertise up to 1000BASET support, the aquantia phy device is still advertising for 2.5G and 5G speeds. Clear these advertising defaults when requested. Cc: Ondrej Spacek Fixes: 09c4c57f7bc41 ("net: phy: aquantia: add support for auto-negotiation configuration") Signed-off-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220610084037.7625-1-claudiu.manoil@nxp.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/phy/aquantia_main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia_main.c index 41e7c1432497..75a62d1cc737 100644 --- a/drivers/net/phy/aquantia_main.c +++ b/drivers/net/phy/aquantia_main.c @@ -34,6 +34,8 @@ #define MDIO_AN_VEND_PROV 0xc400 #define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15) #define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14) +#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11) +#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10) #define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4) #define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0) #define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4 @@ -230,9 +232,20 @@ static int aqr_config_aneg(struct phy_device *phydev) phydev->advertising)) reg |= MDIO_AN_VEND_PROV_1000BASET_HALF; + /* Handle the case when the 2.5G and 5G speeds are not advertised */ + if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, + phydev->advertising)) + reg |= MDIO_AN_VEND_PROV_2500BASET_FULL; + + if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, + phydev->advertising)) + reg |= MDIO_AN_VEND_PROV_5000BASET_FULL; + ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV, MDIO_AN_VEND_PROV_1000BASET_HALF | - MDIO_AN_VEND_PROV_1000BASET_FULL, reg); + MDIO_AN_VEND_PROV_1000BASET_FULL | + MDIO_AN_VEND_PROV_2500BASET_FULL | + MDIO_AN_VEND_PROV_5000BASET_FULL, reg); if (ret < 0) return ret; if (ret > 0) -- 2.35.1