Thread (17 messages) 17 messages, 2 authors, 6d ago

Re: [PATCH net-next v5 4/8] net: mdio: realtek-rtl9300: Configure hardware polling during probing

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-07-22 18:51:07
Also in: linux-devicetree

+static int otto_emdio_notify_phy_attach(struct phy_device *phydev)
+{
+	struct otto_emdio_priv *priv = otto_emdio_bus_to_priv(phydev->mdio.bus);
+	int port = otto_emdio_phy_to_port(phydev->mdio.bus, phydev->mdio.addr);
+	int ret;
+
+	if (port < 0)
+		return port;
+
+	scoped_guard(mutex, &priv->lock) {
+		if (test_bit(port, priv->phy_poll))
+			return 0;
You seem to be assuming otto_emdio_notify_phy_attach() and
otto_emdio_notify_phy_detach() are not called strictly as pairs. Does
this actually happen?
+static int otto_emdio_init_polling(struct otto_emdio_priv *priv)
+{
+	int err;
+
+	for (int port = 0; port < priv->info->num_ports; port++) {
+		scoped_guard(mutex, &priv->lock) {
What is this mutex protecting?
+			err = otto_emdio_set_port_polling(priv, port, false);
+			if (err)
+				return err;
+		}
+	}
+
+	return 0;
+}
+
    Andrew

---
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help