[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200508123135.567401154@linuxfoundation.org>
Date: Fri, 8 May 2020 14:32:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, David Rivshin <drivshin@...worx.com>,
Nicolas Chauvet <kwizart@...il.com>,
Andrew Goodbody <andrew.goodbody@...brionix.com>,
Mugunthan V N <mugunthanvnm@...com>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH 4.4 158/312] drivers: net: cpsw: dont ignore phy-mode if phy-handle is used
From: David Rivshin <drivshin@...worx.com>
commit ae092b5bded24d5dc7dae0e0aef4669c169ce874 upstream.
The phy-mode emac property was only being processed in the phy_id
or fixed-link cases. However if phy-handle was specified instead,
an error message would complain about the lack of phy_id or
fixed-link, and then jump past the of_get_phy_mode(). This would
result in the PHY mode defaulting to MII, regardless of what the
devicetree specified.
Fixes: 9e42f715264f ("drivers: net: cpsw: add phy-handle parsing")
Signed-off-by: David Rivshin <drivshin@...worx.com>
Tested-by: Nicolas Chauvet <kwizart@...il.com>
Tested-by: Andrew Goodbody <andrew.goodbody@...brionix.com>
Reviewed-by: Mugunthan V N <mugunthanvnm@...com>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/net/ethernet/ti/cpsw.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2060,7 +2060,11 @@ static int cpsw_probe_dt(struct cpsw_pla
slave_data->phy_node = of_parse_phandle(slave_node,
"phy-handle", 0);
parp = of_get_property(slave_node, "phy_id", &lenp);
- if (of_phy_is_fixed_link(slave_node)) {
+ if (slave_data->phy_node) {
+ dev_dbg(&pdev->dev,
+ "slave[%d] using phy-handle=\"%s\"\n",
+ i, slave_data->phy_node->full_name);
+ } else if (of_phy_is_fixed_link(slave_node)) {
struct device_node *phy_node;
struct phy_device *phy_dev;
@@ -2097,7 +2101,9 @@ static int cpsw_probe_dt(struct cpsw_pla
PHY_ID_FMT, mdio->name, phyid);
put_device(&mdio->dev);
} else {
- dev_err(&pdev->dev, "No slave[%d] phy_id or fixed-link property\n", i);
+ dev_err(&pdev->dev,
+ "No slave[%d] phy_id, phy-handle, or fixed-link property\n",
+ i);
goto no_phy_slave;
}
slave_data->phy_if = of_get_phy_mode(slave_node);
Powered by blists - more mailing lists