Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2869936rwb; Sat, 8 Oct 2022 16:25:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52hBj+y95mMrHM+1qD1qeMhaRuCaYBi4zDR49xbDYdo0YDr0ZzCVrY3T5xUue01H8XsoSU X-Received: by 2002:a05:6402:3c5:b0:45b:55d8:21ff with SMTP id t5-20020a05640203c500b0045b55d821ffmr4949626edw.253.1665271552129; Sat, 08 Oct 2022 16:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665271552; cv=none; d=google.com; s=arc-20160816; b=wNIwMJmdfz+EDOvDg+T5c6WIyrMadMIMuE+SO+UbyZj4veUclIv42cqZTmWm3wwErA lbkZi78mSVMvxHgzgGbxZ4EnzVl/wwcsGmp67ZPqXEjb78tuBtkVE79z4aWTdvYANfbS /Tgcf8oK1K1G1Ni7VECkXKq/8KNeHaUnVrEfjE3FdyYiiKOD/GkJhWmv3wSBUYvnk1EP 7ec+BxaUyoS7N0SDvO8C6/8josy41mqlCd9AlSDXHK5gOPVGL0yTRmx7BOldOmlCoR82 8POfq/u9rOZpkx9jduIX9wljslCUsKbgh4JvS8W6j2zQTZRsltlW4/mL/3O11b08N6LE 5MOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6VH5NDIzcp7fJXtMgvbmUefDmE2RrqbTEDEbwjqt8MY=; b=dmUBkXgtZLwzj4ba638x26DN8BFTRBRk8xShU+/pq/CDCPeN5gKkrScFeFN1kCILxB C/kX+57d+rG0h4fWxtWLS61/k8U9F3MmgsokifEiPsbc2UwCOc2VAxIzbQjO5cfpsBfJ OAHvXBrB/TLOcanv/k3vt29zTFPYyBP5++0PMx7wUXDKvwyNCyDcb5DCUB/FTpU5toeR V+jRTrVB6Rvt9VSHdMiGklJfTbc6iN8f5ZmZUu+WsRByG6dDmH13h3SUxDemruwH/iAk oJxIVrLsHAnkZswwObSF3qlau4BlFznxNaEmO/Rybbl8lr0V5hF0HL7xeAUnrA5AmiVc efag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="F/wCTdaG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb30-20020a1709071c9e00b0078356aaeb61si6914719ejc.286.2022.10.08.16.25.17; Sat, 08 Oct 2022 16:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="F/wCTdaG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbiJHW4g (ORCPT + 99 others); Sat, 8 Oct 2022 18:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJHW4e (ORCPT ); Sat, 8 Oct 2022 18:56:34 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFBD133373; Sat, 8 Oct 2022 15:56:33 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id u21so11394370edi.9; Sat, 08 Oct 2022 15:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6VH5NDIzcp7fJXtMgvbmUefDmE2RrqbTEDEbwjqt8MY=; b=F/wCTdaGDtylRoVdcS4cDFh/5sI7hfRCO1QDt3FfK0j9g7Ly6lb9eSMnbOj+dS+JNo KufpOrwPh+bIIb8IOvDDYb8NvPGBcN6+XlEtk39oEhpcXyp/NznrRuS0sJrHJdRntDa6 AoUIrAIMw3RMVpXlx9akNgOt4cvqAN4AQwuOoVe6O8ohIN0DOf/t6oLhRbiu3N5Rmwoh CjuGVS0hxUj8iPeDj01u2Xl+5smGOfAyxhcN2ZbrThfR9LIEZiL/42zn7tN62I13kqt0 fNlersZj2CWqsZ5jhcaL+mAyKN96MeXMWTvg6SsPzo+/VkgnovTC1fGUL+iw1mzOwtuP Kvbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6VH5NDIzcp7fJXtMgvbmUefDmE2RrqbTEDEbwjqt8MY=; b=SPdI+IqjOCNlS5zOg15x2/S/AKSbzJ1gAj5ORxGOhJslF3J0YFaqjft1r3OllQJyF8 OXU4RwNewkeFH3kmT0ViFvsi+B/XPt8lrELTk6ZtRQw+aj6oYxm/YzSgkHSNPvxuRSP6 qwAPEPw506Y7v2383G+Kwqun2KMXdLErmjkQpBikog4jYpuZaELQSBEgEMSyLRLofRaW fBI/v+Tq/FIKRfjAUvqHN5B2CpJ6aByFquvrvOM/LICW21uJazwcc626S3ABoBNs3VRE YYxF0n1gPFlZ6PkVqmxvKQFW90LTzzG2qnWvWpKy1etvN8/Xud+UVQnAnHBbQk8gfT8+ aYyQ== X-Gm-Message-State: ACrzQf1Dge3ochuqRk24iJa5xQ0DH7H73HwPXR60GNml1bnsC5U92Rc/ q50848FXYHNHorGJwRnlsTY= X-Received: by 2002:a05:6402:1052:b0:459:2c49:1aed with SMTP id e18-20020a056402105200b004592c491aedmr10889998edu.212.1665269792277; Sat, 08 Oct 2022 15:56:32 -0700 (PDT) Received: from skbuf ([188.27.184.197]) by smtp.gmail.com with ESMTPSA id 18-20020a170906201200b0078c213ad441sm3291604ejo.101.2022.10.08.15.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 15:56:31 -0700 (PDT) Date: Sun, 9 Oct 2022 01:56:28 +0300 From: Vladimir Oltean To: Jerry Ray Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next][PATCH v4] dt-bindings: dsa: Add lan9303 yaml Message-ID: <20221008225628.pslsnwilrpvg3xdf@skbuf> References: <20221003164624.4823-1-jerry.ray@microchip.com> <20221003164624.4823-1-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221003164624.4823-1-jerry.ray@microchip.com> <20221003164624.4823-1-jerry.ray@microchip.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 03, 2022 at 11:46:24AM -0500, Jerry Ray wrote: > --- > v3->v4: > - Addressed v3 community feedback More specifically? > +examples: > + - | > + #include > + > + // Ethernet switch connected via mdio to the host > + ethernet { > + #address-cells = <1>; > + #size-cells = <0>; > + phy-handle = <&lan9303switch>; > + phy-mode = "rmii"; > + fixed-link { > + speed = <100>; > + full-duplex; > + }; I see the phy-handle to the switch is inherited from the .txt dt-binding, but I don't understand it. The switch is an mdio_device, not a phy_device, so what will this do? Also, any reasonable host driver will error out if it finds a phy-handle and a fixed-link in its OF node. So one of phy-handle or fixed-link must be dropped, they are bogus. Even better, just stick to the mdio node as root and drop the DSA master OF node, like other DSA dt-binding examples do. You can have dangling phandles, so "ethernet = <ðernet>" below is not an issue. > + mdio { > + #address-cells = <1>; > + #size-cells = <0>; > + lan9303switch: switch@0 { > + compatible = "smsc,lan9303-mdio"; > + reg = <0>; > + dsa,member = <0 0>; Redundant, please remove. > + ethernet-ports { > + #address-cells = <1>; > + #size-cells = <0>; > + port@0 { > + reg = <0>; > + phy-mode = "rmii"; FWIW, RMII has a MAC mode and a PHY mode. Two RMII interfaces connected in MAC mode to one another don't work. You'll have problems if you also have an RMII PHY connected to one of the xMII ports, and you describe phy-mode = "rmii" for both. There exists a "rev-rmii" phy-mode to denote an RMII interface working in PHY mode. Wonder if you should be using that here. > + ethernet = <ðernet>; > + fixed-link { > + speed = <100>; > + full-duplex; > + }; > + }; > + port@1 { > + reg = <1>; > + max-speed = <100>; > + label = "lan1"; > + }; > + port@2 { > + reg = <2>; > + max-speed = <100>; > + label = "lan2"; > + }; > + }; > + }; > + }; > + }; > + > + - | > + #include > + > + // Ethernet switch connected via i2c to the host > + ethernet { > + #address-cells = <1>; > + #size-cells = <0>; > + phy-mode = "rmii"; > + speed = <100>; > + fixed-link { > + full-duplex; > + }; > + }; No need for this node. > + > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + lan9303: switch@1a { > + compatible = "smsc,lan9303-i2c"; > + reg = <0x1a>; > + ethernet-ports { > + #address-cells = <1>; > + #size-cells = <0>; > + port@0 { > + reg = <0>; > + phy-mode = "rmii"; > + ethernet = <ðernet>; > + fixed-link { > + speed = <100>; > + full-duplex; > + }; > + }; > + port@1 { > + reg = <1>; > + max-speed = <100>; > + label = "lan1"; > + }; > + port@2 { > + reg = <2>; > + max-speed = <100>; > + label = "lan2"; > + }; > + }; > + }; > + }; > diff --git a/MAINTAINERS b/MAINTAINERS > index 5d58b55c5ae5..89055ff2838a 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -13386,6 +13386,14 @@ L: netdev@vger.kernel.org > S: Maintained > F: drivers/net/ethernet/microchip/lan743x_* > > +MICROCHIP LAN9303/LAN9354 ETHERNET SWITCH DRIVER > +M: Jerry Ray > +M: UNGLinuxDriver@microchip.com > +L: netdev@vger.kernel.org > +S: Maintained > +F: Documentation/devicetree/bindings/net/dsa/microchip,lan9303.yaml > +F: drivers/net/dsa/lan9303* > + Separate patch please? Changes to the MAINTAINERS file get applied to the "net" tree. > MICROCHIP LAN966X ETHERNET DRIVER > M: Horatiu Vultur > M: UNGLinuxDriver@microchip.com > -- > 2.25.1 >