From: Jacob Keller <jacob.e.keller@intel.com>
To: "Nikhil P. Rao" <nikhil.rao@amd.com>, <netdev@vger.kernel.org>
Cc: <kuba@kernel.org>, <brett.creeley@amd.com>, <eric.joyner@amd.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <pabeni@redhat.com>
Subject: Re: [PATCH net] pds_core: cancel pending PCI reset work on AER recovery
Date: Mon, 27 Jul 2026 15:48:09 -0700 [thread overview]
Message-ID: <b5b19d09-c608-4694-9c24-d747d109dadb@intel.com> (raw)
In-Reply-To: <20260727170030.361116-1-nikhil.rao@amd.com>
On 7/27/2026 10:00 AM, Nikhil P. Rao wrote:
> pdsc_check_pci_health() queues pci_reset_work when it sees a broken PCI
> connection, and nothing cancels it. When the PCI core starts AER
> recovery, pdsc_pci_error_detected() runs pdsc_reset_prepare() and
> recovers the device, but a pci_reset_work queued just before is left
> pending. If it runs after recovery released the device lock, it resets a
> device the driver now considers healthy, bouncing the link for no reason.
>
> Cancel pci_reset_work in pdsc_pci_error_detected() after
> pdsc_reset_prepare(), which has already stopped the health thread so it
> cannot requeue the work. cancel_work_sync() is safe under the device
> lock here because pdsc_pci_reset_thread() uses pci_try_reset_function(),
> which returns instead of blocking on the lock. Only PFs initialize
> pci_reset_work, so guard the cancel with !is_virtfn.
>
> Fixes: 81665adf25d2 ("pds_core: Fix pdsc_check_pci_health function to use work thread")
> Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20260714180223.1642792-2-nikhil.rao%40amd.com?part=1
> Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
> ---
> drivers/net/ethernet/amd/pds_core/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c
> index 8d94a4d70395..1bdfa9893904 100644
> --- a/drivers/net/ethernet/amd/pds_core/main.c
> +++ b/drivers/net/ethernet/amd/pds_core/main.c
> @@ -555,7 +555,11 @@ static pci_ers_result_t pdsc_pci_error_detected(struct pci_dev *pdev,
> pci_channel_state_t error)
> {
> if (error == pci_channel_io_frozen) {
> + struct pdsc *pdsc = pci_get_drvdata(pdev);
> +
> pdsc_reset_prepare(pdev);
> + if (!pdev->is_virtfn)
> + cancel_work_sync(&pdsc->pci_reset_work);
> return PCI_ERS_RESULT_NEED_RESET;
> }
>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
prev parent reply other threads:[~2026-07-27 22:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 17:00 [PATCH net] pds_core: cancel pending PCI reset work on AER recovery Nikhil P. Rao
2026-07-27 22:48 ` Jacob Keller [this message]
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=b5b19d09-c608-4694-9c24-d747d109dadb@intel.com \
--to=jacob.e.keller@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.joyner@amd.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikhil.rao@amd.com \
--cc=pabeni@redhat.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