Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1369867rdb; Fri, 1 Dec 2023 14:41:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXYLteFGPYbXk0vR6Ja5F7slY6mha5k96sXjLVmlHecSwHh4NQL3eahMs5lte/U2+7KgRO X-Received: by 2002:a05:6a21:9181:b0:187:f343:ab3d with SMTP id tp1-20020a056a21918100b00187f343ab3dmr306581pzb.55.1701470484675; Fri, 01 Dec 2023 14:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701470484; cv=none; d=google.com; s=arc-20160816; b=WdihdpiJa9rXe0zVhvxAn6RmPOXAo33puIT2DZ/rp5h4F0A5+WK1z2njOHiJzP/Fxt FydckRw9d3PsLsFn6/lYzyTadY/3TooiCJNLy1i6U2sPgV3ubLH9lVjPiviD9iCL+QX1 9ciEESWcqGPQbmpwl0dQem7rCuAw9B8gwQ6x3XTsVJGHAL24gOyVpeWlUiwJSj3bIaQH J4KmskTe2sLYSm0gVaraT8PeRLvPmxf9oxB7Ke7RxCrLdfi674Bb2wxgno7Nokycotwz 5qMNspXQNLOdVHqWitn2br9QGLs82XnRNSEgH1w6eylWgXJZiVfCbXxfWReuBgMU6Caw ACMA== 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=HppQFlrOhl3DpBuO1vH2x7JNHeOPGUaD7VcYDrznbHA=; fh=KxK0sdkT89ZG822kXjt0bT+2j3LY2bIqHXfDxQ9IJcI=; b=NUGVZTt3Mw3NPgrbg1UG821SaYOjceKm2mi5j6iUWNh3wHzqOuPO8CNqN/1LupboMC StaHfQaywJ6jIl97v2YIq9dhD1jnVGB28cn2NbtdNGUELCdbVxwo8cXixa0IMZTHvOCm BjxmCxOvTKRy9SJueHTsMsVa1hl4lf4aJ1Vi6X98BRNpIdGwb1ixd1UyC9ZtPMh4XXWD hNzhGr5Ybb8SQkbzuzrDvNummtf4CBzAxLvD6Qw7TUzfs8vX1TrwNEl3c54m5ptorcm+ zhFDCJvoUwbvVRheZhxcLsGXV10BTyrpgM7a61sLqK2+Yy+gTul/ihY/+nXqrFkgQOv4 OaVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NpzgGHqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e11-20020a17090ac20b00b002850d4364f3si6313395pjt.145.2023.12.01.14.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 14:41:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NpzgGHqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 00915812F46A; Fri, 1 Dec 2023 14:41:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbjLAWlH (ORCPT + 99 others); Fri, 1 Dec 2023 17:41:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjLAWlG (ORCPT ); Fri, 1 Dec 2023 17:41:06 -0500 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8170AD; Fri, 1 Dec 2023 14:41:12 -0800 (PST) Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3b8929269a0so785402b6e.1; Fri, 01 Dec 2023 14:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701470472; x=1702075272; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=HppQFlrOhl3DpBuO1vH2x7JNHeOPGUaD7VcYDrznbHA=; b=NpzgGHqBLa4rhwf3pIJlYKpT/UzcFSF4zjZNTAySmMD8jHy83hw4NXcTcXfD2nRcbC Cl4XSG5nilG538gqgQJkiBQd9t7q7teyZrtBPGL88Llt0AGI+00hW+WZnjDIL2TeqwER o1RpCObGgcNAbbS0i7HMg+WFREEe1AU+uUh57mVVbMWPzMGsBFwfCSJWC4t4c31gO9gK PQdNtP7Y+2v0xv+L+LOu6u55OegMHN7Tlctb5pwRaCeFaotFY63HDxLqupJUxbuwk+VQ lIZ1I7krCL/kDRaBK5UXv1ldbIO+iArjNfGZaU67ncy2peahrK0eXKRdMD4dVZuAC/dV cf5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701470472; x=1702075272; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HppQFlrOhl3DpBuO1vH2x7JNHeOPGUaD7VcYDrznbHA=; b=YP/Qg9AAkj6i2+p4Ddu7AEbplTx04aN64GnWBOyJcLw+WlupUQKCsSU8W2gtzx8Vv7 3NrERNQIyzlLytPT1vM0ONiVAFSx1NOujwAU6V/jBgHPRdVIj41hh2VvfjRH0tup2yjF qoKjiRQtAJzitKysqLZ0HjqPvpU2m690K+94FZXmBZ5n2v6r8lmqWg5cjRlZty0U1J+m wH4+9JurLq23wrFtiNnplBQiyOsWbMlrjrP7CFwgWGwcS6MW0PzfOeAMzbnZesw2oBSQ QhuiEZbAoHWI0rWWwlK4x1UlaZI53A6WnyZE3IZZgLfB5/JHnfBp9dvt2vSvrNN1aIbm z+/g== X-Gm-Message-State: AOJu0Yw4yA7br1nXz9jbkf2Eb/bmbHBAa0B3Z3QQYq6n1msEloKTuXBc WD4Ooi989K7G6Wz/X5bR8OU= X-Received: by 2002:a05:6358:2606:b0:16b:c43f:3da4 with SMTP id l6-20020a056358260600b0016bc43f3da4mr279561rwc.3.1701470471955; Fri, 01 Dec 2023 14:41:11 -0800 (PST) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id js3-20020a17090b148300b002809822545dsm3626410pjb.32.2023.12.01.14.41.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Dec 2023 14:41:11 -0800 (PST) Message-ID: Date: Fri, 1 Dec 2023 14:41:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: mdio: enable optional clock when registering a phy from devicetree Content-Language: en-US To: Heiko Stuebner , andrew@lunn.ch, hkallweit1@gmail.com 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, quentin.schulz@theobroma-systems.com, Heiko Stuebner References: <20231201142453.324697-1-heiko@sntech.de> From: Florian Fainelli In-Reply-To: <20231201142453.324697-1-heiko@sntech.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 14:41:17 -0800 (PST) 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. -- Florian