From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17606FF8850 for ; Fri, 24 Apr 2026 23:42:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A9D3140C49; Fri, 24 Apr 2026 23:42:41 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KknxVslpKo4z; Fri, 24 Apr 2026 23:42:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DCA1140C45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1777074160; bh=+FK47/YVSXCzd/k8sYv3lFTZMqjyAVmDEZ/iJ1TVHxk=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=434W0wFYCu6g2lx/YM5hAj1laNHLLrCYoIxBg6doOkCspoMNCO08LOKdutSbsChuR 1m2MWcshRkDrPnmULFQBkzA24ZD3FtRRRpJFjYiZsBk6ip1bISbfc6solPkddoR+/f RIuKuHkeswRoEfPstC/6s/tNTwLlAoBCnozJ+xr3bA8JtmMKzSssjd/HKEnXBrSYOC OS6xNPovNGwIaF2rnaECz8DI9Iz4sQdJbq56dFVddgF+zBCWYT9WVjZONmp9VFT72M RVOhVshQMGIEM1CMExNz3ijVZa0E0RX2AbrShA+tiknaVtj0xywyMKUl/d60XBcYGG HAxjZp9bUoJQw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id DCA1140C45; Fri, 24 Apr 2026 23:42:40 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id B9D98194 for ; Fri, 24 Apr 2026 23:42:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B3792607FF for ; Fri, 24 Apr 2026 23:42:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id gHbKF0KX2gkA for ; Fri, 24 Apr 2026 23:42:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=49.212.198.91; helo=www2881.sakura.ne.jp; envelope-from=kohei@enjuk.jp; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 8391D607FE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8391D607FE Received: from www2881.sakura.ne.jp (www2881.sakura.ne.jp [49.212.198.91]) by smtp3.osuosl.org (Postfix) with ESMTPS id 8391D607FE for ; Fri, 24 Apr 2026 23:42:37 +0000 (UTC) Received: from x1 (130.4.31.150.dy.iij4u.or.jp [150.31.4.130]) (authenticated bits=0) by www2881.sakura.ne.jp (8.16.1/8.16.1) with ESMTPSA id 63ONg3iG088695 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 25 Apr 2026 08:42:05 +0900 (JST) (envelope-from kohei@enjuk.jp) Date: Sat, 25 Apr 2026 08:42:03 +0900 From: Kohei Enju To: Aaron Ma Cc: Tony Nguyen , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Akeem G Abodunrin , Jesse Brandeburg , intel-wired-lan@lists.osuosl.org Message-ID: References: <20260424030345.1140665-1-aaron.ma@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260424030345.1140665-1-aaron.ma@canonical.com> X-Mailman-Original-DKIM-Signature: a=rsa-sha256; bh=+FK47/YVSXCzd/k8sYv3lFTZMqjyAVmDEZ/iJ1TVHxk=; c=relaxed/relaxed; d=enjuk.jp; h=From:Message-ID:To:Subject:Date; s=rs20251215; t=1777074127; v=1; b=Q9/wSQCxMei5CVr8QdHvKLXJdkEUKGKTV3t0F7DuavvKztDEAZBRyX74OJARZPTN eKDLcgXNzGZuDNc/3XnL3hXJodwxJB1f3Idp40f64ksQSe1owdVEtQ8kX4d4mxnD xlsZZOWbua2zqoqMcsbuQzB0TlJ9AUZ5SS1iA9Z97VcAtTxymkVHtYEhGalQRzcm vYVQgMqqJp8G+vxIdMxo87KziIyy5leyOOqsAvwuE9cGniDUXoDHcAOcScsyeYJI Kb7+msiI/HtRfxJdey7nTk9CIDp20k2B5qimIIEezZuq+emmpzi0M6XShYw63qph dWejcHyui2IrDZEJDHGT3g== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=enjuk.jp X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=enjuk.jp header.i=@enjuk.jp header.a=rsa-sha256 header.s=rs20251215 header.b=Q9/wSQCx Subject: Re: [Intel-wired-lan] [PATCH v2] ice: wait for reset completion in ice_resume() X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On 04/24 11:03, Aaron Ma wrote: > ice_resume() schedules an asynchronous PF reset and returns > immediately. The reset runs later in ice_service_task(). If > userspace tries to bring up the net device before the reset > finishes, ice_open() fails with -EBUSY: > > ice_resume() > ice_schedule_reset() # sets ICE_PFR_REQ, returns > ... > ice_open() > ice_is_reset_in_progress() # ICE_PFR_REQ still set, -EBUSY > ... > ice_service_task() > ice_do_reset() > ice_rebuild() # clears ICE_PFR_REQ, too late > > Reproduced on E800 series NICs during suspend/resume with irdma > enabled, where the aux device probe widens the race window. > > Wait for the reset to complete before returning from ice_resume(). > > Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL") > Cc: stable@vger.kernel.org > Signed-off-by: Aaron Ma > --- > v2: reword comment to clarify best-effort semantics (Kohei Enju) > > drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c > index 5f92377d4dfc2..a81eb21ea87c1 100644 > --- a/drivers/net/ethernet/intel/ice/ice_main.c > +++ b/drivers/net/ethernet/intel/ice/ice_main.c > @@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev) > /* Restart the service task */ > mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period)); > > + /* Best-effort wait for the scheduled reset to finish so that the > + * device is operational before returning. Without this, userspace > + * (e.g. NetworkManager) may try to open the net device while the > + * asynchronous reset is still in progress, hitting -EBUSY. > + */ Thanks for the update! Reviewed-by: Kohei Enju > + ret = ice_wait_for_reset(pf, 10 * HZ); > + if (ret) > + dev_err(dev, "Wait for reset failed during resume: %d\n", ret); > + > return 0; > } > > -- > 2.43.0 >