> -----Original Message-----
> From: Petr Oros <[email protected]>
> Sent: Friday, October 2, 2026 3:08 PM
> To: [email protected]
> Cc: Oros, Petr <[email protected]>; Nguyen, Anthony L
> <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Andrew Lunn <[email protected]>;
> David S. Miller <[email protected]>; Eric Dumazet
> <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni
> <[email protected]>; Lobakin, Aleksander
> <[email protected]>; Alexei Starovoitov <[email protected]>;
> Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer
> <[email protected]>; John Fastabend <[email protected]>;
> Stanislav Fomichev <[email protected]>; Henry Tieman
> <[email protected]>; Anirudh Venkataramanan
> <[email protected]>; Michal Swiatkowski
> <[email protected]>; Jesse Brandeburg
> <[email protected]>; Preethi Banala <[email protected]>;
> Kiran Patil <[email protected]>; Dan Nowlin
> <[email protected]>; Stephen Hemminger
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]
> Subject: [PATCH iwl-net 09/10] ice: program multicast magic wake
> before tearing down the main VSI
>
> Since commit 5b246e533d01 ("ice: split probe into smaller functions")
> ice_remove() calls ice_setup_mc_magic_wake() after ice_deinit(), which
> frees pf->vsi. ice_get_main_vsi() then returns NULL and the function
> returns before it sends the Manage MAC Write command, so multicast
> magic packet wake and keeping a locally administered address across
> the PF reset are never set up on shutdown with WoL enabled.
>
> Program it before the netdev and the VSIs are torn down, as it was
> done before that commit, so the current netdev address is used again.
>
> i40e had a similar problem, where the multicast magic wake setup ran
> after the admin queue had already been shut down, and fixed it in
> commit e661414c98df ("i40e: Remove duplicated prepare call in
> i40e_shutdown").
>
> Fixes: 5b246e533d01 ("ice: split probe into smaller functions")
> Assisted-by: LLM
> Signed-off-by: Petr Oros <[email protected]>
> ---
> drivers/net/ethernet/intel/ice/ice_main.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/ice/ice_main.c
> b/drivers/net/ethernet/intel/ice/ice_main.c
> index ceb9fec2af21e7..a885b3e0baaa5d 100644
> --- a/drivers/net/ethernet/intel/ice/ice_main.c
> +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> @@ -5456,6 +5456,8 @@ static void ice_remove(struct pci_dev *pdev)
> if (!ice_is_safe_mode(pf))
> ice_remove_arfs(pf);
>
> + ice_setup_mc_magic_wake(pf);
> +
> devl_lock(priv_to_devlink(pf));
> ice_dealloc_all_dynamic_ports(pf);
> ice_deinit_devlink(pf);
> @@ -5466,7 +5468,6 @@ static void ice_remove(struct pci_dev *pdev)
> ice_deinit(pf);
> ice_vsi_release_all(pf);
>
> - ice_setup_mc_magic_wake(pf);
> ice_set_wake(pf);
>
> ice_adapter_put(pdev);
> --
> 2.55.0
Reviewed-by: Aleksandr Loktionov <[email protected]>