summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-12-20 13:50:51 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-20 13:50:51 -0500
commitfb3dc5b8adef1b05e2ca2a48db9fcf1a35ae9a1e (patch)
treeaa26f239778a5429318bb40b26ac3479fa5e45e5 /drivers/net
parent0a28cfd51e17f4f0a056bcf66bfbe492c3b99f38 (diff)
parent308d3165d8b2b98d3dc3d97d6662062735daea67 (diff)
downloadlinux-fb3dc5b8adef1b05e2ca2a48db9fcf1a35ae9a1e.tar.bz2
Merge branch 'phy-broken-modes'
Jerome Brunet says: ==================== phy: Fix integration of eee-broken-modes The purpose of this series is to fix the integration of the ethernet phy property "eee-broken-modes" [0] The v3 of this series has been merged, missing a fix (error reported by kbuild robot) available in the v4 [1] More importantly, Florian opposed adding a DT property mapping a device register this directly [2]. The concern was that the property could be abused to implement platform configuration policy. After discussing it, I think we agreed that such information about the HW (defect) should appear in the platform DT. However, the preferred way is to add a boolean property for each EEE broken mode. [0]: http://lkml.kernel.org/r/1480326409-25419-1-git-send-email-jbrunet@baylibre.com [1]: http://lkml.kernel.org/r/1480348229-25672-1-git-send-email-jbrunet@baylibre.com [2]: http://lkml.kernel.org/r/e14a3b0c-dc34-be14-48b3-518a0ad0c080@gmail.com ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phy_device.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 9c06f8028f0c..92b08383cafa 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1187,8 +1187,8 @@ static int genphy_config_advert(struct phy_device *phydev)
*/
static int genphy_config_eee_advert(struct phy_device *phydev)
{
- u32 broken = phydev->eee_broken_modes;
- u32 old_adv, adv;
+ int broken = phydev->eee_broken_modes;
+ int old_adv, adv;
/* Nothing to disable */
if (!broken)
@@ -1665,7 +1665,7 @@ static void of_set_phy_supported(struct phy_device *phydev)
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;
@@ -1673,8 +1673,20 @@ static void of_set_phy_eee_broken(struct phy_device *phydev)
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;
}
/**