diff options
| author | 2026-10-01 16:02:36 +0300 | |
|---|---|---|
| committer | 2026-10-06 17:34:12 -0700 | |
| commit | 4719b69bb66be74d7a2cb4d3887031de90c66ac9 (patch) | |
| tree | 6b5bee84503c9ddd737b7fa5f29d05e93e4eaec5 /scripts/Makefile.thinlto | |
| parent | net: phy: take the interrupt back from the bus on detach (diff) | |
net: phy: restore the interrupt when the generic bind cycle fails
When phy_attach_direct() binds the generic driver itself and the bind
fails, the PHY is left with polling in place of its interrupt.
phy_probe() has already replaced phydev->irq with PHY_POLL by then. The
unwind does not go through phy_detach(), so the restore there does not
run, and a later attach finds a PHY that can only be polled.
Found on a Keenetic KN-1012 while adding the restore in phy_detach(),
as the other way out of the same bind cycle.
Save the interrupt number on entry and put it back on the error path.
The bus table is not the right source here. The same label is reached
when a second attach of a PHY already attached through the generic
driver fails, and there the field is live. The table also misses a
PHY_MAC_INTERRUPT that a MAC wrote into phydev->irq.
Tested on the KN-1012 with a 6.18 distribution kernel and an injected
failure of the generic probe: phydev->irq reads 15 afterwards, and -1
with only the restore in phy_detach().
Cc: stable+noautosel@kernel.org # never worked
Fixes: 6d9f66ac7fec ("net: phy: Fix PHY module checks and NULL deref in phy_attach_direct()")
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://patch.msgid.link/20261001130236.106059-5-f@lex.la
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
