From: Wojciech Drewek <wojciech.drewek@intel.com>
To: Ricky Wu <en-wei.wu@canonical.com>, <jesse.brandeburg@intel.com>
Cc: <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>,
Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Subject: Re: [PATCH] ice: irdma hardware init failed after suspend/resume
Date: Tue, 28 May 2024 12:43:05 +0200 [thread overview]
Message-ID: <43e74464-029d-431f-93e2-809d64371c4c@intel.com> (raw)
In-Reply-To: <20240528100315.24290-1-en-wei.wu@canonical.com>
On 28.05.2024 12:03, 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).
>
> Signed-off-by: Ricky Wu <en-wei.wu@canonical.com>
> ---
Thanks for the patch!
> 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);
I think this should be called later in the reset path IMO.
You should call ice_deinit_rdma in ice_prepare_for_reset (replace ice_unplug_aux_dev),
>
> /* 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);
And ice_init_rdma should be moved to ice_rebuild (replace ice_plug_aux_dev)
> +
> clear_bit(ICE_DOWN, pf->state);
> /* Now perform PF reset and rebuild */
> reset_type = ICE_RESET_PFR;
next prev parent reply other threads:[~2024-05-28 10:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 10:03 [PATCH] ice: irdma hardware init failed after suspend/resume Ricky Wu
2024-05-28 10:43 ` [Intel-wired-lan] " Michal Swiatkowski
2024-05-28 10:43 ` Wojciech Drewek [this message]
2024-05-28 11:12 ` Paul Menzel
2024-05-29 3:17 ` En-Wei WU
2024-05-29 20:18 ` Paul Menzel
2024-05-30 7:08 ` En-Wei WU
2024-05-30 7:55 ` Paul Menzel
2024-05-31 9:37 ` Wojciech Drewek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43e74464-029d-431f-93e2-809d64371c4c@intel.com \
--to=wojciech.drewek@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=en-wei.wu@canonical.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rickywu0421@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).