Re: [PATCH iwl-net 2/2] idpf: reset the function on shutdown
flat view
From: Tantilov, Emil S <hidden>
Date: 2026-09-18 17:55:29
Also in:
intel-wired-lan
On 9/17/2026 3:52 AM, Tian Xun Ng wrote:
quoted hunk ↗ jump to hunk
From: Tian Xun Ng <redacted> idpf_remove() ends with a function reset to leave the device clean for whoever binds it next. Commit 4c9106f4906a ("idpf: fix adapter NULL pointer dereference on reboot") replaced the idpf_remove() call in idpf_shutdown() with idpf_vc_core_deinit() and idpf_deinit_dflt_mbx(), and the reset was lost along the way. Restore it, so that the kernel started by a warm reboot or kexec finds the device in the same state as after a module unload. The reset alone does not stop the stray completion writes fixed by the previous patch: the next kernel's load-time reset already performs a reset and stale queue state was observed to survive it. It complements the previous patch, which makes the device tear its queues down first. Fixes: 4c9106f4906a ("idpf: fix adapter NULL pointer dereference on reboot") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Tian Xun Ng <redacted> --- drivers/net/ethernet/intel/idpf/idpf_main.c | 3 +++ 1 file changed, 3 insertions(+)diff --git a/drivers/net/ethernet/intel/idpf/idpf_main.c b/drivers/net/ethernet/intel/idpf/idpf_main.c index 129bccaa6..d7cd449fc 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_main.c +++ b/drivers/net/ethernet/intel/idpf/idpf_main.c@@ -197,6 +197,9 @@ static void idpf_shutdown(struct pci_dev *pdev) cancel_delayed_work_sync(&adapter->serv_task); cancel_delayed_work_sync(&adapter->vc_event_task); idpf_vc_core_deinit(adapter); + + /* Leave the device clean for the next kernel, as idpf_remove() does */ + adapter->dev_ops.reg_ops.trigger_reset(adapter, IDPF_HR_FUNC_RESET); idpf_deinit_dflt_mbx(adapter);
This alone would not be enough, you need to make sure the reset handling does not trigger in the driver. Sashiko is also marking it: https://sashiko.dev/#/patchset/20260917105205.37561-1-luckilystar08%40gmail.com you will have to set IDPF_REMOVE_IN_PROG, though I am not sure if that alone would be sufficient. Thanks, Emil
if (system_state == SYSTEM_POWER_OFF)