net: phy: dp83869: fix interrupts issue, not correctly handled when operate with an optical fiber sfp.
Subsystems (3)
PATCH 1/1 net: phy: dp83869: fix interrupts issue, not correctly handled when operate with an optical fiber sfp.
From: Anis Chali <[email protected]>
to correctly clear the interrupts both status registers must be read.
from datasheet: http://ti.com/lit/ds/symlink/dp83869hm.pdf
7.3.6 Interrupt
The DP83869HM can be configured to generate an interrupt when changes of internal status occur. The interrupt allows a MAC to act upon the status in the PHY without polling the PHY registers. The interrupt source can be selected through the interrupt registers, MICR (12h) and FIBER_INT_EN (C18h). The interrupt status can be read from ISR (13h) and FIBER_INT_STTS (C19h) registers. Some interrupts are enabled by default and can be disabled through register access. Both the interrupt status registers must be read in order to clear pending interrupts. Until the pending interrupts are cleared, new interrupts may not be routed to the interrupt pin.
--- drivers/net/phy/dp83869.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/phy/dp83869.c +7 -0
@@ -25,6 +25,7 @@#define DP83869_CFG2 0x14#define DP83869_CTRL 0x1f#define DP83869_CFG4 0x1e +#define DP83869_FX_INT_STS 0xc19/* Extended Registers */ #define DP83869_GEN_CFG3 0x0031
@@ -195,6 +196,12 @@ static int dp83869_ack_interrupt(struct phy_device *phydev)if (err <0 )return err; +if (linkmode_test_bit (ETHTOOL_LINK_MODE_FIBRE_BIT , phydev->supported)) { + err =phy_read_mmd (phydev,DP83869_DEVADDR ,DP83869_FX_INT_STS ); +if (err <0 ) +return err; + } +return 0 ; }
Signature · 1 line
2.49.0
Andrew Lunn
maintainerQuoted 13 lines · On Sun, May 18, 2025 at 10:24:17PM -0400, [email protected] wrote:
From: Anis Chali <[email protected]>
to correctly clear the interrupts both status registers must be read.
from datasheet: http://ti.com/lit/ds/symlink/dp83869hm.pdf
7.3.6 Interrupt
The DP83869HM can be configured to generate an interrupt when changes of internal status occur. The interrupt allows a MAC to act upon the status in the PHY without polling the PHY registers. The interrupt source can be selected through the interrupt registers, MICR (12h) andFIBER_INT_EN(C18h). The interrupt status can be read from ISR (13h) andFIBER_INT_STTS(C19h) registers. Some interrupts are enabled by default and can be disabled through register access. Both the interrupt status registers must be read in order to clear pending interrupts. Until the pending interrupts are cleared, new interrupts may not be routed to the interrupt pin.
Quoted 1 line
Signed-off-by Anis Chali <[email protected]>
This seems like something for stable?
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Please include a Fixes: tag.
Please base this patch on the net tree:
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
drivers/net/phy/dp83869.c line 28
Quoted 13 lines
--- drivers/net/phy/dp83869.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/phy/dp83869.c +1
-0@@ -25,6 +25,7 @@#define DP83869_CFG2 0x14#define DP83869_CTRL 0x1f#define DP83869_CFG4 0x1e +#define DP83869_FX_INT_STS 0xc19
It appears that this is an Extended register, so it belong after DP83869_FX_CTRL?
Andrew
---
pw-bot: cr