From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E14E12848BA for ; Tue, 2 Jun 2026 02:13:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.243.244.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780366403; cv=none; b=FdCkFn7mEe6b91nMiUcxRm7q7VMe9FPkL2vtoaYG+Ui52Hw1UWq3V3H6zfw/pLAu3/gw3lPnFhg1lAbq1YlTbBuxjacrm4voNFpDCCKrSyne/EBnawU1PZPVdun8FUmSmzGWqA+KXAjewJa/ILstSTnAhzMc2/iiJEHr76Ud0Ds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780366403; c=relaxed/simple; bh=t96XXTrqZwco/ZkN4JS01QjTUI1n6trfRiYNOt+Gt8M=; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=l2iJJNyJmrWSzvmLTCQPsrxlKl2faFBUjgA4MKYVmcKscv7DYrn22wbOq4tko5lIkphvYusKsJG7xuWhMidjEFgKwH09202ibLEt76IK5lNF7KZjiKwjNvgEIXp6elhMTteHutZoCdUWpTSC764N+xZ9sXTgsSi65nkzl1OqfjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trustnetic.com; spf=pass smtp.mailfrom=trustnetic.com; arc=none smtp.client-ip=54.243.244.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=trustnetic.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=trustnetic.com X-QQ-mid:Yeas4t1780366340t795t39840 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [36.24.207.111]) X-QQ-SSF:0001000000000000000000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 13029302356404573232 To: "'Loktionov, Aleksandr'" , , Cc: "'Mengyuan Lou'" , "'Andrew Lunn'" , "'David S. Miller'" , "'Eric Dumazet'" , "'Jakub Kicinski'" , "'Paolo Abeni'" , "'Richard Cochran'" , "'Russell King'" , "'Keller, Jacob E'" , "'Michal Swiatkowski'" , "'Simon Horman'" , "'Kees Cook'" , "'Zaremba, Larysa'" , "'Ingo Molnar'" , "'Joe Damato'" , "'Breno Leitao'" , =?iso-8859-1?Q?'Uwe_Kleine-K=F6nig_=28The_Capable_Hub=29'?= , "'Johannes Berg'" , "'Fabio Baltieri'" , "'Mengyuan Lou'" , "'Andrew Lunn'" , "'David S. Miller'" , "'Eric Dumazet'" , "'Jakub Kicinski'" , "'Paolo Abeni'" , "'Richard Cochran'" , "'Russell King'" , "'Keller, Jacob E'" , "'Michal Swiatkowski'" , "'Simon Horman'" , "'Kees Cook'" , "'Zaremba, Larysa'" , "'Ingo Molnar'" , "'Joe Damato'" , "'Breno Leitao'" , =?iso-8859-1?Q?'Uwe_Kleine-K=F6nig_=28The_Capable_Hub=29'?= , "'Johannes Berg'" , "'Fabio Baltieri'" References: <20260601072221.2952-1-jiawenwu@trustnetic.com> <20260601072221.2952-5-jiawenwu@trustnetic.com> In-Reply-To: Subject: RE: [PATCH net-next v4 4/5] net: wangxun: introduce soft quiesce callbacks for AER recovery Date: Tue, 2 Jun 2026 10:12:19 +0800 Message-ID: <088e01dcf235$3dabf3e0$b903dba0$@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: zh-cn Thread-Index: AQEmZmPiFxLXVQw6wm5cjAUm9/PfJgGkmD0MAkd9jI+3eDeb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LHQAag/sCnM1Kvq7+vdEvvFwnI86d/u3YmL1ThYjKp1wT/y8TWtK3RtjNpBL+/z1DB wqvtyqd74CNm8RA89ahdpnRAtK/jsQz4RMz3d1CZ0VEe00TfonukrRuyUAfeg5EC2pJwTqh Q== X-QQ-XMRINFO: M/715EihBoGS47X28/vv4NpnfpeBLnr4Qg== X-QQ-RECHKSPAM: 0 > > +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.