[PATCH iwl-net 2/2] idpf: reset the function on shutdown

Loktionov, Aleksandr aleksandr.loktionov at intel.com
Fri Sep 18 15:46:16 UTC 2026



> -----Original Message-----
> From: Tian Xun Ng <luckilystar08 at gmail.com>
> Sent: Thursday, September 17, 2026 12:52 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: netdev at vger.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen at intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel at intel.com>; Lobakin, Aleksander
> <aleksander.lobakin at intel.com>; Tantilov, Emil S
> <emil.s.tantilov at intel.com>; andrew+netdev at lunn.ch;
> davem at davemloft.net; edumazet at google.com; kuba at kernel.org;
> pabeni at redhat.com; Tian Xun Ng <tianxun.ng at bytedance.com>
> Subject: [PATCH iwl-net 2/2] idpf: reset the function on shutdown
> 
> From: Tian Xun Ng <tianxun.ng at bytedance.com>
> 
> 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 at vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Tian Xun Ng <tianxun.ng at bytedance.com>
> ---
>  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);
> 
>  	if (system_state == SYSTEM_POWER_OFF)
> --
> 2.50.1 (Apple Git-155)

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>


More information about the Intel-wired-lan mailing list