diff mbox series

net: dp83tc811: fix link detection and possbile IRQ storm

Message ID 20210122150334.2378703-1-mkl@pengutronix.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: dp83tc811: fix link detection and possbile IRQ storm | expand

Checks

Context Check Description
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Marc Kleine-Budde Jan. 22, 2021, 3:03 p.m. UTC
In our setup the dp83tc811 is configure to master mode. When there is no slave
connected the dp83tc811 triggers an interrupt is triggerd, several bits in the
status registers are set, and te INT_N pin goes low. One of interrupt bits is
the NO_FRAME interrupt.

Reading the status register acknowledges the interrupt, but as there is still
no slave connected, the NO_FRAME interrupt stays set and the INT_N pin low. For
level triggered IRQs this results in an interrupt storm, as long as the slave
is not connected. For edge triggered interupts the link change event, when the
slave comes online, is lost.

To fix this problem the NO_FRAME interrupt is not enabled. At least in our
testcase with edge triggered interrupts link change events are now properly
detected.

Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/phy/dp83tc811.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Marc Kleine-Budde Jan. 22, 2021, 3:07 p.m. UTC | #1
On 1/22/21 4:03 PM, Marc Kleine-Budde wrote:
> In our setup the dp83tc811 is configure to master mode. When there is no slave
> connected the dp83tc811 triggers an interrupt is triggerd, several bits in the
> status registers are set, and te INT_N pin goes low. One of interrupt bits is
> the NO_FRAME interrupt.
> 
> Reading the status register acknowledges the interrupt, but as there is still
> no slave connected, the NO_FRAME interrupt stays set and the INT_N pin low. For
> level triggered IRQs this results in an interrupt storm, as long as the slave
> is not connected. For edge triggered interupts the link change event, when the
> slave comes online, is lost.
> 
> To fix this problem the NO_FRAME interrupt is not enabled. At least in our
> testcase with edge triggered interrupts link change events are now properly
> detected.
> 
> Cc: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Sorry - this patch will not apply as is, I'll send an updated version.

Marc
Andrew Lunn Jan. 22, 2021, 11:14 p.m. UTC | #2
On Fri, Jan 22, 2021 at 04:03:34PM +0100, Marc Kleine-Budde wrote:
> In our setup the dp83tc811 is configure to master mode. When there is no slave
> connected the dp83tc811 triggers an interrupt is triggerd, several bits in the
> status registers are set, and te INT_N pin goes low. One of interrupt bits is
> the NO_FRAME interrupt.
> 
> Reading the status register acknowledges the interrupt, but as there is still
> no slave connected, the NO_FRAME interrupt stays set and the INT_N pin low. For
> level triggered IRQs this results in an interrupt storm, as long as the slave
> is not connected. For edge triggered interupts the link change event, when the
> slave comes online, is lost.
> 
> To fix this problem the NO_FRAME interrupt is not enabled. At least in our
> testcase with edge triggered interrupts link change events are now properly
> detected.
> 
> Cc: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Hi Marc

Seems reasonable. Please add to your rebased version:

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
diff mbox series

Patch

diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c
index b8d802cbf615..2801492bfaad 100644
--- a/drivers/net/phy/dp83tc811.c
+++ b/drivers/net/phy/dp83tc811.c
@@ -222,7 +222,6 @@  static int dp83811_config_intr(struct phy_device *phydev)
 			return err;
 
 		misr_status = (DP83811_LPS_INT_EN |
-			       DP83811_NO_FRAME_INT_EN |
 			       DP83811_POR_DONE_INT_EN);
 
 		err = phy_write(phydev, MII_DP83811_INT_STAT3, misr_status);