]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jan 2020 09:26:07 +0000 (10:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jan 2020 09:26:07 +0000 (10:26 +0100)
added patches:
net-ethtool-add-back-transceiver-type.patch
net-phy-keep-reporting-transceiver-type.patch

queue-4.9/net-ethtool-add-back-transceiver-type.patch [new file with mode: 0644]
queue-4.9/net-phy-keep-reporting-transceiver-type.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/net-ethtool-add-back-transceiver-type.patch b/queue-4.9/net-ethtool-add-back-transceiver-type.patch
new file mode 100644 (file)
index 0000000..39214c3
--- /dev/null
@@ -0,0 +1,68 @@
+From 19cab8872692960535aa6d12e3a295ac51d1a648 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Wed, 20 Sep 2017 15:52:13 -0700
+Subject: net: ethtool: Add back transceiver type
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+commit 19cab8872692960535aa6d12e3a295ac51d1a648 upstream.
+
+Commit 3f1ac7a700d0 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
+deprecated the ethtool_cmd::transceiver field, which was fine in
+premise, except that the PHY library was actually using it to report the
+type of transceiver: internal or external.
+
+Use the first word of the reserved field to put this __u8 transceiver
+field back in. It is made read-only, and we don't expect the
+ETHTOOL_xLINKSETTINGS API to be doing anything with this anyway, so this
+is mostly for the legacy path where we do:
+
+ethtool_get_settings()
+-> dev->ethtool_ops->get_link_ksettings()
+   -> convert_link_ksettings_to_legacy_settings()
+
+to have no information loss compared to the legacy get_settings API.
+
+Fixes: 3f1ac7a700d0 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/uapi/linux/ethtool.h |    6 +++++-
+ net/core/ethtool.c           |    2 ++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/include/uapi/linux/ethtool.h
++++ b/include/uapi/linux/ethtool.h
+@@ -1687,6 +1687,8 @@ enum ethtool_reset_flags {
+  *    %ethtool_link_mode_bit_indices for the link modes, and other
+  *    link features that the link partner advertised through
+  *    autonegotiation; 0 if unknown or not applicable.  Read-only.
++ * @transceiver: Used to distinguish different possible PHY types,
++ *    reported consistently by PHYLIB.  Read-only.
+  *
+  * If autonegotiation is disabled, the speed and @duplex represent the
+  * fixed link mode and are writable if the driver supports multiple
+@@ -1738,7 +1740,9 @@ struct ethtool_link_settings {
+       __u8    eth_tp_mdix;
+       __u8    eth_tp_mdix_ctrl;
+       __s8    link_mode_masks_nwords;
+-      __u32   reserved[8];
++      __u8    transceiver;
++      __u8    reserved1[3];
++      __u32   reserved[7];
+       __u32   link_mode_masks[0];
+       /* layout of link_mode_masks fields:
+        * __u32 map_supported[link_mode_masks_nwords];
+--- a/net/core/ethtool.c
++++ b/net/core/ethtool.c
+@@ -514,6 +514,8 @@ convert_link_ksettings_to_legacy_setting
+               = link_ksettings->base.eth_tp_mdix;
+       legacy_settings->eth_tp_mdix_ctrl
+               = link_ksettings->base.eth_tp_mdix_ctrl;
++      legacy_settings->transceiver
++              = link_ksettings->base.transceiver;
+       return retval;
+ }
diff --git a/queue-4.9/net-phy-keep-reporting-transceiver-type.patch b/queue-4.9/net-phy-keep-reporting-transceiver-type.patch
new file mode 100644 (file)
index 0000000..c413af9
--- /dev/null
@@ -0,0 +1,37 @@
+From ceb628134a75564d7bfa8e4ef902e6e588339e11 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli@gmail.com>
+Date: Wed, 20 Sep 2017 15:52:14 -0700
+Subject: net: phy: Keep reporting transceiver type
+
+From: Florian Fainelli <f.fainelli@gmail.com>
+
+commit ceb628134a75564d7bfa8e4ef902e6e588339e11 upstream.
+
+With commit 2d55173e71b0 ("phy: add generic function to support
+ksetting support"), we lost the ability to report the transceiver type
+like we used to. Now that we have added back the transceiver type to
+ethtool_link_settings, we can report it back like we used to and have no
+loss of information.
+
+Fixes: 3f1ac7a700d0 ("net: ethtool: add new ETHTOOL_xLINKSETTINGS API")
+Fixes: 2d55173e71b0 ("phy: add generic function to support ksetting support")
+Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/phy/phy.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -463,7 +463,8 @@ int phy_ethtool_ksettings_get(struct phy
+               cmd->base.port = PORT_BNC;
+       else
+               cmd->base.port = PORT_MII;
+-
++      cmd->base.transceiver = phy_is_internal(phydev) ?
++                              XCVR_INTERNAL : XCVR_EXTERNAL;
+       cmd->base.phy_address = phydev->mdio.addr;
+       cmd->base.autoneg = phydev->autoneg;
+       cmd->base.eth_tp_mdix_ctrl = phydev->mdix;
index 6fd1f5eeea92aa3b507d9950c838e8005e37720d..f21ddea4ca7427632d3b99e49fd83d9c97506000 100644 (file)
@@ -231,3 +231,5 @@ drm-radeon-fix-bad-dma-from-interrupt_cntl2.patch
 arm64-dts-juno-fix-uart-frequency.patch
 ib-iser-fix-dma_nents-type-definition.patch
 m68k-call-timer_interrupt-with-interrupts-disabled.patch
+net-ethtool-add-back-transceiver-type.patch
+net-phy-keep-reporting-transceiver-type.patch