public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Heiko Stuebner <heiko@sntech.de>, 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 <heiko.stuebner@cherry.de>
Subject: Re: [PATCH] net: mdio: enable optional clock when registering a phy from devicetree
Date: Fri, 1 Dec 2023 14:41:09 -0800	[thread overview]
Message-ID: <ecbdcfb7-32ab-45cc-991a-982c52bf4b14@gmail.com> (raw)
In-Reply-To: <20231201142453.324697-1-heiko@sntech.de>

On 12/1/23 06:24, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> 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


  parent reply	other threads:[~2023-12-01 22:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 14:24 [PATCH] net: mdio: enable optional clock when registering a phy from devicetree Heiko Stuebner
2023-12-01 22:15 ` Andrew Lunn
2023-12-04  9:43   ` Quentin Schulz
2023-12-06 16:04     ` Andrew Lunn
2023-12-01 22:41 ` Florian Fainelli [this message]
2023-12-04 10:14   ` Quentin Schulz
2023-12-04 10:22     ` Heiko Stübner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecbdcfb7-32ab-45cc-991a-982c52bf4b14@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=heiko.stuebner@cherry.de \
    --cc=heiko@sntech.de \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quentin.schulz@theobroma-systems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox