Re: [net-next] net: phy: intel-xway: workaround stale LEDs before link-up
From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-01-18 02:29:10
Also in:
lkml
This is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible. For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html --- net: phy: intel-xway: workaround stale LEDs before link-up This patch works around a PHY firmware bug where LED manual control and polarity configuration have no effect until a link is detected. The fix temporarily clears BMCR_ANENABLE for 100ms to force the LED thread to start.
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/phy/intel-xway.c b/drivers/net/phy/intel-xway.c index 9766dd99afaa..e06ed7ab0ff3 100644 --- a/drivers/net/phy/intel-xway.c +++ b/drivers/net/phy/intel-xway.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -286,8 +287,33 @@ static int xway_gphy_config_init(struct phy_device *phydev) return err; /* Use default LED configuration if 'leds' node isn't defined */ - if (!of_get_child_by_name(np, "leds")) + if (!of_get_child_by_name(np, "leds")) { xway_gphy_init_leds(phydev); + } else {
Does this leak the device_node reference returned by of_get_child_by_name()?
The API documentation states that of_get_child_by_name() returns a node
pointer with refcount incremented, requiring of_node_put() when done.
When the "leds" node exists, the returned pointer is never captured and
of_node_put() is never called.
Other PHY drivers handle this correctly, for example vsc85xx_probe_common()
in drivers/net/phy/mscc/mscc_main.c:
np = of_get_child_by_name(phydev->mdio.dev.of_node, "leds");
if (np) {
of_node_put(np);
...
}
And of_phy_leds() in drivers/net/phy/phy_device.c also properly calls
of_node_put(leds) on all exit paths.
Note that this leak also existed in the original code before this patch,
but since this patch is touching this exact code path, it would be a good
opportunity to fix it.
--
pw-bot: cr