netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/11] phylib consolidation
@ 2019-12-17 13:38 Russell King - ARM Linux admin
  2019-12-17 13:39 ` [PATCH net-next 01/11] net: phy: remove redundant .aneg_done initialisers Russell King
                   ` (11 more replies)
  0 siblings, 12 replies; 33+ messages in thread
From: Russell King - ARM Linux admin @ 2019-12-17 13:38 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit; +Cc: David S. Miller, netdev

Hi,

Over the last few releases, there has been a push to clean up and
consolidate the phylib code. Some cases have been missed, and this
series catches those cases.

1. Remove redundant .aneg_done initialisers; calling genphy_aneg_done()
   for clause 22 PHYs is the default when .aneg_done is not set.

2. Some PHY drivers manually set phydev->pause and phydev->asym_pause,
   but we have a helper for this - phy_resolve_aneg_pause(), introduced
   in 2d880b8709c0 ("net: phy: extract pause mode").  Use this in the
   lxt, marvell and uPD60620 drivers.

   Incidentally, this brings up the question whether marvell fiber mode
   is correctly interpreting and advertising the pause parameters.

3. Add a genphy_check_and_restart_aneg() helper, which complements the
   clause 45 version of this. This will be useful for PHY drivers that
   open code this logic (e.g. marvell.c)

4. Add a genphy_read_status_fixed() helper to read the fixed-mode
   status from a clause 22 PHY.  lxt and marvell both contain copies
   of this code, so convert them over.

5. Arrange marvell driver to use genphy_read_lpa() for copper mode.
   This needs some rearrangement of the code in
   marvell_read_status_page_an(), but preserves using the PHY specific
   status register to derive the current negotiation results.

6. Simplify the marvell driver so we can use the
   genphy_read_status_fixed() helper directly rather than
   marvell_read_status_page_fixed().

7. Use positive logic in the marvell driver to determine the link
   state, and get rid of the REGISTER_LINK_STATUS definition; we
   already have a definition for this.

8. The marvell driver reads the PHY specific status register multiple
   times when determining the status: once in marvell_update_link()
   and again in marvell_read_status_page_an(). This is a waste;
   rearrange to read the status register once, and pass its value into
   marvell_read_status_page_an().  We preserve using
   genphy_update_link() for the copper side.

9. The marvell driver was using private clause 37 definitions, but we
   have clause 37 definitions in uapi/linux/mii.h. Use the generic
   definitions.

10. Switch the marvell driver to use phy_modify_changed() to modify
    the fiber advertisement.

11. Switch the marvell driver to use genphy_check_and_restart_aneg()
    introduced above rather than open-coding this functionality.

 drivers/net/phy/lxt.c        |  24 +----
 drivers/net/phy/marvell.c    | 209 ++++++++++++-------------------------------
 drivers/net/phy/mscc.c       |   6 --
 drivers/net/phy/phy_device.c |  98 +++++++++++++-------
 drivers/net/phy/uPD60620.c   |   7 +-
 include/linux/phy.h          |   2 +
 6 files changed, 129 insertions(+), 217 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

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

end of thread, other threads:[~2019-12-19 20:53 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 13:38 [PATCH net-next 00/11] phylib consolidation Russell King - ARM Linux admin
2019-12-17 13:39 ` [PATCH net-next 01/11] net: phy: remove redundant .aneg_done initialisers Russell King
2019-12-17 15:35   ` Andrew Lunn
2019-12-17 17:25   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 02/11] net: phy: use phy_resolve_aneg_pause() Russell King
2019-12-17 15:38   ` Andrew Lunn
2019-12-17 17:26   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 03/11] net: phy: add genphy_check_and_restart_aneg() Russell King
2019-12-17 15:41   ` Andrew Lunn
2019-12-17 17:27   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 04/11] net: phy: provide and use genphy_read_status_fixed() Russell King
2019-12-17 15:42   ` Andrew Lunn
2019-12-17 17:27   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 05/11] net: phy: marvell: rearrange to use genphy_read_lpa() Russell King
2019-12-17 15:44   ` Andrew Lunn
2019-12-17 17:30   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 06/11] net: phy: marvell: initialise link partner state earlier Russell King
2019-12-17 15:45   ` Andrew Lunn
2019-12-17 17:30   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 07/11] net: phy: marvell: use positive logic for link state Russell King
2019-12-17 15:46   ` Andrew Lunn
2019-12-17 17:31   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 08/11] net: phy: marvell: consolidate phy status reading Russell King
2019-12-17 13:39 ` [PATCH net-next 09/11] net: phy: marvell: use existing clause 37 definitions Russell King
2019-12-17 15:47   ` Andrew Lunn
2019-12-17 17:33   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 10/11] net: phy: marvell: use phy_modify_changed() Russell King
2019-12-17 15:48   ` Andrew Lunn
2019-12-17 17:35   ` Florian Fainelli
2019-12-17 13:39 ` [PATCH net-next 11/11] net: phy: marvell: use genphy_check_and_restart_aneg() Russell King
2019-12-17 15:48   ` Andrew Lunn
2019-12-17 17:36   ` Florian Fainelli
2019-12-19 20:52 ` [PATCH net-next 00/11] phylib consolidation 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).