Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1289309rdh; Fri, 24 Nov 2023 09:02:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq0YavFqJmUyJ5jbFh4TfWv7zbjXD4tY84TOMwziz5SqJADg+fWhKdR0OvVU/7qA1cqR9B X-Received: by 2002:a6b:e602:0:b0:79f:d04d:ce5a with SMTP id g2-20020a6be602000000b0079fd04dce5amr4170990ioh.2.1700845356570; Fri, 24 Nov 2023 09:02:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700845356; cv=none; d=google.com; s=arc-20160816; b=ESkpxECFPFPCVVAsCIG63pAB9WVECupWwsg215EPiN6BbeKh97N6hdQyyUiFmXJEmx Oi75jqDAcVeAvzukCtNSHDgZ7nGGV6KF3iXSrxrEqxwmbqTbUshJvLfCZm/sHMNMVz0U 0rqGiRrnEjteNHzkfjieM+45lEXYs9JctoaciV6IKky+7pWATSTeEnrXdbzxsGKOnS/Y GcJKtuh+mBOhSZAEODiwOjHPsUysMC1g8r6WtDJTKxVeWbXuhN0LFgmNSaAyGw0a5Zq7 dMNUhCOCW0iFI4Alv1I9/Mxiv95SNTfVOVpU6dgnffMOdHzo6aqsPWDDcI1xxM8k2EFB Y2KA== 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=iy9DkvTUULFctuQ4J2jQdgB4mi9Zm+S/Is3pyIli3pE=; fh=IYiqTHx7+Ko/LM0SWsd728l0p2U2qlxsLCv0esy0yH8=; b=WE++R5ggs43pld/CHXX2i3X2svLtFRRAxUi1x2PNsCG+ShNN6XU0I5uM4QMDveZFaQ BxomYHgn5GnIssrgwSrmG5veKb44JjIU9xJ+4dy2L/f1laAS/1GjjbMG0A+lBFp8cZd5 qWLiXDy/8taxkLa/iU3bevqY3gAL2/9EJG/tVOmoJRCz1wklQl3daJ7JmBZ1ItP+6BnX FjhMYGp2T2u+E/TLGfVXSip5TO35YvJdrwdSGeYalDqXm30WaBsMmr1qfM0A+V8sNpuo d+WM4Q5gjdYN6C6V2jOtlW55uvbJOMjsq2UrLa12Czn9gnkL+iuQLPDuWAgdi5+OoM2s QJeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AXjy95SV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id v22-20020a056638251600b00458ce1c9993si2088125jat.89.2023.11.24.09.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 09:02:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AXjy95SV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 642128076035; Fri, 24 Nov 2023 09:00:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345549AbjKXQ70 (ORCPT + 99 others); Fri, 24 Nov 2023 11:59:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231213AbjKXQ7X (ORCPT ); Fri, 24 Nov 2023 11:59:23 -0500 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB3A10E7; Fri, 24 Nov 2023 08:59:29 -0800 (PST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50ba73196b1so275870e87.0; Fri, 24 Nov 2023 08:59:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700845167; x=1701449967; darn=vger.kernel.org; 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=iy9DkvTUULFctuQ4J2jQdgB4mi9Zm+S/Is3pyIli3pE=; b=AXjy95SVx7PLOLq8FQTOjKJTCdCiIyebpw3ebpkNz6Pk/JJcC1TdwE+LcYq+b/wbr4 kTxChwc7TRsWisEaH/gbiWBn3+nNrSZTirX2JcI9XIjNtwwBC7BcLXRP0YLbQ01zVikE rUK9MikK7UFWWA6mnFpK4fwkyaT4k3bGY/dCrpBRR9kOhqe1cr8WlgAMnzFdFEdMYeB+ mb4mfOrbCBupZzhjLQ9CG0wJyU30TQa10vO0kcgI2KCA/93QzoFj+9W4PhAK4DXfghF8 45q+3OR9+XOf7RWBrd8pSTTmM5CqNXdy35DE+zi0K1RWmQeWxqmQZ7c1DLdJM2dKtaqO GznQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700845167; x=1701449967; 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=iy9DkvTUULFctuQ4J2jQdgB4mi9Zm+S/Is3pyIli3pE=; b=BSfH883EGVwkjAiM0rfypUIBjM4ZFGfCekbQauU0eXcqP8SlAQWWHL0qEdimMzgZlq yLe3WsxApmSu96SdhuHpMFCAtSBM6osGpkjKSs9dJnNL97LY9s9zQDqEsk3uh9lzNyVK FWq2xl7Idb2bYSaz6pzytFTzBSKAUSyerUNxHfeKnewv85XoBS1D2L7CqMhhKEy5SHok XFNUbTJQ9iPGAT1erkkOPGUUjgvRdq0kkylyzMp4oprl6r6TTeUeLnBhuRO28DIeFiqh KBR3p9wbNOgkRV+MvPxbqDYHH5pdXtF0QnrMDPDxznWyAAHIalAlVxtRiOLSV/1n+/5n Rnwg== X-Gm-Message-State: AOJu0YwruzT4Za72jEyDhfjrHgQrj7LZRBgoNZT31nmB9rSGHlh0ewF0 T4yo3KEBf2mWNlJJx3okdd4= X-Received: by 2002:a05:6512:ba1:b0:503:221:6b1a with SMTP id b33-20020a0565120ba100b0050302216b1amr3522725lfv.0.1700845167083; Fri, 24 Nov 2023 08:59:27 -0800 (PST) Received: from skbuf ([188.26.185.12]) by smtp.gmail.com with ESMTPSA id gx26-20020a170906f1da00b009ad89697c86sm2296113ejb.144.2023.11.24.08.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 08:59:26 -0800 (PST) Date: Fri, 24 Nov 2023 18:59:23 +0200 From: Vladimir Oltean To: Christian Marangi Cc: Andrew Lunn , Rob Herring , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Heiner Kallweit , Russell King , Florian Fainelli , Broadcom internal kernel review list , Daniel Golle , Qingfang Deng , SkyLake Huang , Matthias Brugger , AngeloGioacchino Del Regno , David Epping , "Russell King (Oracle)" , Harini Katakam , Simon Horman , Robert Marko , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [net-next RFC PATCH 03/14] dt-bindings: net: document ethernet PHY package nodes Message-ID: <20231124165923.p2iozsrnwlogjzua@skbuf> References: <20231120135041.15259-1-ansuelsmth@gmail.com> <20231120135041.15259-4-ansuelsmth@gmail.com> <20231121144244.GA1682395-robh@kernel.org> <655e4939.5d0a0220.d9a9e.0491@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <655e4939.5d0a0220.d9a9e.0491@mx.google.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,WEIRD_QUOTING autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 24 Nov 2023 09:00:05 -0800 (PST) On Wed, Nov 22, 2023 at 07:32:22PM +0100, Christian Marangi wrote: > Sooooo.... Sorry if I insist but I would really love to have something > ""stable"" to move this further. (the changes are easy enough so it's > really a matter of finding a good DT structure) > > Maybe a good idea would be summarize the concern and see what solution > was proposed: Sorry, I didn't follow the entire discussion. I hope I'm not too far off with my understanding of your problems. I think you are hitting some of the same points I have hit with DSA. The PHY package could be considered an SoC with lots of peripherals on it, for which you'd want separate drivers. Just like a DSA switch would. I don't think it's exactly phylib's place to deal with that, just like it's not DSA's place to deal with complex SoCs, just with the switching IP (like the Ethernet PHY IP for phylib). https://lore.kernel.org/lkml/20221222134844.lbzyx5hz7z5n763n@skbuf/ Why does the ethernet-phy-package DT binding attempt to be so grand and generic? I would expect the 180 degree opposite. Make it have a _single_ compatible of "qcom,qca807x" (but don't use an "x" wildcard, do specify the full package name). Make it have a "reg" property which is the base MDIO address of the package. Write an mdio_device driver that probes on that. The PHY core already knows that if a child on the MDIO bus has a compatible string of the normal form (not like "ethernet-phy-id004d.d0b2"), then it's looking at an mdio_device. Make the OF node of the package have an "mdio" child with its own compatible string, which represents the place where PHYs are. The driver for the "mdio" child has a very simple implementation of the mii_bus ops, which just calls into the device parent (it can assume a certain parent implementation and private data structures). Lateral to the "mdio" child node of the "qcom,qca807x" package node, you could put any other device tree properties that you want. Make the mdio_device driver for "qcom,qca807x" use shared code if you want - but keep the device tree structure hardware-specific. Look at the compatible strings that e.g. the drivers/mfd/simple-mfd-i2c.c driver probes on. You could always change the driver implementation for a certain compatible string, but you'll be stuck with the ultra-generic compatible = "ethernet-phy-package", which has the problems that you mention. > > Concern list: > 1. ethernet-phy-package MUST be placed in mdio node (not in ethernet, > the example was wrong anyway) and MUST have an addr > > Current example doesn't have an addr. I would prefer this way but > no problem in changing this. > > Solution: > - Add reg to the ethernet-phy-package node with the base address of > the PHY package (base address = the first PHY address of the > package) Correct, what I'm saying is compatible with this. > > We will have a PHY node with the same address of the PHY package > node. Each PHY node in the PHY package node will have reg set to > the REAL address in the mdio bus. If the real PHY IPs are children of the package rather than on the same level with it, I don't think this will be a problem. I wonder if some address translation could be done with the "ranges" device tree property. I've never seen this with MDIO though. > 4. Not finding a correct place to put PHY package info. > > I'm still convinced the mdio node is the correct place. > - PHY package are PHY in bundle so they are actual PHY > - We already have in the mdio node special handling (every DSA switch > use custom compatible and PHY ID is not used to probe them > normally) > - Node this way won't be treated as PHY as they won't match the PHY > node name pattern and also won't have the compatible pattern for > PHY. > > Solution: > - ethernet-phy-package node is OK given a reg is defined. I agree that it should sit under the MDIO node. I disagree with the idea of a standardized binding for PHY packages.