Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795032551; b=iUkYlOGLgWTVvFJAkBKM0YA2LIOQx444wSqSGl4Wp4H2wbnV4AS2QHgRPRM02hwWtIJI Dw4zNYdQTwmGbYl4/qrkIm1wZBam4NFmcHtVgl3qNr18MYxogpvZRBywYkzehEt6/KkCT i8CRF74YujaNULfVgI5PL5m5BWi1Kzy5g8DygL8hSPLWha1unwuTbbCQ+JZTZ8OBcF619 Tg/y/UPLXEKZrK8SWQdqGBnCjS32BUWqDApiLulg3+iFch6W58cV4AhO+pidMwYS2oKXN 6Vg/zIDOSXYkFjomsxJB+FtXtRZMS8Od4XbougRyJzAoiMPzTVpe/nOQK4uDNWow1nw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795032551; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=BD+JGBhjZqnqrhNT3TH0WLKDN27gz5pI2yGdrNEMfGk=; b=w/hp4EvL+2XLdvJwm8k8J2nFWoIJ39Tpe7vCKL9jslAutPIybJtjMNDn+tvxm9IOyBLG rPND+sh4O54siuQAy81jzXZ5q0enMXOoiuLuivFWaMZBem4LtHjmPqa3uwigzsEMT98/F TUxOlYwHr54wRq8blcpwOdC7lq6VlcZKfIbI373w2Fxh35/PA/uJcAxlkjSaQ1qsEL86A ctm2T+q004343J8jthghL8cUyUScv6wUzDE6g3wMNYXzID/r6IJ4X4UEdh3SmQiHYvli4 XogvStNDKr9x+NYhKvpRv5Lx//ef/m12Xx9gyvXE03VGX3cPabNNzhJKjdCTF/+o8Sg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=h7lgzZVz; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1697060A2607; Wed, 18 Nov 2026 20:09:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=h7lgzZVz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 667261F000C4; Wed, 18 Nov 2026 20:09:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795032550; bh=BD+JGBhjZqnqrhNT3TH0WLKDN27gz5pI2yGdrNEMfGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=h7lgzZVzNWf7T8tcY1k9966J87kPfcPh5OI5iFqOI18g2p9kqjw8YyxnHf8kcnCR7 /xVbbgvhg1yJ2nUK0be6DPkyy8bQCD9TCy8hNxL8zznZYK6e4tJte0bsm5HBZ0fiD4 yNMuuCcMrCH7O07cfYRBPlfla3zrdobbswyM7bCk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , Jijie Shao , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 1450/1756] net: hix5hd2: serialize timeout recovery with interface teardown Date: Wed, 18 Nov 2026 15:59:37 +0100 Message-ID: <20261118150106.831147862@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150007.957976754@linuxfoundation.org> References: <20261118150007.957976754@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak [ Upstream commit 87cce46329a811ea3fe108ac721e0a2400d0a3bb ] The timeout worker calls the driver's close and open methods without RTNL or a running-state check. A timeout queued before an interface is closed can call close again after ndo_stop has disabled NAPI. The second napi_disable() can then wait indefinitely. The worker can also race with an ongoing close. Take RTNL and skip recovery when the interface is no longer running. Use the netdev core close and open helpers so a failed reopen leaves the interface down, rather than leaving it marked running with NAPI disabled. After unregister_netdev() has stopped the watchdog, drain the worker before releasing its MDIO and descriptor resources. This wait is outside RTNL, allowing an already queued worker to take RTNL, observe the down state, and finish. This issue was identified as part of our ongoing research while reviewing kernel code. Fixes: 57c5bc9ad7d7 ("net: hisilicon: add hix5hd2 mac driver") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reviewed-by: Jijie Shao Link: https://patch.msgid.link/179203116093.2621539.3718842986255459438.G202@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c index cc1d04d05e4b3..907709becf75e 100644 --- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -890,8 +891,13 @@ static void hix5hd2_tx_timeout_task(struct work_struct *work) struct hix5hd2_priv *priv; priv = container_of(work, struct hix5hd2_priv, tx_timeout_task); - hix5hd2_net_close(priv->netdev); - hix5hd2_net_open(priv->netdev); + + rtnl_lock(); + if (netif_running(priv->netdev)) { + dev_close(priv->netdev); + dev_open(priv->netdev, NULL); + } + rtnl_unlock(); } static void hix5hd2_net_timeout(struct net_device *dev, unsigned int txqueue) @@ -1283,6 +1289,7 @@ static void hix5hd2_dev_remove(struct platform_device *pdev) struct hix5hd2_priv *priv = netdev_priv(ndev); unregister_netdev(ndev); + cancel_work_sync(&priv->tx_timeout_task); mdiobus_unregister(priv->bus); mdiobus_free(priv->bus); @@ -1290,7 +1297,6 @@ static void hix5hd2_dev_remove(struct platform_device *pdev) hix5hd2_destroy_sg_desc_queue(priv); hix5hd2_destroy_hw_desc_queue(priv); of_node_put(priv->phy_node); - cancel_work_sync(&priv->tx_timeout_task); free_netdev(ndev); } -- 2.53.0