Subject: RE: [PATCH net-next v4 4/5] net: wangxun: introduce soft quiesce callbacks for AER recovery

From: Jiawen Wu <[email-masked]>
Date: Tue, 2 Jun 2026 10:12:19 +0800

> > +static void ngbe_soft_quiesce(struct wx *wx) {
> > +	if (test_and_set_bit(WX_STATE_DOWN, wx->state))
> > +		return;
> > +
> > +	wx_ptp_stop(wx);
> > +	phylink_stop(wx->phylink);
> > +	pci_clear_master(wx->pdev);
> > +	wx_napi_disable_all(wx);
> > +
> > +	clear_bit(WX_FLAG_NEED_PF_RESET, wx->flags);
> > +	timer_delete_sync(&wx->service_timer);
> Can you exlplain how do you handle service_task work item that was ALREADY QUEUED before
> timer_delete_sync()? Because they are NOT cancelled here.

Waiting for the service task to complete may unnecessarily delay PCI error
recovery, especially if the work item is already blocked by the hardware
failure that triggered AER. The service task is not explicitly cancelled in the
AER quiesce path.

The device is marked WX_STATE_DOWN before the timer is stopped. For the already
queued work item, it must check WX_STATE_DOWN at entry and returns immediately
without touching hardware or driver resources.

I think what I need to change is to add WX_STATE_DOWN check at the beginning of
txgbe_service_task()/ngbe_service_task(), just like wx_update_stats() that has
done it.