Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp12920lqj; Sat, 1 Jun 2024 06:17:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcB4cGX9bwq+LPFm06CpLa/RogAKSH1gOmyYprLCSe0k1WvHRw+jaAoiPZpAyDwfBOUL0vMGy6Q0YYLAwAq+NHuqSoUF64wfBfkD/ctw== X-Google-Smtp-Source: AGHT+IGjAlB+jJQZXHuoQkqSeDW+CRqKgXETO6D5xP/HFeMresrsD2JpoDN4O/yp4fEDaHOnC+WN X-Received: by 2002:a05:622a:134a:b0:43a:f80c:6923 with SMTP id d75a77b69052e-43ff5260a56mr59426081cf.36.1717247858086; Sat, 01 Jun 2024 06:17:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717247858; cv=pass; d=google.com; s=arc-20160816; b=CjPxz+nqkwtt0H1+I5tb2s20nBDocJGfsX9n3hh6G1ocHVPey8QPvqG11+RhQ2RvPR limB0+3aH8OqtX+NFJs8wjWEwBl2bh2lzimBZgkmhUsyrL+ocpp15IHJlJOf3VUsMxwF h9DbZ9LpPRKcBLOoR2pVeKDeelbOO77znfINXuntbib1xCQ1zlp9YABtsdRReYZFMLhF nhFrd/eIRqruizGguVcfDvGkdTGdaI3+m2fy9hGZp9e4Z0WgVgOqvMdGm3elcqj3WzHJ 162hkAPV7c0SQ4zh1eI+kso7VjzT65om9FHBhWmm8lPc88pi/VJw5/aw+dcxEChK7LmD UMoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ni+WDrPX8K31HoTIcpajwNK6IBp7J+7N5AzTTgo6UiY=; fh=0cfDyLDAjTySdBc0mM1yOTCgKG8jMm5xntRXUUL0684=; b=tGJj7A1ZpM3bfizLCtht1kyunu6dJ6+b1gVSPgRMJUFGj7q/pxSpuNxl8EclaKwcl3 epGmJcT6/WrI7LReUDWCkQPcwrSWIO7E6EzhJDzI6O6Tl7L4y6O4qtmnN7g7yUihesW9 HLZBlKe1FpF649OYrcBRkoP+RczclozMNuPHWCosJL1PU3nhuIGzrP0bL3VGdpUg5wrO RgHpB7EBpJ43cOU707gfqB93e7pf3JC4Ma5IYDogGQNNtL2i9UJOymbEyWByVZ7e8yk1 aJmUDJVpk+OGUrqGgbU+31CxSk8uWRit42J2E8inu96l4pjX7Rk9dIj8zMxdZzyLHw5d 6vpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qzwFtJx9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197864-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43ff2466b1esi44272641cf.324.2024.06.01.06.17.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 06:17:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qzwFtJx9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197864-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197864-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C4A241C21629 for ; Sat, 1 Jun 2024 13:17:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F30615217C; Sat, 1 Jun 2024 13:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qzwFtJx9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C33DE8405D; Sat, 1 Jun 2024 13:16:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717247786; cv=none; b=rlsxyo0/+JdxIeR33FLY7Jl1QSVmFQwF07iHhpJ5juDIblwwMp5R5iXkSNpA9sJwuO7w6tN09ZVnllvv81HaB3gPpRMfhb0lk5ReyFQbEi+BD2KAbhtyctg8RQ110sA8Krfd0F9HewhHm06zLdk1/PyQp6pJboPQuYUi2ahN3zM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717247786; c=relaxed/simple; bh=BDYiHLgOxFM07kj3mFIpBgiAJCFSiSzDEkmgs0Bz6e4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c/R9N2G2PGziMhsVckAst64v7ydA6Kf5airJk6VT0MwyO8zcWouFEDB4jJz5fGOZ/BGuQJGoSI4VB2TWBWiWhX9tqGJKz+YLYYRHBVOh+n8/7L4y6WfZBENpiGtG2sjWGWuzV8sPvVhtqv235Xej/eeiJgPiYEoVfjhMEy0X0Vw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qzwFtJx9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58868C116B1; Sat, 1 Jun 2024 13:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717247786; bh=BDYiHLgOxFM07kj3mFIpBgiAJCFSiSzDEkmgs0Bz6e4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qzwFtJx9UWUqPoJ4Ua9VVxFOHJjLpCQMH/v4XL3bqjyjBWK9AbgkffroAK4MHg/sx abTdKTKrMUgOkMcoVS0wgfQC8oCEzH6KzezX+liK4gT/0bwpdaYPx+ATXXbWjjU71D 1wuknLzCU5a2G2kMcveLvPflbEj8xnWzryHQuVuFc9VQ27kqCjY79w+0yZU+dXkjx/ 3HsEfhq++XE0B7g3u1xbqIVdmctaLQhGTIg1vhvqS8wvc0ARn2jVAcxSHGlo1pW2K+ Q9hsaLEH6XxBxKk03E19t217FEU7vFYefoZGTVefHpVrXdsnbVw81wiYEPD8FJHvcK w6ZjxKOc0ejJg== Date: Sat, 1 Jun 2024 14:16:20 +0100 From: Simon Horman To: Ricky Wu Cc: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rickywu0421@gmail.com, wojciech.drewek@intel.com, michal.swiatkowski@linux.intel.com, pmenzel@molgen.mpg.de, Cyrus Lien Subject: Re: [PATCH net,v2] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Message-ID: <20240601131620.GM491852@kernel.org> References: <20240530142131.26741-1-en-wei.wu@canonical.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240530142131.26741-1-en-wei.wu@canonical.com> On Thu, May 30, 2024 at 10:21:31PM +0800, Ricky Wu wrote: > A bug in https://bugzilla.kernel.org/show_bug.cgi?id=218906 describes > that irdma would break and report hardware initialization failed after > suspend/resume with Intel E810 NIC (tested on 6.9.0-rc5). > > The problem is caused due to the collision between the irq numbers > requested in irdma and the irq numbers requested in other drivers > after suspend/resume. > > The irq numbers used by irdma are derived from ice's ice_pf->msix_entries > which stores mappings between MSI-X index and Linux interrupt number. > It's supposed to be cleaned up when suspend and rebuilt in resume but > it's not, causing irdma using the old irq numbers stored in the old > ice_pf->msix_entries to request_irq() when resume. And eventually > collide with other drivers. > > This patch fixes this problem. On suspend, we call ice_deinit_rdma() to > clean up the ice_pf->msix_entries (and free the MSI-X vectors used by > irdma if we've dynamically allocated them). On resume, we call > ice_init_rdma() to rebuild the ice_pf->msix_entries (and allocate the > MSI-X vectors if we would like to dynamically allocate them). > > Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") > Tested-by: Cyrus Lien > Signed-off-by: Ricky Wu > --- > Changes in v2: > - Change title > - Add Fixes and Tested-by tags > - Fix typo > --- > drivers/net/ethernet/intel/ice/ice_main.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c > index f60c022f7960..ec3cbadaa162 100644 > --- a/drivers/net/ethernet/intel/ice/ice_main.c > +++ b/drivers/net/ethernet/intel/ice/ice_main.c > @@ -5544,7 +5544,7 @@ static int ice_suspend(struct device *dev) > */ > disabled = ice_service_task_stop(pf); > > - ice_unplug_aux_dev(pf); > + ice_deinit_rdma(pf); > > /* Already suspended?, then there is nothing to do */ > if (test_and_set_bit(ICE_SUSPENDED, pf->state)) { > @@ -5624,6 +5624,10 @@ static int ice_resume(struct device *dev) > if (ret) > dev_err(dev, "Cannot restore interrupt scheme: %d\n", ret); > > + ret = ice_init_rdma(pf); > + if (ret) > + dev_err(dev, "Reinitialize RDMA during resume failed: %d\n", ret); > + nit: The line above could trivially be wrapped to fit within 80 columns, as is preferred for Networking code. Flagged by checkpatch.pl --max-line-length=80 > clear_bit(ICE_DOWN, pf->state); > /* Now perform PF reset and rebuild */ > reset_type = ICE_RESET_PFR; > -- > 2.43.0 > >