From: Jiawen Wu <jiawenwu@trustnetic.com>
To: dev@dpdk.org
Cc: Jiawen Wu <jiawenwu@trustnetic.com>
Subject: [PATCH] net/txgbe: fix a mass of interrupts
Date: Fri, 15 Nov 2024 16:33:36 +0800 [thread overview]
Message-ID: <20241115083336.1195101-1-jiawenwu@trustnetic.com> (raw)
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(+)
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);
--
2.27.0
reply other threads:[~2024-11-15 8:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241115083336.1195101-1-jiawenwu@trustnetic.com \
--to=jiawenwu@trustnetic.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).