LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: <vladimir.oltean@nxp.com>, <claudiu.manoil@nxp.com>,
	<alexandre.belloni@bootlin.com>, <UNGLinuxDriver@microchip.com>,
	<davem@davemloft.net>, <kuba@kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Horatiu Vultur <horatiu.vultur@microchip.com>
Subject: [PATCH net-next] net: mscc: ocelot: Fix probe for vsc7514
Date: Tue, 17 Aug 2021 14:06:33 +0200	[thread overview]
Message-ID: <20210817120633.404790-1-horatiu.vultur@microchip.com> (raw)

The check for parsing the 'phy-handle' was removed in the blamed commit.
Therefor it would try to create phylinks for each port and connect to
the phys. But on ocelot_pcb123 and ocelot_pcb120 not all the ports have
a phy, so this will failed. So the probe of the network driver will
fail.

The fix consists in adding back the check for 'phy-handle' for vsc7514

Fixes: e6e12df625f2 ("net: mscc: ocelot: convert to phylink")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 18aed504f45d..96ac64f13382 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -954,6 +954,9 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev,
 		if (of_property_read_u32(portnp, "reg", &reg))
 			continue;
 
+		if (!of_parse_phandle(portnp, "phy-handle", 0))
+			continue;
+
 		port = reg;
 		if (port < 0 || port >= ocelot->num_phys_ports) {
 			dev_err(ocelot->dev,
-- 
2.31.1


             reply	other threads:[~2021-08-17 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 12:06 Horatiu Vultur [this message]
2021-08-17 12:24 ` Vladimir Oltean
2021-08-18  7:32   ` Horatiu Vultur

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=20210817120633.404790-1-horatiu.vultur@microchip.com \
    --to=horatiu.vultur@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --subject='Re: [PATCH net-next] net: mscc: ocelot: Fix probe for vsc7514' \
    /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

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