Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2393496rdb; Thu, 21 Sep 2023 18:26:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoeexxKr/LqN9PywhkmePJdGRcb0Pjlp+PrTBcrZW1aI7WeXU+WFmTIBTssZ5vg+vbhljx X-Received: by 2002:a05:6a20:440d:b0:15a:3285:e834 with SMTP id ce13-20020a056a20440d00b0015a3285e834mr6904847pzb.4.1695345972587; Thu, 21 Sep 2023 18:26:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695345972; cv=none; d=google.com; s=arc-20160816; b=w6x3ePWOAnLCHAtii0qTX32GAK0q9gLCUl6ehM7vFpaeZLbwlx4HDFJGkvc4y7UeWj 8ut5C2fnN65PXB2BW6VVjwoyvFhdik+ugBmhfK6wgRHe9DJgp/mdIfxGptH+4W6Qd/37 zemfattX6jPO06neEd9y/zset1c3/ErI6CWscdwjVuA/MCShBuJayJgnaj3C9vsOI2IS 9d9XjvJ9UGWtkgRMScURVgA2HRNHR8vX5Jw09+zNaHLkjsW+SZzx5I3PfbCRpjlFiZdQ IRHhFY0IODGlFPmu0WKtX5tjgcoK87rjpsmeK4NhwXcrp4jSaWTe/BRcSmrI6aC4IfPu Fv1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=j9iU/unn2B5Lg59HKhzCVV0eWDfanHflmRLaK3sdqHo=; fh=YxNSOwdpBcLQnza5L3agq+6b+zthaZKN0KJ0M1x06YE=; b=OTeO+ChEnAKgk8jw6+PKEUFsQQS/0zHDlcCKm4HDS8jltDmOhEJj4/AL+qJU+++56y 9AONCVO52pxelT3IrpeecY2s64NlLzlrkCTcYYQMDcoboWpxlou2bGi3JMPWdyhG7Jjy cgYSUWyL+zLv4CTSpMO5i71FRRgC5eSzQm+8dGn6AyiSvn3YG3sGUd+/xzgH0VhMWE71 ulnGCYnR/qOLg+lgDIJIDTHZqmHb7IAW/Mz9TyRbB7cB+sWxIOXJqzyz68x8T8eUoAQH mwPL3sAJPK64dXJafXTYLjelFKK1GGzaqqL3Q83zhE8bXxDu+/tTgEm30d5mR1MmNcil SPkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=hIAvQ8dg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u136-20020a62798e000000b0068a54522bb0si2530139pfc.144.2023.09.21.18.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 18:26:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=hIAvQ8dg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 90AE68380653; Thu, 21 Sep 2023 11:39:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbjIUSjT (ORCPT + 99 others); Thu, 21 Sep 2023 14:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbjIUSjL (ORCPT ); Thu, 21 Sep 2023 14:39:11 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7030BD2052; Thu, 21 Sep 2023 11:22:06 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8DB5DE0003; Thu, 21 Sep 2023 18:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1695320525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j9iU/unn2B5Lg59HKhzCVV0eWDfanHflmRLaK3sdqHo=; b=hIAvQ8dgDH08u0BdHXTRIonGAo3yKFcZMxt3uw1qDZt+5ypJM3sJ8rIIGEcwJHGsRoCaR2 nifRNtpjmn7gbCEdBRqJLjOFn75cZwYAcde/5iEG/trGreT3o1bM9iKxU+HgDHKAPKa+G6 Jih/l/+El0+VJyWic6ezaTZoSmTUD4vc8twqBfLOUADhLTcNE24hbSjRqw84uEROq3R32d LRudTD7HMQ1tbNO1XwIXQtasht2CBb5tWbQ7fPTz5pMthOnuUlVdU1aMrNn9xUw2PbB83C jw74tIo2/G4YcjHYlpb20jMeWYMc/0OX6IdrPVnzwLA259K7WqTosgU1i6+GRQ== Message-ID: <85cc3b27-417e-4cf4-9f77-347a338c9d67@arinc9.com> Date: Thu, 21 Sep 2023 21:21:40 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 07/10] dt-bindings: net: enforce phylink bindings on certain ethernet controllers Content-Language: en-US To: Andrew Lunn Cc: Rob Herring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Conor Dooley , George McCollister , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org References: <20230916110902.234273-1-arinc.unal@arinc9.com> <20230916110902.234273-8-arinc.unal@arinc9.com> <20230918181319.GA1445647-robh@kernel.org> <16710cf9-8911-4fed-8e2d-b19b581446c1@arinc9.com> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:39:58 -0700 (PDT) On 21.09.2023 16:00, Andrew Lunn wrote: >> - Link descriptions must be required on ethernet controllers. We don't care >> whether some Linux driver can or cannot find the PHY or set up a fixed >> link without looking at the devicetree. > > That can lead to future surprises, and breakage. > > Something which is not used is not tested, and so sometimes wrong, and > nobody knows. Say the driver is extended to a new device and actually > does need to use this never before used information. You then find it > is wrong, and you get a regression. > > We have had issues like this before. There are four rgmii phy-link > modes. We have had PHY drivers which ignored one of those modes, it > silently accepted it, but did not change the hardware to actually use > that mode. The PHY continues to use its reset defaults or strapping, > and it worked. A lot of device trees ended up using this mode. And it > was not the same as reset defaults/strapping. > > And then somebody needed that fourth mode, and made it actually > work. And all those boards wrongly using that mode broke. > > The lesson i learned from that episode is that anything in device tree > must actually be used and tested. It looks like the root cause here was the lack of dt-bindings to only allow the phy-mode values the hardware supports. What I see here is the driver change should've been tested on all different hardware the driver controls then the improper describing of hardware on the devicetree source file addressed. If a devicetree change that ensures proper describing of hardware is found to break a driver in the future, then that exposes a bug on the driver and the driver will have to be fixed. I don't see this upholding writing dt-bindings that ensures proper describing of the hardware. > >> Although I see dsa.yaml and dsa-port.yaml mostly consist of describing an >> ethernet switch with CPU port(s), there're properties that are specific to >> DSA, such as dsa,member on dsa.yaml and dsa-tag-protocol and label on >> dsa-port.yaml. > > I would say dsa,member does describe the hardware. It provides two > bits of information: > > Which cluster of switches does this switch belong to. You probably can > derive it using the DSA links between switches, which is also a > hardware property. But having it in device tree makes it simpler. > > Which switch is this within a cluster. You need to be able to say: > Send this frame out Port X of switch Y. How does a switch know it is > Y? It could be strapping, which is clearly a hardware property. > > dsa-tag-protocol is similar to phy-mode. It tells you the protocol > running between the CPU port and the SoC master interface. You often > can imply it, but again, it could be determined by strapping on the > switch. > > label is an interesting one, and probably would not be accepted if it > was proposed now. But it has been around a long time. It also does > describe the hardware, it is what is printed on the case next to the > RJ45. To make the user experience simpler, we then try to make the > linux interface name match the label on the case. Looks like we can incorporate dsa.port and dsa-port.yaml into ethernet-switch.yaml and ethernet-switch-port.yaml with adjustments. Arınç