From: Imre Kaloz <kaloz@kernel.org>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-mips@vger.kernel.org, Sashiko <sashiko-bot@kernel.org>,
stable@vger.kernel.org
Subject: [PATCH net-next v2 2/2] net: sgi: ioc3-eth: do not wait for the link timer in ioc3_init
Date: Sat, 28 Nov 2026 16:49:53 +0100 [thread overview]
Message-ID: <20261128154953.2664-3-kaloz@kernel.org> (raw)
In-Reply-To: <20261128154953.2664-1-kaloz@kernel.org>
ioc3_init() waits for the link timer with timer_delete_sync(), but it
runs from ioc3_error() in hardirq context with ioc3_lock held, and from
ioc3_timeout() under spin_lock_irq(). A callback interrupted on this CPU
never finishes, and one on another CPU spins on ioc3_lock, which the
waiter holds.
Stop the timer in ioc3_open() instead and leave it running across
resets, so the link poll no longer stops after the first error
interrupt.
Reproduced by injecting an IOC3 error interrupt from a kernel
modification: without this change, timer_delete_sync() warns from
hardirq context. Tested on an SGI Fuel with DEBUG_SHIRQ and
SLUB_DEBUG_ON: link down/up, driver unbind/rebind and an injected
error interrupt.
Fixes: cfadbd298e8b ("[PATCH] Fix timer race")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/179504054981.3136.8539477779059154181@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
---
drivers/net/ethernet/sgi/ioc3-eth.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c
index 5023d05e7e38..0bb2e71befc8 100644
--- a/drivers/net/ethernet/sgi/ioc3-eth.c
+++ b/drivers/net/ethernet/sgi/ioc3-eth.c
@@ -718,8 +718,6 @@ static void ioc3_init(struct net_device *dev)
struct ioc3_private *ip = netdev_priv(dev);
struct ioc3_ethregs *regs = ip->regs;
- timer_delete_sync(&ip->ioc3_timer); /* Kill if running */
-
writel(EMCR_RST, ®s->emcr); /* Reset */
readl(®s->emcr); /* Flush WB */
udelay(4); /* Give it time ... */
@@ -786,6 +784,7 @@ static int ioc3_open(struct net_device *dev)
ip->ehar_h = 0;
ip->ehar_l = 0;
+ timer_delete_sync(&ip->ioc3_timer);
ioc3_init(dev);
if (ioc3_alloc_rx_bufs(dev)) {
netdev_err(dev, "%s: rx buffer allocation failed\n", __func__);
@@ -1131,7 +1130,6 @@ static void ioc3_timeout(struct net_device *dev, unsigned int txqueue)
}
ioc3_start(ip);
ioc3_mii_init(ip);
- ioc3_mii_start(ip);
spin_unlock_irq(&ip->ioc3_lock);
--
2.47.3
prev parent reply other threads:[~2026-11-28 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 15:49 [PATCH net-next v2 0/2] net: sgi: ioc3-eth: IRQ and link timer fixes Imre Kaloz
2026-11-28 15:49 ` [PATCH net-next v2 1/2] net: sgi: ioc3-eth: request the IRQ in open, not probe Imre Kaloz
2026-11-28 15:49 ` Imre Kaloz [this message]
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=20261128154953.2664-3-kaloz@kernel.org \
--to=kaloz@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
/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