phy: dp83869: fix interrupts issue when using with an optical fiber sfp. to correctly clear the interrupts both status registers must be read.
Subsystems (4)
PATCH 1/1 phy: dp83869: fix interrupts issue when using with an optical fiber sfp. to correctly clear the interrupts both status registers must be read.
From: Anis Chali <[email protected]>
from datasheet of dp83869hm
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
@@ -41,6 +41,7 @@#define DP83869_IO_MUX_CFG 0x0170#define DP83869_OP_MODE 0x01df#define DP83869_FX_CTRL 0x0c00 +#define DP83869_FX_INT_STS 0x0c19#define DP83869_SW_RESET BIT(15)#define DP83869_SW_RESTART BIT(14)
@@ -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
Jakub Kicinski
maintainerFirst of all, please read:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
Quoted 1 line
Subject: [PATCH net] phy: dp83869: fix interrupts issue when using with an optical fiber sfp. to correctly clear the interrupts both status registers must be read.
The first line of the commit message becomes the subject, it should be a very short summary of the patch (100 chars max)
Quoted 10 lines · On Fri, 25 Jul 2025 20:10:34 -0400 [email protected] wrote:
From: Anis Chali <[email protected]>
from datasheet of dp83869hm
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.
This needs to be line wrapped at 70-ish characters.
Quoted 2 lines
Fixes 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")
no empty lines between tags, please
Quoted 2 lines
Signed-off-by Anis Chali <[email protected]>
Signature · 1 line
pw-bot: cr
Andrew Lunn
maintainerQuoted 8 lines · On Fri, Jul 25, 2025 at 08:10:34PM -0400, [email protected] wrote:
From: Anis Chali <[email protected]>
from datasheet of dp83869hm
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.
Reading this description, it sounds like the fibre interrupt it not cascaded into the micr? There are two completely different sets of registers.
So i seems like you should be reading this register in dp83869_handle_interrupt() same as the MICR.
Andrew
---
pw-bot: cr
Simon Horman
reviewerQuoted 32 lines · On Fri, Jul 25, 2025 at 08:10:34PM -0400, [email protected] wrote:
From: Anis Chali <[email protected]>
from datasheet of dp83869hm
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.Fixes 01db923e8377 ("net: phy: dp83869: Add TI dp83869 phy")Signed-off-by Anis Chali <[email protected]>--- drivers/net/phy/dp83869.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/phy/dp83869.c +1
-0@@ -41,6 +41,7 @@#define DP83869_IO_MUX_CFG 0x0170#define DP83869_OP_MODE 0x01df#define DP83869_FX_CTRL 0x0c00 +#define DP83869_FX_INT_STS 0x0c19#define DP83869_SW_RESET BIT(15)#define DP83869_SW_RESTART BIT(14)
drivers/net/phy/dp83869.c static int dp83869_ack_interrupt(struct phy_device *phydev) · line 202
Quoted 7 lines
drivers/net/phy/dp83869.c +4
-0@@ -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;
Hi Anis,
Its invisible, of course, but the line above has trailing whitespace.
Flagged by checkpatch.
Quoted 9 lines
drivers/net/phy/dp83869.c +2
-0+ } +return 0 ; }Signature · 1 line
2.49.0