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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15394C6FD1C for ; Wed, 22 Mar 2023 20:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbjCVUd3 (ORCPT ); Wed, 22 Mar 2023 16:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbjCVUdJ (ORCPT ); Wed, 22 Mar 2023 16:33:09 -0400 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 4EB317FD71; Wed, 22 Mar 2023 13:24:17 -0700 (PDT) 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=wPtgvS4lUEBCW56NBEDqzgXIhgHMsvplcJPqCgZkucQ=; b=uE65kOKtuWARTEIImwzqtSNujI ywf123h55UN4uhhZFLPdZqLArBKBI/H+cvoFtKR2/nrJ0/KWEkzSaBljRjwcfcGAO6bzEeE+IdOgO 9ngcseH6ApCLR2EMGkLppEaj4AsTZKEpSwqNKGbY+9MiZ92vX88qgH3cFnutllOE2gYqs+fWR7gd0 27kevwuzNZ+Q0QvzkypWj7uH7gl41RlycArooulMjHAImunzoV3ySzDELf4/gfdrXWHs766FRcjXR n7My9MAM0mUtAXiROCXxye6mbKOQl77WcZNWdKXnVFOvrEgAmRLtpV89CfruIi6d+9FrhhQo6Q5/4 3TGhyqsg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60688) 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 1pf4wG-0003sE-WE; Wed, 22 Mar 2023 20:20:05 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pf4wE-0000eo-Tg; Wed, 22 Mar 2023 20:20:02 +0000 Date: Wed, 22 Mar 2023 20:20:02 +0000 From: "Russell King (Oracle)" To: Andrew Lunn Cc: Heiner Kallweit , Andy Shevchenko , Daniel Scally , "David S. Miller" , Eric Dumazet , Florian Fainelli , Greg Kroah-Hartman , Heikki Krogerus , Jakub Kicinski , linux-acpi@vger.kernel.org, netdev@vger.kernel.org, Paolo Abeni , "Rafael J. Wysocki" , Sakari Ailus , Vladimir Oltean Subject: Re: [PATCH RFC net-next 5/7] net: dsa: avoid DT validation for drivers which provide default config Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Mar 22, 2023 at 09:14:31PM +0100, Andrew Lunn wrote: > On Wed, Mar 22, 2023 at 08:09:12PM +0000, Russell King (Oracle) wrote: > > On Wed, Mar 22, 2023 at 07:51:22PM +0100, Andrew Lunn wrote: > > > On Wed, Mar 22, 2023 at 12:00:16PM +0000, Russell King (Oracle) wrote: > > > > When a DSA driver (e.g. mv88e6xxx) provides a default configuration, > > > > avoid validating the DT description as missing elements will be > > > > provided by the DSA driver. > > > > > > > > Signed-off-by: Russell King (Oracle) > > > > --- > > > > net/dsa/port.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/net/dsa/port.c b/net/dsa/port.c > > > > index c30e3a7d2145..23d9970c02d3 100644 > > > > --- a/net/dsa/port.c > > > > +++ b/net/dsa/port.c > > > > @@ -1951,6 +1951,9 @@ static void dsa_shared_port_validate_of(struct dsa_port *dp, > > > > *missing_phy_mode = false; > > > > *missing_link_description = false; > > > > > > > > + if (dp->ds->ops->port_get_fwnode) > > > > + return; > > > > > > I wounder if you should actually call it for the given port, and > > > ensure it does not return -EOPNOTSUPP, or -EINVAL, etc, because it is > > > not going to override that port? Then the DT values should be > > > validated? > > > > Won't that mean that we need to implement the method for all DSA > > drivers? > > I mean call it if it exists. We should be only providing overrides for > CPU and DSA ports, i think. So i expect it returns an error for user > ports? And then we want to continue with the validation with what > actually is in DT for user ports. I suppose we could do - but before adding that complexity, I think we should have a real use case for it. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!