From mboxrd@z Thu Jan 1 00:00:00 1970 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 E80BB14A09C; Tue, 25 Jun 2024 09:39:45 +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=1719308386; cv=none; b=CaTtkUIdh8MihSpcef8gxgPcfiVRXhO+TGNNCWnRh7kNOyyAC9ei50ArVOIUxofQyjzopjsGrMqaGjvrLvy+arLj8eU5mMiDdaRcNHi/Zzf6Yf0ePnCzAftxzULc26hyVDFCDDyeGi7af/q17DhkLaTtEPiPD1q7gEtFn/PQPX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719308386; c=relaxed/simple; bh=rykksMjaiuUnSLRDIAjzy5IKERardNd1+NfYV3dlEc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hh+LOccwvyCviaxelD721aj4t8mzwDXu3KT1IfNdHunfEq0nFK9J9hKMrp0zYX4BcDrdg9XDNGjxPY3RZa5YUke9C438Cog97O1NDLSig/J95hSB75qACbpEeMXtX2QR3sUrqL4ZG0TRgIbuQiQh/e6ywL1+docWpcvnRwFqsYA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Kh8U9GHl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Kh8U9GHl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BEDAC32781; Tue, 25 Jun 2024 09:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719308385; bh=rykksMjaiuUnSLRDIAjzy5IKERardNd1+NfYV3dlEc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kh8U9GHl/NL0lb9QRmfUk/48jgz/0FDJ50sz3BnGcWGthNc7hZWDq7d/F08ZUoQIp vc8vYdWyw93y25gPABb556QoB5jDbIGLUP8bmIn/9r4Lrv7CARSOFqWOaIAHPliS7y 2AfB8fmjIWsQxdd4gZfgu93Rnc7cncVAkdxiNjmE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Cyrus Lien , En-Wei Wu , Wojciech Drewek , Tony Nguyen , Sasha Levin , Pucha Himasekhar Reddy Subject: [PATCH 6.9 104/250] ice: avoid IRQ collision to fix init failure on ACPI S3 resume Date: Tue, 25 Jun 2024 11:31:02 +0200 Message-ID: <20240625085552.061935675@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240625085548.033507125@linuxfoundation.org> References: <20240625085548.033507125@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: En-Wei Wu [ Upstream commit bc69ad74867dba1377abe14356c94a946d9837a3 ] 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: En-Wei Wu Reviewed-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 10fef2e726b39..f052bccb50a08 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -5451,7 +5451,7 @@ static int __maybe_unused 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)) { @@ -5531,6 +5531,11 @@ static int __maybe_unused 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); + clear_bit(ICE_DOWN, pf->state); /* Now perform PF reset and rebuild */ reset_type = ICE_RESET_PFR; -- 2.43.0