From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796259849; b=Qem4kFSozNAry2jZ+bZke8XCCuJsjxe5a5WUqgKj09kSxMwl4zaWrolb4IF8I7nYyOb7 Eyjspn9qRFFfzMXKlxkZDUPpcB5NZLZGM7ngRmOvKTAzlMpSEj1/TzFGMbc6vjJRigl7M aW4FLrulCF2OpshC9ytJf/ULPXOIsmTcflvw050g6+6w8UJE/mfvASIDJf0SeF1+rRHHR /SqimL7Yt4deDedybjWJHdmJej2TWSwkOlAQ8tAfEx+enstTwG3vIwEN0x8Zs9Ge8bjqn 9oCDGTFonR9CpaCX6RqTx2Mui7NtJfeCf1uDfQbfOTI+vSn+A1fYt2VSy32e5x17uQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796259849; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=OGP89q9DZgIQkOR3sjSCVQjrNM//6D4BctaarP7ymbQ=; b=xQIAS+5RuC/to8DQY5dMp6kkmgEri1YF6rFwBeg/kKDCa7D+bczCUQY+pvzEWzMD3a+A 9rsGSnlfJVqsOZi7g8ngzp26gifMf1eYNJcJJpbMtD3jA02rdlIgmjMyqrEz9/nr3Fcfq ZpP5wzFjgaYS6tRZjIkReA7dzztFa0Y8i9F67iL1JCIbAL5XlcLGR3qvaDAhQrzJ45IJc 8/m+C8COMO30MMsSxzlwH8N+eToijFDVqQVzjOy9K+U5PDF7L+grSiFI49+WKyJNml3r1 ol2EiF3HfTgzaT5Yzj6aMckYffrg7leFtFEvaflfCZ/V7vZssg99Jz9VpF0s66ftF0w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=axl8pcJV; 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 9B52E606A32C; Thu, 3 Dec 2026 01:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=axl8pcJV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CDCD1F00893; Thu, 3 Dec 2026 01:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796259849; bh=OGP89q9DZgIQkOR3sjSCVQjrNM//6D4BctaarP7ymbQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=axl8pcJVybPRThW9VlxivnhmvXsCxRUxVLdk/atJUuKpWfj1Z93qrQVOl2dJeDinn SRMW01ftwegUEBfEL+V76Ap5zO35O3zFIQ41ASomi8K6lJK7YhqE1irRDb2qRzV2CG 7smLPjVoTrsqnh407k6MNN2bdhZp5nDmZJsIDQQhRDe8cc3N1yIqXLITyihY3RIn67 MYcvDXZ4++z+c/Vxt2LDJBZLHasg3bGabUshe2IuHNZZnOGds9tzPEVHBKRj1dSDuz uB+h/VM8/ZC4k51IIzzDUVc3SIwv+rrDBhtt/GqmYuyl2rWdsiOYCHmIlD0HpWfBlC zGD+HeyHShS4A== Subject: Re: [PATCH net v7 1/7] igb: don't wait for RTNL when runtime suspending From: netdev-bot+sashiko@kernel.org To: antonio@mandelbit.com Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, janislacis06@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, sriram.yagnaraman@ericsson.com, kurt@linutronix.de, maciej.fijalkowski@intel.com, hkallweit1@gmail.com, joe@dama.to, rafael@kernel.org, sven.auhagen@voleatech.de, netdev@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, stable@vger.kernel.org Date: Thu, 03 Dec 2026 01:04:07 +0000 Message-ID: <179625984756.3146.12429470298021311101@kernel.org> In-Reply-To: <20261202002317.3140591-2-antonio@mandelbit.com> References: <20261202002317.3140591-2-antonio@mandelbit.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The new member `struct work_struct rpm_retry_task` goes into the middle of `struct igb_adapter`… Pre-existing issues: - [High] This problem wasn't introduced by this patch, but the igc driver (I225/I226) still has the same RTNL vs. RPM_SUSPENDING deadlock that… -- igb: don't wait for RTNL when runtime suspending This patch changes __igb_shutdown() to use rtnl_trylock() on the runtime suspend path. If RTNL is contended, it returns -EBUSY to avoid a deadlock with RTNL holders that resume the device. A new work item, igb_rpm_retry_task(), resumes and releases the device so that igb_runtime_idle() can schedule another suspend. > diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h > index 8c9b02058cecb..4250b4d363ea3 100644 > --- a/drivers/net/ethernet/intel/igb/igb.h > +++ b/drivers/net/ethernet/intel/igb/igb.h > @@ -586,6 +586,7 @@ struct igb_adapter { > > struct work_struct reset_task; > struct work_struct watchdog_task; > + struct work_struct rpm_retry_task; [Severity: Low] This isn't a bug, but struct igb_adapter has this comment further down: /* to not mess up cache alignment, always add to the bottom */ Placing a work_struct here moves fc_autoneg, blink_timer, pdev, stats64_lock, stats64, hw, stats, q_vector[] and the other later members to new offsets. rpm_retry_task is only used on a failed runtime suspend and in igb_remove(). Could it go below that comment instead? If the comment no longer applies, it could be updated or removed. The later patch in this series, "igb: fix RTNL assertion when resuming from runtime suspend", adds rtnl_resume_task in the same place, so the same question applies there. > bool fc_autoneg; > u8 tx_timeout_factor; > struct timer_list blink_timer; > diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c > index 131df3e09ba14..2fb9615d3bab3 100644 > --- a/drivers/net/ethernet/intel/igb/igb_main.c > +++ b/drivers/net/ethernet/intel/igb/igb_main.c [ ... ] > @@ -9500,7 +9503,18 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake, > u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol; > bool wake; > > - rtnl_lock(); > + /* The PM core marks the device as suspending before a runtime > + * suspend, and an RTNL holder resuming it meanwhile (e.g. ethtool) > + * waits for the suspend to end: waiting for RTNL here would deadlock. > + * Only try to take it: -EBUSY keeps the device active, and > + * igb_rpm_retry_task() schedules a new suspend. > + */ > + if (!runtime) { > + rtnl_lock(); > + } else if (!rtnl_trylock()) { > + schedule_work(&adapter->rpm_retry_task); > + return -EBUSY; > + } [Severity: High] This is a pre-existing issue in a sibling driver, not something introduced by this patch. Does igc have the same RTNL vs RPM_SUSPENDING deadlock that this patch fixes in igb? igc_runtime_suspend() goes through __igc_shutdown() with runtime=1, and that path takes RTNL unconditionally: drivers/net/ethernet/intel/igc/igc_main.c:igc_runtime_suspend() { return __igc_shutdown(to_pci_dev(dev), NULL, 1); } drivers/net/ethernet/intel/igc/igc_main.c:__igc_shutdown() { ... rtnl_lock(); netif_device_detach(netdev); ... } At the same time, RTNL holders resume the device, and rpm_resume() waits for the suspend in progress to finish: drivers/net/ethernet/intel/igc/igc_main.c:__igc_open() { ... if (!resuming) pm_runtime_get_sync(&pdev->dev); ... } drivers/net/ethernet/intel/igc/igc_main.c:__igc_close() { ... if (!suspending) pm_runtime_get_sync(&pdev->dev); ... } The ethtool ioctl and netlink paths in net/ethtool/ also call pm_runtime_get_sync(dev->dev.parent) while holding RTNL. igc_runtime_idle() uses the same pm_schedule_suspend(dev, 5000) scheme as igb. The trigger looks the same: link down, power/control set to auto, and an ethtool query or ip link up/down at the moment the delayed suspend runs. RTNL would then stay held, and later networking configuration would hang. This igc code has not changed since 2019, and no patch in this series touches igc. Would a matching igc fix make sense, either in this series or as a follow-up, so stable can pick up both? > netif_device_detach(netdev); > > if (netif_running(netdev)) [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202002317.3140591-1-antonio%40mandelbit.com