From: Andrew Lunn <andrew@lunn.ch>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Fugang Duan <fugang.duan@nxp.com>, Andrew Lunn <andrew@lunn.ch>
Subject: [PATCH net-next] net: fec: Issue error for missing but expected PHY
Date: Sun, 30 Jul 2017 22:11:06 +0200 [thread overview]
Message-ID: <1501445466-23518-1-git-send-email-andrew@lunn.ch> (raw)
If the PHY is missing but expected, e.g. because of a typ0 in the dt
file, it is not possible to open the interface. ip link returns:
RTNETLINK answers: No such device
It is not very obvious what the problem is. Add a netdev_err() in this
case to make it easier to debug the issue.
[ 21.409385] fec 2188000.ethernet eth0: Unable to connect to phy
RTNETLINK answers: No such device
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
drivers/net/ethernet/freescale/fec_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index cc0c2a58c4de..c5995f07f821 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1907,8 +1907,10 @@ static int fec_enet_mii_probe(struct net_device *ndev)
phy_dev = of_phy_connect(ndev, fep->phy_node,
&fec_enet_adjust_link, 0,
fep->phy_interface);
- if (!phy_dev)
+ if (!phy_dev) {
+ netdev_err(ndev, "Unable to connect to phy\n");
return -ENODEV;
+ }
} else {
/* check for attached phy */
for (phy_id = 0; (phy_id < PHY_MAX_ADDR); phy_id++) {
--
2.13.2
next reply other threads:[~2017-07-30 20:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-30 20:11 Andrew Lunn [this message]
2017-07-31 1:42 ` [PATCH net-next] net: fec: Issue error for missing but expected PHY Andy Duan
2017-07-31 2:26 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1501445466-23518-1-git-send-email-andrew@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=fugang.duan@nxp.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).