]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: add a PHY write barrier when disabling interrupts
authorCharles Perry <charles.perry@microchip.com>
Wed, 8 Apr 2026 13:18:16 +0000 (06:18 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sun, 12 Apr 2026 21:19:19 +0000 (14:19 -0700)
commit96aefe3afe0e122a1472967224ffe21c3d51b67b
tree4af9fe08ea1a9559bb920f26bac908e197dce5a9
parentf76aef980206e7c6bc09933fd3c8e2b8a3479bd2
net: phy: add a PHY write barrier when disabling interrupts

MDIO bus controllers are not required to wait for write transactions to
complete before returning as synchronization is often achieved by polling
status bits.

This can cause issues when disabling interrupts since an interrupt could
fire before the interrupt handler is unregistered and there's no status
bit to poll.

Add a phy_write_barrier() function and use it in phy_disable_interrupts()
to fix this issue. The write barrier just reads an MII register and
discards the value, which is enough to guarantee that previous writes have
completed.

Signed-off-by: Charles Perry <charles.perry@microchip.com>
Link: https://patch.msgid.link/20260408131821.1145334-4-charles.perry@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy.c