diff options
author | Russell King <linux@armlinux.org.uk> | 2019-11-27 11:45:30 +0000 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2020-01-21 22:32:48 +0100 |
commit | a1358fc7ae638b7dafe682ae764fc4d1d189b05e (patch) | |
tree | 14986f54963ffad73fd6393f6741f330c790718b /target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch | |
parent | 1c16b574c4f77a30a0268acee30be96ae0dc5948 (diff) | |
download | upstream-a1358fc7ae638b7dafe682ae764fc4d1d189b05e.tar.gz upstream-a1358fc7ae638b7dafe682ae764fc4d1d189b05e.tar.bz2 upstream-a1358fc7ae638b7dafe682ae764fc4d1d189b05e.zip |
kernel: add SFP support for Methode DM7052 NBASE-T module
Add support for Methode DM7052 NBASE-T module to OpenWRT. These
patches are taken from my "phy" branch, and will be sent for the
next kernel merge window.
Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: move patches to pending, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch')
-rw-r--r-- | target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch b/target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch new file mode 100644 index 0000000000..b3c47a054f --- /dev/null +++ b/target/linux/generic/pending-4.19/744-net-sfp-move-phy_start-phy_stop-to-phylink.patch @@ -0,0 +1,72 @@ +From e2dc261b872a92a055eb2e86ac136baf9b20f2f2 Mon Sep 17 00:00:00 2001 +From: Russell King <rmk+kernel@armlinux.org.uk> +Date: Thu, 21 Nov 2019 17:21:33 +0000 +Subject: [PATCH 647/660] net: sfp: move phy_start()/phy_stop() to phylink + +Move phy_start() and phy_stop() into the module_start and module_stop +notifications in phylink, rather than having them in the SFP code. +This gives phylink responsibility for controlling the PHY, rather +than having SFP start and stop the PHY state machine. + +Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> +--- + drivers/net/phy/phylink.c | 22 ++++++++++++++++++++++ + drivers/net/phy/sfp.c | 2 -- + 2 files changed, 22 insertions(+), 2 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -1717,6 +1717,26 @@ static int phylink_sfp_module_insert(voi + return ret; + } + ++static int phylink_sfp_module_start(void *upstream) ++{ ++ struct phylink *pl = upstream; ++ ++ /* If this SFP module has a PHY, start the PHY now. */ ++ if (pl->phydev) ++ phy_start(pl->phydev); ++ ++ return 0; ++} ++ ++static void phylink_sfp_module_stop(void *upstream) ++{ ++ struct phylink *pl = upstream; ++ ++ /* If this SFP module has a PHY, stop it. */ ++ if (pl->phydev) ++ phy_stop(pl->phydev); ++} ++ + static void phylink_sfp_link_down(void *upstream) + { + struct phylink *pl = upstream; +@@ -1752,6 +1772,8 @@ static const struct sfp_upstream_ops sfp + .attach = phylink_sfp_attach, + .detach = phylink_sfp_detach, + .module_insert = phylink_sfp_module_insert, ++ .module_start = phylink_sfp_module_start, ++ .module_stop = phylink_sfp_module_stop, + .link_up = phylink_sfp_link_up, + .link_down = phylink_sfp_link_down, + .connect_phy = phylink_sfp_connect_phy, +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -1320,7 +1320,6 @@ static void sfp_sm_mod_next(struct sfp * + + static void sfp_sm_phy_detach(struct sfp *sfp) + { +- phy_stop(sfp->mod_phy); + sfp_remove_phy(sfp->sfp_bus); + phy_device_remove(sfp->mod_phy); + phy_device_free(sfp->mod_phy); +@@ -1351,7 +1350,6 @@ static void sfp_sm_probe_phy(struct sfp + } + + sfp->mod_phy = phy; +- phy_start(phy); + } + + static void sfp_sm_link_up(struct sfp *sfp) |