From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88438C433EF for ; Wed, 15 Dec 2021 00:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eYzfKkA5GQqRLKJ3MXEL6z+q8BPylGGWiZMzZL1qLpM=; b=R55C1vCUvZPmRx iKDXP0lDE+qGvZ2nlkpKQLBTfv+Sh0O/b/IDfllF4LD2dTEWaUkM3c9+zhTxbmv/1eejNf+/k5xTm ZOki1QsswVRTFksb6MbY4D38NaLbqSdLBESZF/FUv3ixagvj7p1trwCrc1RzCSM2Ifqd5I4CWrDN2 olG44Gl2Ga/UpLX1BL2P+57/yjkgVGIKnuygXnZhemREWKtvMMtF4vYjJD+tVcMgldR9eeYV1AMnd eNt/EUWbw85dT5ab/UcdcFlGvnMO91sE1XvMAgt/TaecqfwO4SeeaG0/k4a1HxtNSQigBDLdNiRUO aRwEwIIfWRUJBPm/Znsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxIUj-00GBIY-8u; Wed, 15 Dec 2021 00:50:10 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxIUE-00GAv6-A7 for linux-arm-kernel@lists.infradead.org; Wed, 15 Dec 2021 00:49:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=FzXY7sl5S8h2qdDHdwMRvfifQOha1K6MVJQWY3VouUE=; b=FmetdnOjOQ4EZC5waJ/JR2z1Mu e9Ed69AFfl7jAP2LroGmGeKKenHO4w2NxjKwLsqEGoc2LcEunt5N9w4sPPXiNxG5IKSaHqoeFrA1N +bvp0EIkam8bSHWcTs2VXHHQbN7zTGK4wcRfr7zfneQlaHZ2blMPC2Gf9Nk+XeAlEG32jESXoIEZR arGActGv64VhWB9d2SsUWOoUrVN1lZKcW54Dq57NVx4Eon5mBuOUqbN9h7gYk9YunZjAx9Et9tRZP ymx8bWns8p2DlCKf2BEze4G7eUPsodhdItAm6QP24mPabLNLXq0gKAmfZ0hEagINSGOabErIfdFx3 GDhgKUlw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56292) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mxITw-0005cX-Bi; Wed, 15 Dec 2021 00:49:20 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mxITq-0003zB-Kq; Wed, 15 Dec 2021 00:49:14 +0000 Date: Wed, 15 Dec 2021 00:49:14 +0000 From: "Russell King (Oracle)" To: Sean Anderson Subject: Re: [PATCH] net: phylink: Pass state to pcs_config Message-ID: References: <20211214233450.1488736-1-sean.anderson@seco.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_164938_401101_8C7684C5 X-CRM114-Status: GOOD ( 18.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Andrew Lunn , linux-kernel@vger.kernel.org, "David S . Miller" , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, Ioana Ciornei , Jakub Kicinski , Marcin Wojtas , Horatiu Vultur , Claudiu Beznea , linux-arm-kernel@lists.infradead.org, Heiner Kallweit Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Dec 14, 2021 at 07:16:53PM -0500, Sean Anderson wrote: > Ok, so let me clarify my understanding. Perhaps this can be eliminated > through a different approach. > > When I read the datasheet for mvneta (which hopefully has the same > logic here, since I could not find a datasheet for an mvpp2 device), I > noticed that the Pause_Adv bit said > > > It is valid only if flow control mode is defined by Auto-Negotiation > > (as defined by the bit). > > Which I interpreted to mean that if AnFcEn was clear, then no flow > control was advertised. But perhaps it instead means that the logic is > something like > > if (AnFcEn) > Config_Reg.PAUSE = Pause_Adv; > else > Config_Reg.PAUSE = SetFcEn; > > which would mean that we can just clear AnFcEn in link_up if the > autonegotiated pause settings are different from the configured pause > settings. Having actually played with this hardware quite a bit and observed what it sends, what it implements for advertising is: Config_Reg.PAUSE = Pause_Adv; Config_Reg gets sent over the 1000BASE-X link to the link partner, and we receive Remote_Reg from the link partner. Then, the hardware implements: if (AnFcEn) MAC_PAUSE = Config_Reg.PAUSE & Remote_Reg.PAUSE; else MAC_PAUSE = SetFcEn; In otherwords, AnFcEn controls whether the result of autonegotiation or the value of SetFcEn controls whether the MAC enables symmetric pause mode. Pause_Adv comes from the advertisement, and this is controlled from ethtool -s and somewhat by ethtool -A. AnFcEn is controlled purely and only by ethtool -A ... autoneg on|off. You can't derive this from "state". SetFcEn comes from ethtool -A ... tx and rx parameters (which must both be on or both be off.) Since we have no knowledge what Remote_Reg contains (it's not made accessible by the hardware), it's impossible to derive whether the autonegotiated pause settings are different from the configured pause settings. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel