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 DA01BC433F5 for ; Tue, 14 Dec 2021 23:47:01 +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=hT+/dMPLmuaGMsfV0eO6o9fnQCv9xDcAzo4utH6KKCk=; b=u6xnTobTYt30+y EZLBD+qA1he62OZ2J7ghW5nHuKdh7MLR68m94tMTQfaHZFuNRm0j4ezL9iFz9DwX1tC/MDxxbS1Io HJ1uGvxw0H9A4OYeIedQCUvvEy3gAW2E22oXDIcjpF2XeM5YkvCIJMlXYHuPak8Rz5WMrzfiLtmEs j2W+m4399geOXHhvGE3gt1zyYwTHysrsTn1gXCnzzmpRLpJ1I2JFbBcH36cOT/7pcop9ezirblBEL +mBC9WXsNGtgtYzI+GTlIwPjTH3bjGDUpmOXVc47wU7cVDASAJwQ7WGsIXoHab6p0CmCi6g0OMyl1 O7u9ZIUF0kTNCBmpLYCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxHUD-00G2YO-G2; Tue, 14 Dec 2021 23:45:33 +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 1mxHU9-00G2Xx-7j for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 23:45:30 +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=MCj3uEcu5c6UlruWu6bGSHyPZC5qkeb9xLdGlN1FpGc=; b=IsZndqkKv/JSXqxKDBEWJmdQZi LlElMSIgl8FII2Vs4iJlldipr5nqbC21aV4g2bnlA08PoCockhqXBObbigf+rM+uED3RJYH4vjZeN LnO4DGPj+2nEQE1Qmo0jtNMvSDQsAy9bHeIebw+F0Emun3JXLAIeimmcxeJ6GFyRRkQqEJimlN+7h wGa6DmrR4jVXe2d3rOWaEu81gAGDXVtkh8NCSrGyiLsjOvqPh0jnBGPqxmjEwzwsorAsiH77K9LNF 8Y1+2N58wwsE0/rF1k3TBLjjUyPhthM5TJ1q2/LH1MWB0Hk4RlnL+Ttz+27vRzSWdXY2l2IPZZupb RJXeq2qA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56288) 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 1mxHTu-0005Yg-VW; Tue, 14 Dec 2021 23:45:14 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mxHTq-0003vk-2y; Tue, 14 Dec 2021 23:45:10 +0000 Date: Tue, 14 Dec 2021 23:45:10 +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: <20211214233450.1488736-1-sean.anderson@seco.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211214_154529_328306_83203824 X-CRM114-Status: GOOD ( 23.29 ) 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 06:34:50PM -0500, Sean Anderson wrote: > Although most PCSs only need the interface and advertising to configure > themselves, there is an oddly named "permit_pause_to_mac" parameter > included as well, and only used by mvpp2. This parameter indicates > whether pause settings should be autonegotiated or not. mvpp2 needs this > because it cannot both set the pause mode manually and and advertise > pause support. That is, if you want to set the pause mode, you have to > advertise that you don't support flow control. We can't just > autonegotiate the pause mode and then set it manually, because if > the link goes down we will start advertising the wrong thing. So > instead, we have to set it up front during pcs_config. However, we can't > determine whether we are autonegotiating flow control based on our > advertisement (since we advertise flow control even when it is set > manually). > > So we have had this strange additional argument tagging along which is > used by one driver (though soon to be one more since mvneta has the same > problem). We could stick MLO_PAUSE_AN in the "mode" parameter, since > that contains other autonegotiation configuration. However, there are a > lot of places in the codebase which do a direct comparison (e.g. mode == > MLO_AN_FIXED), so it would be difficult to add an extra bit without > breaking things. But this whole time, mac_config has been getting the > whole state, and it has not suffered unduly. So just pass state and > eliminate these other parameters. Please no. This is a major step backwards. mac_config() suffers from the proiblem that people constantly mis-understand what they can access in "state" and what they can't. This patch introduces exactly the same problem but for a new API. I really don't want to make that same mistake again, and this patch is making that same mistake. The reason mvpp2 and mvneta are different is because they have a separate bit to allow the results of pause mode negotiation to be forwarded to the MAC, and that bit needs to be turned off if the pause autonegotiation is disabled (which is entirely different from normal autonegotiation.) -- 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