From: Jianhui Zhao <zhaojh329@gmail.com>
To: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Jianhui Zhao <zhaojh329@gmail.com>
Subject: [PATCH] net: mdio: fix duplicate registrations for phy with c45 in __of_mdiobus_register()
Date: Sun, 11 Jun 2023 00:13:08 +0800 [thread overview]
Message-ID: <20230610161308.3158-1-zhaojh329@gmail.com> (raw)
Maybe mdiobus_scan_bus_c45() is called in __mdiobus_register().
Thus it should skip already registered PHYs later.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
---
drivers/net/mdio/of_mdio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 7eb32ebb846d..441973fce79e 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -186,6 +186,10 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
continue;
}
+ /* skip already registered PHYs */
+ if (mdiobus_is_registered_device(mdio, addr))
+ continue;
+
if (of_mdiobus_child_is_phy(child))
rc = of_mdiobus_register_phy(mdio, child, addr);
else
--
2.34.1
next reply other threads:[~2023-06-10 16:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 16:13 Jianhui Zhao [this message]
2023-06-10 17:10 ` Andrew Lunn
2023-06-11 8:58 ` Jianhui Zhao
2023-06-11 14:57 ` Jianhui Zhao
2023-06-11 15:11 ` Andrew Lunn
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=20230610161308.3158-1-zhaojh329@gmail.com \
--to=zhaojh329@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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
all inboxes | Powered by JetHome®