mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Aaron Ma <aaron.ma@canonical.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Alexander Lobakin <aleksander.lobakin@intel.com>,
	Richard Cochran <richardcochran@gmail.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Dan Nowlin <dan.nowlin@intel.com>,
	Brett Creeley <brett.creeley@intel.com>,
	"moderated list:INTEL ETHERNET DRIVERS"
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [PATCH 5/5] ice: quiesce PTP periodic work before system suspend
Date: Thu, 22 Oct 2026 11:22:24 -0700	[thread overview]
Message-ID: <d88c476e-d1cf-4769-81ba-f0e1bd2413d0@intel.com> (raw)
In-Reply-To: <20261019105155.3793063-6-aaron.ma@canonical.com>

On 10/19/2026 3:51 AM, Aaron Ma wrote:
> ice_suspend() stops the main service task but leaves PTP work active.
> The PTP kworker is not freezable, so it can continue issuing MMIO
> accesses after the PCI function has entered D3hot. Both the periodic
> work updating the cached PHC time and the E822 offset calibration work,
> which reschedules itself while calibration is pending, are affected.
> 
> Synchronously cancel both works when PTP is ready, after disabling the
> VSIs and before shutting down the control queues.
> 
> Fixes: 77a781155a65 ("ice: enable receive hardware timestamping")
> Fixes: a69f1cb62aec ("ice: exit bypass mode once hardware finishes timestamp calibration")
> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> index ddebb28b2454f..3962910759067 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -5450,6 +5450,12 @@ static void ice_prepare_for_shutdown(struct ice_pf *pf)
>  	/* disable the VSIs and their queues that are not already DOWN */
>  	ice_pf_dis_all_vsi(pf, false);
>  
> +	if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags) &&
> +	    pf->ptp.state == ICE_PTP_READY) {
> +		kthread_cancel_delayed_work_sync(&pf->ptp.work);
> +		kthread_cancel_delayed_work_sync(&pf->ptp.port.ov_work);
> +	}
> +
>  	ice_for_each_vsi(pf, v)
>  		if (pf->vsi[v])
>  			pf->vsi[v]->vsi_num = 0;

I don't think kthread has the same API as workers to fully disable
re-queueing, but at least the periodic work is only requeueud within its
own run or by rebuild flows. ov_work I am not fully sure about, I guess
it depends on if this can race with another thread that would
re-schedule. I believe the PTP teardown also cancel the tasks but may
happen later than needed? But maybe we lack a PTP flow for
prepare_for_shutdown. Hmm.

This is at least better than what we do now so:

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

      parent reply	other threads:[~2026-10-22 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 10:51 [PATCH 0/5] ice: fix reset and suspend paths Aaron Ma
2026-10-19 10:51 ` [PATCH 1/5] ice: check the full PF reset polling limit Aaron Ma
2026-10-19 11:28   ` Temerkhanov, Sergey
2026-10-19 11:30   ` Przemek Kitszel
2026-10-19 10:51 ` [PATCH 2/5] ice: retain the adapter throughout hardware initialization and teardown Aaron Ma
2026-10-19 11:29   ` Temerkhanov, Sergey
2026-10-20  9:24   ` Przemek Kitszel
2026-10-22 18:06     ` Jacob Keller
2026-10-19 10:51 ` [PATCH 3/5] ice: scope global configuration lock to the adapter Aaron Ma
2026-10-21 11:12   ` Loktionov, Aleksandr
2026-10-22  8:17     ` Aaron Ma
2026-10-22 11:10   ` Przemek Kitszel
2026-10-22 18:19     ` Jacob Keller
2026-10-19 10:51 ` [PATCH 4/5] ice: clear DVM boost table before scanning package hints Aaron Ma
2026-10-19 10:51 ` [PATCH 5/5] ice: quiesce PTP periodic work before system suspend Aaron Ma
2026-10-21 12:14   ` Loktionov, Aleksandr
2026-10-22 18:22   ` 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=d88c476e-d1cf-4769-81ba-f0e1bd2413d0@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=aaron.ma@canonical.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=brett.creeley@intel.com \
    --cc=dan.nowlin@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=richardcochran@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

all inboxes | Powered by JetHome®