netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Marco Felsch <m.felsch@pengutronix.de>,
	Marek Vasut <marex@denx.de>, Rob Herring <robh+dt@kernel.org>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
	linux-kernel@vger.kernel.org, mkl@pengutronix.de,
	kernel@pengutronix.de, David Jander <david@protonic.nl>
Subject: Re: PHY reset question
Date: Wed, 7 Oct 2020 08:44:53 -0700	[thread overview]
Message-ID: <c6bce70b-c97a-1696-2113-61bd3ba6ae99@gmail.com> (raw)
In-Reply-To: <20201007104757.fntgjiwt4tst3w3f@pengutronix.de>



On 10/7/2020 3:47 AM, Marco Felsch wrote:
> Florian did you send a new version of those patches?

I did not because we had a good conversation with Rob over IRC and the 
conclusion was that the only solution that scaled across drivers, 
subsystems and type of resources (regulators, clocks, resets, etc.) was 
to have a compatible string for the given device that contains the ID. 
For Ethernet PHY or MDIO device nodes that is "ethernet-phyAAAA.BBBB".

When the bus determines the presence of such a compatible string it 
needs to bypass the dynamic identification of the device and needs to 
bind the PHY driver and the device instance directly. MDIO does that, 
and so does I2C and SPI AFAICT with the modalias/compatible (there is 
not a standardized way to runtime detect an I2C or SPI client anyway), 
while PCI and USB do not, but arguably could in the future.

For the specific use case that I had which required turning on a clock 
to the Ethernet PHY, I ended up modifying the firmware to provide that 
compatible string "ethernetAAAA.BBBB" and have the driver request the 
clock from its probe function:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/drivers/net/phy/bcm7xxx.c?id=ba4ee3c053659119472135231dbef8f6880ce1fb
-- 
Florian

  reply	other threads:[~2020-10-07 15:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  8:04 PHY reset question Oleksij Rempel
2020-10-06 19:36 ` Florian Fainelli
2020-10-06 20:24   ` Marek Vasut
2020-10-06 21:11     ` Florian Fainelli
2020-10-06 22:24       ` Marek Vasut
2020-10-07  8:14       ` Marco Felsch
2020-10-07  8:23         ` Marek Vasut
2020-10-07  9:06           ` Marco Felsch
2020-10-07  9:20             ` Marek Vasut
2020-10-07 10:47               ` Marco Felsch
2020-10-07 15:44                 ` Florian Fainelli [this message]
2020-10-07  9:50 ` Fabio Estevam
2020-10-09 14:25   ` Bruno Thomsen
2020-10-12  5:48     ` Oleksij Rempel
2020-10-12  8:25       ` Marek Vasut

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=c6bce70b-c97a-1696-2113-61bd3ba6ae99@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.felsch@pengutronix.de \
    --cc=marex@denx.de \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).