Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4444650imw; Tue, 19 Jul 2022 06:47:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vgBjfaFGhEuhknV5o1wks96FSFJACNAJ63dozs/9ITR92kAbtDMi0r47N7h4PgW2zioH+O X-Received: by 2002:a05:6402:1a35:b0:43a:f63f:af56 with SMTP id be21-20020a0564021a3500b0043af63faf56mr44287532edb.59.1658238429575; Tue, 19 Jul 2022 06:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238429; cv=none; d=google.com; s=arc-20160816; b=sZ6Qv0Y5HoJuia2H6nbpJSaOh/HZi5B1p1XWEgkvf/bELK4K/RFf/EMkfGjPK70/Jk 5KV5gjhIQelCvr8MYLxrSNnquSvMYCyxBshLvRlaFRubzc51y4WPGq0v8e6/4yUZqhpj eYuuRUsHVF55w/zyASjg3GVLqWe5+FVQWdVeahB5M07V1oP6c7dD9xgiXDgVjqPOO2Sx ueTWkdttDjX2fRHPdX3tAft1d0atOCNXsENoUfAmQpZUdKJHh9DXzsNHgmg0YeabwUCH 0iuh6DiZLXfAfPKo4IuqPG+/9L7mwdY9aLWHfvZvJjLnbiJuyq7Tzme6hkPNrLzEssj7 YF9g== 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=Mya0z9qXk/au266GtSIFDQLHnld5LGrIYrwVq98w9s0=; b=K6stRU6nSf3BPIO05/J+OaKvC56j+zCP2MWmgSqo4yLSVapUs3l9m2R00bteCLi/7w WZynfNwpNJDCM2QQmTBFglLRuptB4WPDjA8hcy58/QG33opqp7XLcGUnVMY1sxHWva8T 8rGV8uriOSa9CpF8KkTtCOeuNtD3woFLOxAeWU0cZTNSsirNHclbDIKeTlmz9UePk7iC p8U1rcLxZjbQHDmyLwkbQJ+QjJfisqP295TCTCPiF/Soj7X1VS/ca1xuRDQe7TLyZH5G X/jtB2b9lmNkW71vai/jVqJG0xiShrzrkVi33EQbsszY62xMdpBjXeXkkyk9nA2RQuBL mNLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ChRl3SbH; 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 y12-20020a170906470c00b007136091f459si16041691ejq.302.2022.07.19.06.46.45; Tue, 19 Jul 2022 06:47:09 -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=ChRl3SbH; 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 S237528AbiGSL5r (ORCPT + 99 others); Tue, 19 Jul 2022 07:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237523AbiGSL5T (ORCPT ); Tue, 19 Jul 2022 07:57:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6404422C4; Tue, 19 Jul 2022 04:56:42 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5B92261658; Tue, 19 Jul 2022 11:56:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A7C0C341CA; Tue, 19 Jul 2022 11:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658231800; bh=tNFsWT8r4Tv5ckavuaA5jHy/y482DqnuFr8g7YAfZy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChRl3SbHKcLwrg9pLRXqn5awapfEZLVEz7l0uhUAxSaWtjpsxMXrHbb2K24weXbCd 3Q3FiqQeCXnEZ/pH5Pi6paSpyKxdWOspi63ArJeFf/9ph3+p86f0muphE/Hf7gIVS0 16leWfwHuE0Elx2R7JCeIEwAm2Gy7guvCzGI2/rU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Berger , Florian Fainelli , Jakub Kicinski Subject: [PATCH 4.9 07/28] net: dsa: bcm_sf2: force pause link settings Date: Tue, 19 Jul 2022 13:53:45 +0200 Message-Id: <20220719114457.169545594@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114455.701304968@linuxfoundation.org> References: <20220719114455.701304968@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.8 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 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: Doug Berger commit 7c97bc0128b2eecc703106112679a69d446d1a12 upstream. The pause settings reported by the PHY should also be applied to the GMII port status override otherwise the switch will not generate pause frames towards the link partner despite the advertisement saying otherwise. Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver") Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220623030204.1966851-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/bcm_sf2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -600,7 +600,9 @@ static void bcm_sf2_sw_adjust_link(struc struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); struct ethtool_eee *p = &priv->port_sts[port].eee; u32 id_mode_dis = 0, port_mode; + u16 lcl_adv = 0, rmt_adv = 0; const char *str = NULL; + u8 flowctrl = 0; u32 reg; switch (phydev->interface) { @@ -667,10 +669,27 @@ force_link: break; } + if (phydev->duplex == DUPLEX_FULL && + phydev->autoneg == AUTONEG_ENABLE) { + if (phydev->pause) + rmt_adv = LPA_PAUSE_CAP; + if (phydev->asym_pause) + rmt_adv |= LPA_PAUSE_ASYM; + if (phydev->advertising & ADVERTISED_Pause) + lcl_adv = ADVERTISE_PAUSE_CAP; + if (phydev->advertising & ADVERTISED_Asym_Pause) + lcl_adv |= ADVERTISE_PAUSE_ASYM; + flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv); + } + if (phydev->link) reg |= LINK_STS; if (phydev->duplex == DUPLEX_FULL) reg |= DUPLX_MODE; + if (flowctrl & FLOW_CTRL_TX) + reg |= TXFLOW_CNTL; + if (flowctrl & FLOW_CTRL_RX) + reg |= RXFLOW_CNTL; core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port));