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 3B680C43334 for ; Fri, 8 Jul 2022 15:26:35 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=0LffSiwPAmJYCCK5RP8gMKOQmoAl1llYY4YZa3FPhkI=; b=M10S6UcmiT35VN nP4RiLLcvEjsyjMxMs5o0uAGrR+OBCjpbt6SacaqNqZYvdVq2ItChIFsTuiIOcWKOW9PV+bU3A2aZ d4Yp91RgKFzK3GNB08WpP0iC5w9u3Bi/odY4x2ZZuHltHxLbRMycwpjKB4A0l06DjP0WDkG+3B5no sGJnSbq7vD6lrN3FHw8CauD5DQLgCNTvOWSSQnpZALu3CNCzQYVGQLY6tCtN4VUjrwDBkAtXOUdz8 B9kNIvDQ16WrkxibQAH1H8Jl55qs3BATKF6kQPJBKjPBhYLDW4EQHLDbBWC/ovxgm5qMjOvpo6Vmb U4LNxSA5uMPPy+yG77iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9prG-004M02-NH; Fri, 08 Jul 2022 15:25:31 +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 1o9prD-004Lvb-Dj; Fri, 08 Jul 2022 15:25:29 +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=Wq0NAkd8wYLgPrcVZQ4B+mA85a1Aciftk8zEWMpxvIE=; b=vYp6Wr/FBQNvkWpnTWSQrm0eHm sh4C9d29OdqU9b2cirBGMMLlGotcNgn8Y1uuNmgXu8UnQmyQmuZUfHd0NtnTbXDuASj/gm8V7O8QJ ONtUz0DdApvahtQsDg5XcIJYpxTNN/wopAJ7FI/Nwn0KAig+R6WrNRQ3+ddh43sGlL70U/sVT//fA RfB9vmvnh+kPRHMLMolb79ANjUKaASuIGM2qBGBChbx4fK+ZOWBXIMz20KE5zSU1X2zs0Jbn2g2Xb XbZEjB+sZMBzh2cJcrd7ckXQYc29HnxXdhFqVk6mTOThqvbuBbdtltmVg3blxFKvUCgHlMaF+lAZC kHiLBy1Q==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33254) 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 1o9pqu-0005D7-O1; Fri, 08 Jul 2022 16:25:08 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1o9pqp-0006JM-29; Fri, 08 Jul 2022 16:25:03 +0100 Date: Fri, 8 Jul 2022 16:25:03 +0100 From: "Russell King (Oracle)" To: Vladimir Oltean Cc: Andrew Lunn , Heiner Kallweit , Alexandre Belloni , Alvin __ipraga , Claudiu Manoil , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , George McCollister , Hauke Mehrtens , Jakub Kicinski , Kurt Kanzenbach , Landen Chao , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , UNGLinuxDriver@microchip.com, Vivien Didelot , Woojung Huh , Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH RFC net-next 5/5] net: dsa: always use phylink for CPU and DSA ports Message-ID: References: <20220706102621.hfubvn3wa6wlw735@skbuf> <20220707152727.foxrd4gvqg3zb6il@skbuf> <20220707163831.cjj54a6ys5bceb22@skbuf> <20220707193753.2j67ni3or3bfkt6k@skbuf> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220707193753.2j67ni3or3bfkt6k@skbuf> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220708_082527_493304_9632C704 X-CRM114-Status: GOOD ( 20.18 ) 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: , 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 Hi, On Thu, Jul 07, 2022 at 10:37:53PM +0300, Vladimir Oltean wrote: > +static int dsa_port_fixup_broken_dt(struct dsa_port *dp) As I mentioned, I doubt that Andrew considers this "broken DT" as he's been promoting this as a standard DSA feature. > +{ > + struct property_entry fixed_link_props[] = { > + PROPERTY_ENTRY_BOOL("full-duplex"), > + PROPERTY_ENTRY_U32("speed", 1000), /* TODO determine actual speed */ > + {}, > + }; > + struct property_entry port_props[3] = {}; > + struct fwnode_handle *fixed_link_fwnode; > + struct fwnode_handle *new_port_fwnode; > + struct device_node *dn = dp->dn; > + phy_interface_t mode; > + int err; > + > + if (of_parse_phandle(dn, "phy-handle", 0) || > + of_phy_is_fixed_link(dn)) > + /* Nothing broken, nothing to fix. > + * TODO: As discussed with Russell, maybe phylink could provide > + * a more comprehensive helper to determine what constitutes a > + * valid fwnode binding than this guerilla kludge. > + */ > + return 0; I think this is sufficient. Yes, phylink accepts "phy" and "phy-device" because it has to for compatibility with other drivers, but the binding document for DSA quite clearly states that "phy-handle" is what DSA accepts, so DT in the kernel will be validated against the yaml file and enforce correctness here. We do need to check for "sfp" being present as well. > + > + err = of_get_phy_mode(dn, &mode); > + if (err) > + /* TODO this may be missing too, ask the driver for the > + * max-speed interface mode for this port > + */ > + mode = PHY_INTERFACE_MODE_NA; I think it would be easier to omit the phy-mode property in the swnode if it isn't present in DT, because then we can handle that in dsa_port_phylink_create() as I've done in my patch series via the ds->ops->phylink_get_caps() method. > + > + port_props[0] = PROPERTY_ENTRY_U32("reg", dp->index); You said in one of your other replies that this node we're constructing is only for phylink, do we need the "reg" property? phylink doesn't care about it. -- 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