netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] Clean up PHY MMD accessors
@ 2017-03-21 16:35 Russell King - ARM Linux
  2017-03-21 16:36 ` [PATCH net-next 1/7] net: phy: move phy MMD accessors to phy-core.c Russell King
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2017-03-21 16:35 UTC (permalink / raw)
  To: David S. Miller
  Cc: Woojung Huh, Florian Fainelli, netdev, linux-usb,
	Microchip Linux Driver Support, linux-arm-kernel

This series cleans up phylib's MMD accessors, so that we have a common
way of accessing the Clause 45 register set.

The current situation is far from ideal - we have phy_(read|write)_mmd()
which accesses Clause 45 registers over Clause 45 accesses, and we have
phy_(read|write)_mmd_indirect(), which accesses Clause 45 registers via
Clause 22 register 13/14.

Generic code uses the indirect methods to access standard Clause 45
features, and when we come to add Clause 45 PHY support to phylib, we
would need to make these conditional upon the PHY type, or duplicate
these functions.

An alternative solution is to merge these accessors together, and select
the appropriate access method depending upon the 802.3 clause that the
PHY conforms with.  The result is that we have a single set of
phy_(read|write)_mmd() accessors.

For cases which require special handling, we still allow PHY drivers to
override all MMD accesses - except rather than just overriding the
indirect accesses.  This keeps existing overrides working.

Combining the two also has another beneficial side effect - we get rid
of similar functions that take arguments in different orders.  The
old direct accessors took the phy structure, devad and register number,
whereas the indirect accessors took the phy structure, register number
and devad in that order.  Care must be taken when updating future
drivers that the argument order is correct, and the function name is
not merely replaced.

This patch set is against net-next.

 drivers/net/phy/Makefile      |   2 +-
 drivers/net/phy/bcm-phy-lib.c |  12 ++---
 drivers/net/phy/dp83867.c     |  25 +++++-----
 drivers/net/phy/intel-xway.c  |  26 +++++-----
 drivers/net/phy/micrel.c      |  13 +++--
 drivers/net/phy/microchip.c   |   5 +-
 drivers/net/phy/phy-core.c    | 101 ++++++++++++++++++++++++++++++++++++++
 drivers/net/phy/phy.c         | 110 ++++--------------------------------------
 drivers/net/phy/phy_device.c  |   4 +-
 drivers/net/usb/lan78xx.c     |  10 ++--
 include/linux/phy.h           |  80 +++++++++---------------------
 11 files changed, 178 insertions(+), 210 deletions(-)

RFC->v1:
- minor update patch 2 to resolve a build error that the 0-day builder
  discovered.
- reviewed-by / acked-bys added

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

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

end of thread, other threads:[~2017-03-22 19:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21 16:35 [PATCH net-next 0/7] Clean up PHY MMD accessors Russell King - ARM Linux
2017-03-21 16:36 ` [PATCH net-next 1/7] net: phy: move phy MMD accessors to phy-core.c Russell King
2017-03-21 16:36 ` [PATCH net-next 2/7] net: phy: make phy_(read|write)_mmd() generic MMD accessors Russell King
2017-03-21 16:36 ` [PATCH net-next 3/7] net: lan78xx: update for phy_(read|write)_mmd_indirect() removal Russell King
2017-03-21 16:36 ` [PATCH net-next 4/7] net: phy: switch remaining users to phy_(read|write)_mmd() Russell King
2017-03-21 16:36 ` [PATCH net-next 5/7] net: phy: convert micrel to new read_mmd/write_mmd driver methods Russell King
2017-03-21 16:37 ` [PATCH net-next 6/7] net: phy: remove the indirect MMD read/write methods Russell King
2017-03-21 16:37 ` [PATCH net-next 7/7] net: phy: clean up mmd_phy_indirect() Russell King
2017-03-22 19:43 ` [PATCH net-next 0/7] Clean up PHY MMD accessors David Miller

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