Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2608669rdb; Mon, 4 Dec 2023 02:23:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IENwZgFKRQ55r1ogqgMAUFsX6Tdiai8Ojq3CLBW5FghZj/QBt6ggVDshP2r58Cda1fEEkfS X-Received: by 2002:a05:6a20:8fa3:b0:18f:9c4:d345 with SMTP id k35-20020a056a208fa300b0018f09c4d345mr3132074pzj.53.1701685402784; Mon, 04 Dec 2023 02:23:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701685402; cv=none; d=google.com; s=arc-20160816; b=d6GiHO4A9ULoVxOgwIscTaKrf20hZhMi5ThhfFYZwq5jbW5sP5MVZx7PpDmVTDgJ3X W/XGhldmiosXzmp0hkG4eCiPQ1tbuD9o7MIkDoiNwZpeYQENtjdslpqbaxSOvh5Qligw rGsVqFQYmZb/z8mVkiYUhOZ8ZqCKrBXylGEqK2iEdFXVTJ5+4D8hj8gJKorEII/wpTgP 902cjkr8/Q2bahRGNoJuB9r+MHxICJlWtcq7PyvKvcy++1D01hJPTYfrq2NtNaQZlKio RNsJj6dWT3lPGw/Il6rP+NoN+BJwlqu8WUeKTYyWLjOwXHxHPiPPr8C1ZNWLP8+zzdWV Kqlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=U9bmRptXlJqnH8QezEUUxqs5OTqKnYacnJMc0jzQjQ8=; fh=DbNxl2+sEBqrRj40A2yzoAJeDYe1/ofeaDMl8ViRUMQ=; b=M4K/ldStYoaYnUqQm2WEZdapzPmCIRzPfAviZL1X/ly93wGtVgjUtYcEaPPaEpRWhL dAQZrcb9V2uyVQFY1LqjwaXyE1RFwtv+HCzV3dnpLuBxvPbCtX1rKeor78CcdLZh8CDr zFZbuhNfUjMQEchWBbexXpwnUFtBhUyHgWC1II9G/ovzEexn+KLHE/UiwhL5YIxb45jX DRhiz125cddQr9AQLL7alBp0DZFomLJfa/6MHgaVsMmc6ZTZ7dLuQTYOAz6AROiJ3JnO XiBKlMfYnWDXaLB4YwlwzYnENJhYkTcy8/SYhJ7fQ4S1qn5g5zER89EpmPS5yTcX1WaQ oFYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g123-20020a636b81000000b0059779ae58a0si7599365pgc.465.2023.12.04.02.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 02:23:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 78CD28044892; Mon, 4 Dec 2023 02:23:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232459AbjLDKWT (ORCPT + 99 others); Mon, 4 Dec 2023 05:22:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234833AbjLDKWR (ORCPT ); Mon, 4 Dec 2023 05:22:17 -0500 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBB4585; Mon, 4 Dec 2023 02:22:20 -0800 (PST) Received: from i53875b61.versanet.de ([83.135.91.97] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rA65V-0003dC-Mw; Mon, 04 Dec 2023 11:22:05 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Florian Fainelli , andrew@lunn.ch, hkallweit1@gmail.com, Quentin Schulz Cc: linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Stuebner Subject: Re: [PATCH] net: mdio: enable optional clock when registering a phy from devicetree Date: Mon, 04 Dec 2023 11:22:04 +0100 Message-ID: <13590315.F0gNSz5aLb@diego> In-Reply-To: <10f8e599-940b-4b7c-8c82-8d505007f19b@theobroma-systems.com> References: <20231201142453.324697-1-heiko@sntech.de> <10f8e599-940b-4b7c-8c82-8d505007f19b@theobroma-systems.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 04 Dec 2023 02:23:17 -0800 (PST) Am Montag, 4. Dezember 2023, 11:14:12 CET schrieb Quentin Schulz: > Hi Florian, Heiko, > > On 12/1/23 23:41, Florian Fainelli wrote: > > On 12/1/23 06:24, Heiko Stuebner wrote: > >> From: Heiko Stuebner > >> > >> The ethernet-phy binding (now) specifys that phys can declare a clock > >> supply. Phy driver itself will handle this when probing the phy-driver. > >> > >> But there is a gap when trying to detect phys, because the mdio-bus needs > >> to talk to the phy to get its phy-id. Using actual phy-ids in the dt like > >> compatible = "ethernet-phy-id0022.1640", > >> "ethernet-phy-ieee802.3-c22"; > >> of course circumvents this, but in turn hard-codes the phy. > > > > But it is the established practice for situations like those where you > > need specific resources to be available in order to identify the device > > you are trying to probe/register. > > > > You can get away here with the clock API because it can operate on > > device_node, and you might be able with a bunch of other "resources" > > subsystems, but for instance with regulators, that won't work, we need a > > "struct device" which won't be created because that is exactly what we > > are trying to do. > > > > Also this only works for OF, not for ACPI or other yet to come firmware > > interface. > > > > Sorry but NACK. > > > > I am sympathetic to the idea that if you have multiple boards and you > > may have multiple PHY vendors this may not really scale, but in 2023 you > > have boot loaders aware of the Device Tree which can do all sorts of > > live DTB patching to provide the kernel with a "perfect" view of the world. > > There's a strong push towards unifying the device tree across all pieces > of SW involved, sometimes going as far as only having one binary passed > between SW stages (e.g. U-Boot passes its own DT to TF-A, and then to > the Linux kernel without actually loading anything aside from the Linux > kernel Image binary) if I remember correctly (haven't really followed > tbh). So, this is kinda a step backward for this effort. I don't like > relying on bootloader to make the kernel work, this is usually not a > great thing. I understand the reasons but am still a bit sad to not see > this done in the kernel. > > Heiko, I would personally put the ID of the PHY to be the most likely > encountered in the Linux kernel Device Tree so that if we somehow have a > broken bootloader, there's a chance some devices still work properly. HW > department said ksz9131 so we can go forward with this. hmm, I was more of the mind of having either all or none work ;-) [i.e. keeping the c.22 compatible in the main dt and having firmware add the phy-id] I.e. a bootloader doing the correct detection and fixup would insert the matching phy-id and a broken bootloader would not do this. Having some boards work that by chance have the right phy and others break would possibly create a wild goose chase if the bootloader support for phy-id-handling breaks somewhere down the line. Heiko > In U-Boot DT, we > would need a -u-boot.dtsi we change to the auto-detection compatible and > we do the magic the Linux kernel doesn't want to do and hope it's fine > for U-Boot maintainers. Once properly detected, we fixup the DT before > booting the kernel.