stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net: phy: use boolean dt properties for eee broken modes" has been added to the 4.9-stable tree
@ 2017-07-03  9:02 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-03  9:02 UTC (permalink / raw)
  To: jbrunet, alexander.levin, davem, f.fainelli, gregkh
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net: phy: use boolean dt properties for eee broken modes

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-phy-use-boolean-dt-properties-for-eee-broken-modes.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Mon Jul  3 11:00:33 CEST 2017
From: jbrunet <jbrunet@baylibre.com>
Date: Mon, 19 Dec 2016 16:05:37 +0100
Subject: net: phy: use boolean dt properties for eee broken modes

From: jbrunet <jbrunet@baylibre.com>


[ Upstream commit 57f3986231bb2c69a55ccab1d2b30a00818027ac ]

The patches regarding eee-broken-modes was merged before all people
involved could find an agreement on the best way to move forward.

While we agreed on having a DT property to mark particular modes as broken,
the value used for eee-broken-modes mapped the phy register in very direct
way. Because of this, the concern is that it could be used to implement
configuration policies instead of describing a broken HW.

In the end, having a boolean property for each mode seems to be preferred
over one bit field value mapping the register (too) directly.

Cc: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/phy/phy_device.c |   18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1633,7 +1633,7 @@ static void of_set_phy_supported(struct
 static void of_set_phy_eee_broken(struct phy_device *phydev)
 {
 	struct device_node *node = phydev->mdio.dev.of_node;
-	u32 broken;
+	u32 broken = 0;
 
 	if (!IS_ENABLED(CONFIG_OF_MDIO))
 		return;
@@ -1641,8 +1641,20 @@ static void of_set_phy_eee_broken(struct
 	if (!node)
 		return;
 
-	if (!of_property_read_u32(node, "eee-broken-modes", &broken))
-		phydev->eee_broken_modes = broken;
+	if (of_property_read_bool(node, "eee-broken-100tx"))
+		broken |= MDIO_EEE_100TX;
+	if (of_property_read_bool(node, "eee-broken-1000t"))
+		broken |= MDIO_EEE_1000T;
+	if (of_property_read_bool(node, "eee-broken-10gt"))
+		broken |= MDIO_EEE_10GT;
+	if (of_property_read_bool(node, "eee-broken-1000kx"))
+		broken |= MDIO_EEE_1000KX;
+	if (of_property_read_bool(node, "eee-broken-10gkx4"))
+		broken |= MDIO_EEE_10GKX4;
+	if (of_property_read_bool(node, "eee-broken-10gkr"))
+		broken |= MDIO_EEE_10GKR;
+
+	phydev->eee_broken_modes = broken;
 }
 
 /**


Patches currently in stable-queue which might be from jbrunet@baylibre.com are

queue-4.9/net-phy-add-an-option-to-disable-eee-advertisement.patch
queue-4.9/dt-bindings-net-add-eee-capability-constants.patch
queue-4.9/net-phy-use-boolean-dt-properties-for-eee-broken-modes.patch
queue-4.9/arm64-dts-meson-gxbb-odroidc2-fix-gbe-tx-link-breakage.patch
queue-4.9/net-phy-fix-sign-type-error-in-genphy_config_eee_advert.patch
queue-4.9/dt-bindings-net-use-boolean-dt-properties-for-eee-broken-modes.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-03  9:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-03  9:02 Patch "net: phy: use boolean dt properties for eee broken modes" has been added to the 4.9-stable tree gregkh

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