All of lore.kernel.org
 help / color / mirror / Atom feed
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 v2] pds_core: keep the health thread stopped during reset
Date: Wed, 22 Jul 2026 13:03:39 -0700	[thread overview]
Message-ID: <b4fdd9b2-9f5e-4999-aa4e-1496043b6d2b@intel.com> (raw)
In-Reply-To: <20260722001621.22527-1-nikhil.rao@amd.com>

On 7/21/2026 5:16 PM, Nikhil P. Rao wrote:
> Commit d9407ff11809 ("pds_core: Prevent health thread from running
> during reset/remove") stops the health thread with cancel_work_sync()
> before a reset, but a devcmd timeout during pdsc_fw_down() re-queues
> health_work, so pdsc_health_thread() runs again mid-reset and double
> allocates the core DMA queues via pdsc_fw_up().
> 
> Only the reset path is affected. On remove, PDSC_S_STOPPING_DRIVER gates
> the health thread.
> 
> Use disable_work_sync() instead, it cancels the pending work and
> disables the item, so the pdsc_fw_down() re-queue becomes a no-op.
> pdsc_restart_health_thread() re-enables it with enable_work().
> 
> Fixes: d9407ff11809 ("pds_core: Prevent health thread from running during reset/remove")
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
> Reported-by: sashiko-bot <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20260629200358.2626129-1-nikhil.rao%40amd.com?part=2
> Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
> ---

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/amd/pds_core/main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c
> index 22db78343eb0..3e34350b169b 100644
> --- a/drivers/net/ethernet/amd/pds_core/main.c
> +++ b/drivers/net/ethernet/amd/pds_core/main.c
> @@ -465,7 +465,7 @@ static void pdsc_stop_health_thread(struct pdsc *pdsc)
>  
>  	timer_shutdown_sync(&pdsc->wdtimer);
>  	if (pdsc->health_work.func)
> -		cancel_work_sync(&pdsc->health_work);
> +		disable_work_sync(&pdsc->health_work);
>  }
>  
>  static void pdsc_restart_health_thread(struct pdsc *pdsc)
> @@ -473,6 +473,7 @@ static void pdsc_restart_health_thread(struct pdsc *pdsc)
>  	if (pdsc->pdev->is_virtfn)
>  		return;
>  
> +	enable_work(&pdsc->health_work);
>  	timer_setup(&pdsc->wdtimer, pdsc_wdtimer_cb, 0);
>  	mod_timer(&pdsc->wdtimer, jiffies + 1);
>  }


  reply	other threads:[~2026-07-22 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22  0:16 [PATCH net v2] pds_core: keep the health thread stopped during reset Nikhil P. Rao
2026-07-22 20:03 ` Jacob Keller [this message]
2026-07-23 14:17 ` Jakub Kicinski

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=b4fdd9b2-9f5e-4999-aa4e-1496043b6d2b@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.