net/txgbe: fix a mass of interrupts

Message ID 20241115083336.1195101-1-jiawenwu@trustnetic.com (mailing list archive)
State Accepted, archived
Delegated to: Stephen Hemminger
Headers
Series net/txgbe: fix a mass of interrupts |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing warning Testing issues
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS

Commit Message

Jiawen Wu Nov. 15, 2024, 8:33 a.m. UTC
Since firmware version 0x20010, GPIO interrupt enable is set to 0xd by
default, which means enable bit 0 'tx_fault'. And GPIO interrupt polarity
is set to 0xd by default too, which means these interrupts are rising-edge
sensitive.

So when unplug the SFP module, GPIO line 0 'tx_fault' is 0 -> 1 triggers
the interrupt. However, the interrupt is not cleared. And GPIO interrupt
mask is enabled and disabled to trigger the MISC interrupt repeatedly.

Since this 'tx_fault' interrupt does not make much sense, simply clear it
to fix the issue.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Ferruh Yigit Nov. 18, 2024, 7:59 p.m. UTC | #1
On 11/15/2024 8:33 AM, Jiawen Wu wrote:
> Since firmware version 0x20010, GPIO interrupt enable is set to 0xd by
> default, which means enable bit 0 'tx_fault'. And GPIO interrupt polarity
> is set to 0xd by default too, which means these interrupts are rising-edge
> sensitive.
> 
> So when unplug the SFP module, GPIO line 0 'tx_fault' is 0 -> 1 triggers
> the interrupt. However, the interrupt is not cleared. And GPIO interrupt
> mask is enabled and disabled to trigger the MISC interrupt repeatedly.
> 
> Since this 'tx_fault' interrupt does not make much sense, simply clear it
> to fix the issue.
> 
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
>

Hi Jiawen,

Can you please provide a fixes tag?
Also I believe you would like to backport this fix, if so please add the
stable tag as well.
  
Jiawen Wu Nov. 19, 2024, 2:02 a.m. UTC | #2
On Tue, Nov 19, 2024 3:59 AM, Ferruh Yigit wrote:
> On 11/15/2024 8:33 AM, Jiawen Wu wrote:
> > Since firmware version 0x20010, GPIO interrupt enable is set to 0xd by
> > default, which means enable bit 0 'tx_fault'. And GPIO interrupt polarity
> > is set to 0xd by default too, which means these interrupts are rising-edge
> > sensitive.
> >
> > So when unplug the SFP module, GPIO line 0 'tx_fault' is 0 -> 1 triggers
> > the interrupt. However, the interrupt is not cleared. And GPIO interrupt
> > mask is enabled and disabled to trigger the MISC interrupt repeatedly.
> >
> > Since this 'tx_fault' interrupt does not make much sense, simply clear it
> > to fix the issue.
> >
> > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> >
> 
> Hi Jiawen,
> 
> Can you please provide a fixes tag?
> Also I believe you would like to backport this fix, if so please add the
> stable tag as well.

I have thought about it. But there are two changes based on two commits:
1. d3bb4a04eac1 ("net/txgbe: add SFP hotplug identification")
2. 12011b11a3d6 ("net/txgbe: adapt to MNG veto bit setting")

Should I split the patch and add fixes tags separately?
  
Stephen Hemminger Nov. 24, 2024, 5:46 p.m. UTC | #3
On Tue, 19 Nov 2024 10:02:23 +0800
Jiawen Wu <jiawenwu@trustnetic.com> wrote:

> On Tue, Nov 19, 2024 3:59 AM, Ferruh Yigit wrote:
> > On 11/15/2024 8:33 AM, Jiawen Wu wrote:  
> > > Since firmware version 0x20010, GPIO interrupt enable is set to 0xd by
> > > default, which means enable bit 0 'tx_fault'. And GPIO interrupt polarity
> > > is set to 0xd by default too, which means these interrupts are rising-edge
> > > sensitive.
> > >
> > > So when unplug the SFP module, GPIO line 0 'tx_fault' is 0 -> 1 triggers
> > > the interrupt. However, the interrupt is not cleared. And GPIO interrupt
> > > mask is enabled and disabled to trigger the MISC interrupt repeatedly.
> > >
> > > Since this 'tx_fault' interrupt does not make much sense, simply clear it
> > > to fix the issue.
> > >
> > > Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
> > >  
> > 
> > Hi Jiawen,
> > 
> > Can you please provide a fixes tag?
> > Also I believe you would like to backport this fix, if so please add the
> > stable tag as well.  
> 
> I have thought about it. But there are two changes based on two commits:
> 1. d3bb4a04eac1 ("net/txgbe: add SFP hotplug identification")
> 2. 12011b11a3d6 ("net/txgbe: adapt to MNG veto bit setting")
> 
> Should I split the patch and add fixes tags separately?
> 
> 

It is ok, as is. I can add the fixes tag for you.
The purpose of the fixes is to help with discovering patches that need
to go into stable.

Applied to next-net
  

Patch

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index a956216abb..ea9faba2c0 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -1555,6 +1555,9 @@  static void txgbe_reinit_gpio_intr(struct txgbe_hw *hw)
 	wr32(hw, TXGBE_GPIOINTMASK, 0xFF);
 	reg = rd32(hw, TXGBE_GPIORAWINTSTAT);
 
+	if (reg & TXGBE_GPIOBIT_0)
+		wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_0);
+
 	if (reg & TXGBE_GPIOBIT_2)
 		wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_2);
 
@@ -2796,6 +2799,8 @@  txgbe_dev_sfp_event(struct rte_eth_dev *dev)
 
 	wr32(hw, TXGBE_GPIOINTMASK, 0xFF);
 	reg = rd32(hw, TXGBE_GPIORAWINTSTAT);
+	if (reg & TXGBE_GPIOBIT_0)
+		wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_0);
 	if (reg & TXGBE_GPIOBIT_2) {
 		wr32(hw, TXGBE_GPIOEOI, TXGBE_GPIOBIT_2);
 		rte_eal_alarm_set(1000 * 100, txgbe_dev_detect_sfp, dev);