From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: [PATCH net-next 00/11] phylib consolidation
Date: Tue, 17 Dec 2019 13:38:27 +0000 [thread overview]
Message-ID: <20191217133827.GQ25745@shell.armlinux.org.uk> (raw)
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
next reply other threads:[~2019-12-17 13:38 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 13:38 Russell King - ARM Linux admin [this message]
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
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=20191217133827.GQ25745@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.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).