<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/phy/phy_device.c, branch v6.18.34</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.34</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.18.34'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-06-01T15:51:05+00:00</updated>
<entry>
<title>net: phy: honor eee_disabled_modes in phy_advertise_eee_all()</title>
<updated>2026-06-01T15:51:05+00:00</updated>
<author>
<name>Nicolai Buchwitz</name>
<email>nb@tipi-net.de</email>
</author>
<published>2026-05-18T08:23:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0c277d203684c27bff62d6bd997a9fd77c88884f'/>
<id>urn:sha1:0c277d203684c27bff62d6bd997a9fd77c88884f</id>
<content type='text'>
[ Upstream commit 8baa7506d793f0636e3f6f01b01ef7be19674d06 ]

phy_advertise_eee_all() copies supported_eee into advertising_eee
unconditionally, overwriting any filtering applied during phy_probe()
based on DT eee-broken-* properties or driver-populated
eee_disabled_modes. genphy_c45_ethtool_set_eee() calls this helper
when user space passes an empty advertisement, undoing the filtering.

Apply the same eee_disabled_modes mask in phy_advertise_eee_all() so
the filtering survives the copy, matching the pattern in phy_probe()
and phy_support_eee().

Fixes: b64691274f5d ("net: phy: add helper phy_advertise_eee_all")
Signed-off-by: Nicolai Buchwitz &lt;nb@tipi-net.de&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://patch.msgid.link/20260518-devel-phy-support-eee-fix-v2-2-05b52626fa68@tipi-net.de
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: honor eee_disabled_modes in phy_support_eee()</title>
<updated>2026-06-01T15:51:04+00:00</updated>
<author>
<name>Nicolai Buchwitz</name>
<email>nb@tipi-net.de</email>
</author>
<published>2026-05-18T08:23:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd731994cff13aba2a1786f5b5c2c042f6d903d1'/>
<id>urn:sha1:bd731994cff13aba2a1786f5b5c2c042f6d903d1</id>
<content type='text'>
[ Upstream commit 3655063e083889ed4b79b7dda9cec65478dce09a ]

phy_support_eee() copies supported_eee into advertising_eee
unconditionally, overwriting any filtering applied during phy_probe()
based on DT eee-broken-* properties or driver-populated
eee_disabled_modes. MAC drivers that call phy_support_eee() after
probe (e.g. bcmgenet, fec, lan743x, lan78xx, r8169) then cause the PHY
to advertise EEE for modes the user marked as broken.

The symptom is that ethtool --show-eee on the local interface reports
"not supported" (supported &amp; ~eee_disabled_modes is empty) while the
link partner sees EEE negotiated and active.

phy_probe() already filters advertising_eee via eee_disabled_modes
after calling of_set_phy_eee_broken(). Apply the same mask in
phy_support_eee() so the filtering survives the copy.

Fixes: 49168d1980e2 ("net: phy: Add phy_support_eee() indicating MAC support EEE")
Signed-off-by: Nicolai Buchwitz &lt;nb@tipi-net.de&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://patch.msgid.link/20260518-devel-phy-support-eee-fix-v2-1-05b52626fa68@tipi-net.de
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: fix a return path in get_phy_c45_ids()</title>
<updated>2026-05-23T11:06:33+00:00</updated>
<author>
<name>Charles Perry</name>
<email>charles.perry@microchip.com</email>
</author>
<published>2026-04-09T13:36:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=15a9928f8a93bb9df38900b3f21b665679fb8eb8'/>
<id>urn:sha1:15a9928f8a93bb9df38900b3f21b665679fb8eb8</id>
<content type='text'>
[ Upstream commit 6f533abe7bbad2eef1e42c639b6bb9dad2b02362 ]

The return value of phy_c45_probe_present() is stored in "ret", not
"phy_reg", fix this. "phy_reg" always has a positive value if we reach
this return path (since it would have returned earlier otherwise), which
means that the original goal of the patch of not considering -ENODEV
fatal wasn't achieved.

Fixes: 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
Signed-off-by: Charles Perry &lt;charles.perry@microchip.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Link: https://patch.msgid.link/20260409133654.3203336-1-charles.perry@microchip.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: register phy led_triggers during probe to avoid AB-BA deadlock</title>
<updated>2026-03-12T11:09:40+00:00</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2026-02-22T15:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2764dcb3c35de4410f642afc62cf979727470575'/>
<id>urn:sha1:2764dcb3c35de4410f642afc62cf979727470575</id>
<content type='text'>
commit c8dbdc6e380e7e96a51706db3e4b7870d8a9402d upstream.

There is an AB-BA deadlock when both LEDS_TRIGGER_NETDEV and
LED_TRIGGER_PHY are enabled:

[ 1362.049207] [&lt;8054e4b8&gt;] led_trigger_register+0x5c/0x1fc             &lt;-- Trying to get lock "triggers_list_lock" via down_write(&amp;triggers_list_lock);
[ 1362.054536] [&lt;80662830&gt;] phy_led_triggers_register+0xd0/0x234
[ 1362.060329] [&lt;8065e200&gt;] phy_attach_direct+0x33c/0x40c
[ 1362.065489] [&lt;80651fc4&gt;] phylink_fwnode_phy_connect+0x15c/0x23c
[ 1362.071480] [&lt;8066ee18&gt;] mtk_open+0x7c/0xba0
[ 1362.075849] [&lt;806d714c&gt;] __dev_open+0x280/0x2b0
[ 1362.080384] [&lt;806d7668&gt;] __dev_change_flags+0x244/0x24c
[ 1362.085598] [&lt;806d7698&gt;] dev_change_flags+0x28/0x78
[ 1362.090528] [&lt;807150e4&gt;] dev_ioctl+0x4c0/0x654                       &lt;-- Hold lock "rtnl_mutex" by calling rtnl_lock();
[ 1362.094985] [&lt;80694360&gt;] sock_ioctl+0x2f4/0x4e0
[ 1362.099567] [&lt;802e9c4c&gt;] sys_ioctl+0x32c/0xd8c
[ 1362.104022] [&lt;80014504&gt;] syscall_common+0x34/0x58

Here LED_TRIGGER_PHY is registering LED triggers during phy_attach
while holding RTNL and then taking triggers_list_lock.

[ 1362.191101] [&lt;806c2640&gt;] register_netdevice_notifier+0x60/0x168      &lt;-- Trying to get lock "rtnl_mutex" via rtnl_lock();
[ 1362.197073] [&lt;805504ac&gt;] netdev_trig_activate+0x194/0x1e4
[ 1362.202490] [&lt;8054e28c&gt;] led_trigger_set+0x1d4/0x360                 &lt;-- Hold lock "triggers_list_lock" by down_read(&amp;triggers_list_lock);
[ 1362.207511] [&lt;8054eb38&gt;] led_trigger_write+0xd8/0x14c
[ 1362.212566] [&lt;80381d98&gt;] sysfs_kf_bin_write+0x80/0xbc
[ 1362.217688] [&lt;8037fcd8&gt;] kernfs_fop_write_iter+0x17c/0x28c
[ 1362.223174] [&lt;802cbd70&gt;] vfs_write+0x21c/0x3c4
[ 1362.227712] [&lt;802cc0c4&gt;] ksys_write+0x78/0x12c
[ 1362.232164] [&lt;80014504&gt;] syscall_common+0x34/0x58

Here LEDS_TRIGGER_NETDEV is being enabled on an LED. It first takes
triggers_list_lock and then RTNL. A classical AB-BA deadlock.

phy_led_triggers_registers() does not require the RTNL, it does not
make any calls into the network stack which require protection. There
is also no requirement the PHY has been attached to a MAC, the
triggers only make use of phydev state. This allows the call to
phy_led_triggers_registers() to be placed elsewhere. PHY probe() and
release() don't hold RTNL, so solving the AB-BA deadlock.

Reported-by: Shiji Yang &lt;yangshiji66@outlook.com&gt;
Closes: https://lore.kernel.org/all/OS7PR01MB13602B128BA1AD3FA38B6D1FFBC69A@OS7PR01MB13602.jpnprd01.prod.outlook.com/
Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Tested-by: Shiji Yang &lt;yangshiji66@outlook.com&gt;
Link: https://patch.msgid.link/20260222152601.1978655-1-andrew@lunn.ch
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: phy: annotate linkmode initializers as not used after init phase</title>
<updated>2025-09-30T11:17:31+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2025-09-27T19:57:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=49ac3d7826936b30eaa5dbe1bec6dad58f7d2476'/>
<id>urn:sha1:49ac3d7826936b30eaa5dbe1bec6dad58f7d2476</id>
<content type='text'>
Code and data used from phy_init() only, can be annotated accordingly.

Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Link: https://patch.msgid.link/5fb9c41b-bf44-4915-a3c3-f20952fce6de@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: phy: stop exporting phy_driver_unregister</title>
<updated>2025-09-30T11:17:16+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2025-09-27T19:52:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e211c463b748c4e2e8364c10bc216ca775fcc943'/>
<id>urn:sha1:e211c463b748c4e2e8364c10bc216ca775fcc943</id>
<content type='text'>
After 42e2a9e11a1d ("net: phy: dp83640: improve phydev and driver
removal handling") we can stop exporting also phy_driver_unregister().

Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Link: https://patch.msgid.link/2bab950e-4b70-4030-b997-03f48379586f@gmail.com
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
<entry>
<title>net: phy: stop exporting phy_driver_register</title>
<updated>2025-09-23T23:58:42+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2025-09-20T21:34:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=092263a03105539b8dfe74c59be4c6cce1304d5f'/>
<id>urn:sha1:092263a03105539b8dfe74c59be4c6cce1304d5f</id>
<content type='text'>
phy_driver_register() isn't used outside phy_device.c any longer,
so we can stop exporting it.

Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Link: https://patch.msgid.link/dff44b83-4a85-4fff-bf6b-f12efd97b56e@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: fix phy_uses_state_machine()</title>
<updated>2025-09-09T23:33:19+00:00</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2025-09-07T20:44:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e0d1c55501d377163eb57feed863777ed1c973ad'/>
<id>urn:sha1:e0d1c55501d377163eb57feed863777ed1c973ad</id>
<content type='text'>
The blamed commit changed the conditions which phylib uses to stop
and start the state machine in the suspend and resume paths, and
while improving it, has caused two issues.

The original code used this test:

	phydev-&gt;attached_dev &amp;&amp; phydev-&gt;adjust_link

and if true, the paths would handle the PHY state machine. This test
evaluates true for normal drivers that are using phylib directly
while the PHY is attached to the network device, but false in all
other cases, which include the following cases:

- when the PHY has never been attached to a network device.
- when the PHY has been detached from a network device (as phy_detach()
   sets phydev-&gt;attached_dev to NULL, phy_disconnect() calls
   phy_detach() and additionally sets phydev-&gt;adjust_link NULL.)
- when phylink is using the driver (as phydev-&gt;adjust_link is NULL.)

Only the third case was incorrect, and the blamed commit attempted to
fix this by changing this test to (simplified for brevity, see
phy_uses_state_machine()):

	phydev-&gt;phy_link_change == phy_link_change ?
		phydev-&gt;attached_dev &amp;&amp; phydev-&gt;adjust_link : true

However, this also incorrectly evaluates true in the first two cases.

Fix the first case by ensuring that phy_uses_state_machine() returns
false when phydev-&gt;phy_link_change is NULL.

Fix the second case by ensuring that phydev-&gt;phy_link_change is set to
NULL when phy_detach() is called.

Reported-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Link: https://lore.kernel.org/r/20250806082931.3289134-1-xu.yang_2@nxp.com
Fixes: fc75ea20ffb4 ("net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY")
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Reviewed-by: Vladimir Oltean &lt;vladimir.oltean@nxp.com&gt;
Link: https://patch.msgid.link/E1uvMEz-00000003Aoe-3qWe@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: Don't register LEDs for genphy</title>
<updated>2025-07-15T00:54:06+00:00</updated>
<author>
<name>Sean Anderson</name>
<email>sean.anderson@linux.dev</email>
</author>
<published>2025-07-10T20:14:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a44312d58e78cfe8f0e72435101b7a9187b21d46'/>
<id>urn:sha1:a44312d58e78cfe8f0e72435101b7a9187b21d46</id>
<content type='text'>
If a PHY has no driver, the genphy driver is probed/removed directly in
phy_attach/detach. If the PHY's ofnode has an "leds" subnode, then the
LEDs will be (un)registered when probing/removing the genphy driver.
This could occur if the leds are for a non-generic driver that isn't
loaded for whatever reason. Synchronously removing the PHY device in
phy_detach leads to the following deadlock:

rtnl_lock()
ndo_close()
    ...
    phy_detach()
        phy_remove()
            phy_leds_unregister()
                led_classdev_unregister()
                    led_trigger_set()
                        netdev_trigger_deactivate()
                            unregister_netdevice_notifier()
                                rtnl_lock()

There is a corresponding deadlock on the open/register side of things
(and that one is reported by lockdep), but it requires a race while this
one is deterministic. Regular drivers do not have this problem since
they are probed asynchronously (without RTNL held).

Generic PHYs do not support LEDs anyway, so don't bother registering
them.

[JakubL this is a net-next version of
 commit f0f2b992d818 ("net: phy: Don't register LEDs for genphy"),
 which uses APIs removed in -next.]

Signed-off-by: Sean Anderson &lt;sean.anderson@linux.dev&gt;
Link: https://patch.msgid.link/20250710201454.1280277-1-sean.anderson@linux.dev
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: Add c45_phy_ids sysfs directory entry</title>
<updated>2025-06-17T13:11:51+00:00</updated>
<author>
<name>Yajun Deng</name>
<email>yajun.deng@linux.dev</email>
</author>
<published>2025-06-13T13:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=170e4e3944aa39accf64d869b27c187f8c08abc7'/>
<id>urn:sha1:170e4e3944aa39accf64d869b27c187f8c08abc7</id>
<content type='text'>
The phy_id field only shows the PHY ID of the C22 device, and the C45
device did not store its PHY ID in this field.

Add a new phy_mmd_group, and export the mmd&lt;n&gt;_device_id for the C45
device. These files are invisible to the C22 device.

Signed-off-by: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://patch.msgid.link/20250613131903.2961-1-yajun.deng@linux.dev
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;

</content>
</entry>
</feed>
