From patchwork Thu Jun 13 10:35:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13696581 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 C0541C27C75 for ; Thu, 13 Jun 2024 10:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Owner; bh=XDX8tJG6OxM+mLvXyG16Cgba3hnOXG1D0oaigEUeTh0=; b=ajNm24DWcxelCNS3uDmwyj9PkX whIn/r93MC8Ji3YCJZwkRbn5qdNoctl96i1JPZBAnTI2ind3aVejokoJOF93fZeYjqI4CZBGI8yoM 40jf0gmBP6qh+TjIJ3YJgIVPGdTZV13jLay/23lhDf8inDyj/BcXzdy/1x1UPkUb7qNda7+S7vPwv 0zN2j0oEdKpyi0NJSrQ+qF8nUogSr6x6zBw+fGkHbgJ4P0WgR03D4MvicuYLAMwsaWwKLn0TQ2cn8 t3hM1PtcCw2MwVbqG6M/l4Bsp2KQqm5mKyqttQQTgxDVL2p8xOxlnMYYIBUPSFa1YXBaldDYlm1Rr NL7OJ6YA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHhnx-0000000GALu-0QeT; Thu, 13 Jun 2024 10:35:41 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHhnu-0000000GAKj-0t8w for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 10:35:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XDX8tJG6OxM+mLvXyG16Cgba3hnOXG1D0oaigEUeTh0=; b=tlmMnd2mkd7oHEs59Rc5WmY+ks HdEDuTTPJ/Pe7I+KafJeUJ1uEYlFSIiylhFt6e44nG6uzqFXe9T3orabflTEWwT6o9aYKTfnOPSar aCqltvwveJF6CjKVgMTLqHTZ7EgjIuD6Uawu+RrEO6i/SwViUmwj4mG7QoRAAy3U7tRiag4M25Nm0 KY7X9tBS/1AI/xxIzM1xLIPi9TDfwwZ1qVFZS19Oc6rp1GNy8PIDxZ3HVnhJR474maHVaFkfJLn+f KcTbK4cHHFJt3v/V0NUrl3tK6VNcI3rirJJ+fLHzCGjJL4MKGFX6JPWyH18ueW1JWc4dfyghY8kN+ NAcj1Khg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:38912) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sHhng-00064v-0I; Thu, 13 Jun 2024 11:35:24 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sHhnh-00019D-NY; Thu, 13 Jun 2024 11:35:25 +0100 Date: Thu, 13 Jun 2024 11:35:25 +0100 From: "Russell King (Oracle)" To: Serge Semin Cc: Alexandre Torgue , Andrew Halaney , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Romain Gantois Subject: [PATCH net-next v2 0/5] net: stmmac: provide platform select_pcs method Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_033538_283248_E2F63B97 X-CRM114-Status: GOOD ( 14.93 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This series adds a select_pcs() method to the stmmac platform data to allow platforms that need to provide their own PCSes to do so, moving the decision making into platform code. This avoids questions such as "what should the priority of XPCS vs some other platform PCS be?" and when we provide a PCS for the internal PCS, how that interacts with both the XPCS and platform provided PCS. Note that if a platform implements the select_pcs() method, then the return values are: - a phylink_pcs pointer - the PCS to be used. - NULL - no phylink_pcs to be used. Otherwise (if not implemented or returns an error-pointer), then allow the the stmmac internal PCS to be used if appropriate (once that patch set is merged.) Patch 1 introduces the new method. Patch 2 converts Intel mGBE to use this to provide the XPCS and removes the XPCS decision making from core code. Patch 3 provides an implementation for rzn1 to return its PCS. Patch 4 does the same for socfpga. Patch 5 removes the core code returning priv->hw->phylink_pcs. No functional change is anticipated. Once this has been merged, it will be expected that platforms should populate all three PCS methods or none of the PCS methods. v1->v2: - Fix build error in patch 2. - Add attributations from Romain Gantois. drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 11 +++++++++++ drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c | 7 +++++++ drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 7 +++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++++--- include/linux/stmmac.h | 4 +++- 5 files changed, 35 insertions(+), 4 deletions(-)