netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: phy: Support enabling clocks prior to bus probe
@ 2020-09-03  4:39 Florian Fainelli
  2020-09-03  4:39 ` [PATCH net-next 1/3] " Florian Fainelli
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Florian Fainelli @ 2020-09-03  4:39 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, andrew, adam.rudzinski, m.felsch, hkallweit1,
	richard.leitner, zhengdejin5, devicetree, kernel, kuba, robh+dt

Hi all,

This patch series takes care of enabling the Ethernet PHY clocks in
DT-based systems (we have no way to do it for ACPI, and ACPI would
likely keep all of this hardware enabled anyway).

Please test on your respective platforms, mine still seems to have
a race condition that I am tracking down as it looks like we are not
waiting long enough post clock enable.

The check on the clock reference count is necessary to avoid an
artificial bump of the clock reference count and to support the unbind
-> bind of the PHY driver. We could solve it in different ways.

Comments and test results welcome!

Changes since RFC:

- resolved the timing hazard on ARCH_BRCMSTB platforms, the resource
  enabling for these platforms needs to happen *right before* the
  dummy BMSR read which is needed to work around a flaw in the internal
  Gigabit PHYs MDIO logic, doing this after would not work. This means
  that we need to enable resources during bus->reset for those specific
  platforms.

- export of_mdiobus_device_enable_resources() for other drivers to use
  (like mdio-bcm-unimac), would they need it

- added boolean to keep track of resources being already enabled

- disable resources just before calling drv->probe() so as to let PHY
  drivers manage resources with a normal reference count

Florian Fainelli (3):
  net: phy: Support enabling clocks prior to bus probe
  net: phy: mdio-bcm-unimac: Enable GPHY resources during bus reset
  net: phy: bcm7xxx: request and manage GPHY clock

 drivers/net/mdio/mdio-bcm-unimac.c | 10 ++++
 drivers/net/phy/bcm7xxx.c          | 18 +++++-
 drivers/net/phy/phy_device.c       | 15 ++++-
 drivers/of/of_mdio.c               | 95 ++++++++++++++++++++++++++++++
 include/linux/of_mdio.h            | 16 +++++
 include/linux/phy.h                | 13 ++++
 6 files changed, 165 insertions(+), 2 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-09-07 19:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03  4:39 [PATCH net-next 0/3] net: phy: Support enabling clocks prior to bus probe Florian Fainelli
2020-09-03  4:39 ` [PATCH net-next 1/3] " Florian Fainelli
2020-09-03 20:39   ` Andrew Lunn
2020-09-03 21:25   ` Andrew Lunn
2020-09-03 21:28   ` Rob Herring
2020-09-03 21:42     ` Andrew Lunn
2020-09-03 21:50       ` Florian Fainelli
2020-09-03 21:43     ` Florian Fainelli
2020-09-03  4:39 ` [PATCH net-next 2/3] net: phy: mdio-bcm-unimac: Enable GPHY resources during bus reset Florian Fainelli
2020-09-03  4:39 ` [PATCH net-next 3/3] net: phy: bcm7xxx: request and manage GPHY clock Florian Fainelli
2020-09-04  6:15   ` Marco Felsch
2020-09-04 15:37     ` Florian Fainelli
2020-09-07  7:34       ` Marco Felsch
2020-09-07 19:07       ` Marco Felsch
2020-09-04  6:18   ` Marco Felsch
2020-09-04 15:38     ` Florian Fainelli
2020-09-07  7:37       ` Marco Felsch
2020-09-04  4:04 ` [PATCH net-next 0/3] net: phy: Support enabling clocks prior to bus probe Florian Fainelli
2020-09-04  6:19   ` Adam Rudziński
2020-09-04 13:45     ` Andrew Lunn
2020-09-04 14:00       ` Adam Rudziński
2020-09-04 14:23         ` Andrew Lunn
2020-09-04 17:21           ` Adam Rudziński
2020-09-04 13:58   ` Andrew Lunn

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).