From patchwork Mon Nov 15 09:59:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12619223 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6E13C433F5 for ; Mon, 15 Nov 2021 10:01:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E60F63210 for ; Mon, 15 Nov 2021 10:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbhKOKEX (ORCPT ); Mon, 15 Nov 2021 05:04:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237135AbhKOKDG (ORCPT ); Mon, 15 Nov 2021 05:03:06 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2A8C061746 for ; Mon, 15 Nov 2021 02:00:09 -0800 (PST) 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=UqHGX3rcGMffyRRaX51NWoaTflJ0JYhvbnOwkerVOX8=; b=xsLphsG7FPYBgKUrNPvJMrzoUJ OSFilcZs+7lRusw7IWdvAuW7NVvfRTcqPUn9t25orQNWGy8VCCL5X6LcaqM4tvCYudqVSBt5Dl/Jo 64CVoOpIEYEK4XNg88F6emh5Ne/1UAHfIBp+vaQfr7joUc88I5FoWeTDP6t6D604V139Hi8S5H196 Baph8gl3sFiee0V2KflukpfY+h7gd9rOJsvdS/QDVbYt4i7Rn77/AVxE/2u4O5vGr6YDzLLXXG+FF tDo14qiV0WfUwaAiAvJKM+H2xuiuO//zMMymoPDyp00lK3ENTHRTD2Hsh5UqOLG8jU2TpkcOnIjQF 8CjMiMTQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:55630) 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 1mmYmQ-0007Ry-4s; Mon, 15 Nov 2021 10:00:02 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mmYmL-0000vz-V9; Mon, 15 Nov 2021 09:59:57 +0000 Date: Mon, 15 Nov 2021 09:59:57 +0000 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Jakub Kicinski , Marcin Wojtas , netdev@vger.kernel.org, Thomas Petazzoni Subject: [PATCH net-next 0/3] introduce generic phylink validation Message-ID: MIME-Version: 1.0 Content-Disposition: inline Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Hi, The various validate method implementations we have in phylink users have been quite repetitive but also prone to bugs. These patches introduce a generic implementation which relies solely on the supported_interfaces bitmap introduced during last cycle, and in the first patch, a bit array of MAC capabilities. MAC drivers are free to continue to do their own thing if they have special requirements - such as mvneta and mvpp2 which do not support 1000base-X without AN enabled. Most implementations currently in the kernel can be converted to call phylink_generic_validate() directly from the phylink MAC operations structure once they fill in the supported_interfaces and mac_capabilities members of phylink_config. This series introduces the generic implementation, and converts mvneta and mvpp2 to use it. drivers/net/ethernet/marvell/mvneta.c | 34 +--- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 58 +----- drivers/net/phy/phylink.c | 252 ++++++++++++++++++++++++ include/linux/phylink.h | 31 +++ 4 files changed, 296 insertions(+), 79 deletions(-)