RE: [Intel-wired-lan] [PATCH iwl-next v4 10/15] idpf: make mbx_task queueing and cancelling more consistent

From: Salin, Samuel
Date: Tue Jun 10 2025 - 17:52:23 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf Of
> Larysa Zaremba
> Sent: Friday, May 16, 2025 7:58 AM
> To: intel-wired-lan@xxxxxxxxxxxxxxxx; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Simon Horman <horms@xxxxxxxxxx>; Jonathan
> Corbet <corbet@xxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Jiri Pirko <jiri@xxxxxxxxxxx>; Nikolova, Tatyana
> E <tatyana.e.nikolova@xxxxxxxxx>; Andrew Lunn <andrew+netdev@xxxxxxx>;
> Lobakin, Aleksander <aleksander.lobakin@xxxxxxxxx>; Michael Ellerman
> <mpe@xxxxxxxxxxxxxx>; Fijalkowski, Maciej <maciej.fijalkowski@xxxxxxxxx>;
> Lee Trager <lee@xxxxxxxxx>; Madhavan Srinivasan <maddy@xxxxxxxxxxxxx>;
> Zaremba, Larysa <larysa.zaremba@xxxxxxxxx>; Samudrala, Sridhar
> <sridhar.samudrala@xxxxxxxxx>; Keller, Jacob E <jacob.e.keller@xxxxxxxxx>;
> Michal Swiatkowski <michal.swiatkowski@xxxxxxxxxxxxxxx>; Polchlopek,
> Mateusz <mateusz.polchlopek@xxxxxxxxx>; Zaki, Ahmed
> <ahmed.zaki@xxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; linux-
> doc@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Karlsson, Magnus
> <magnus.karlsson@xxxxxxxxx>; Tantilov, Emil S <emil.s.tantilov@xxxxxxxxx>;
> Chittim, Madhu <madhu.chittim@xxxxxxxxx>; Hay, Joshua A
> <joshua.a.hay@xxxxxxxxx>; Olech, Milena <milena.olech@xxxxxxxxx>; Linga,
> Pavan Kumar <pavan.kumar.linga@xxxxxxxxx>; Singhai, Anjali
> <anjali.singhai@xxxxxxxxx>; Kubiak, Michal <michal.kubiak@xxxxxxxxx>
> Subject: [Intel-wired-lan] [PATCH iwl-next v4 10/15] idpf: make mbx_task
> queueing and cancelling more consistent
>
> As a consequence of refactoring idpf code to use libeth APIs,
> idpf_vc_xn_shutdown was merged with and replaced by
> idpf_deinit_dflt_mbx.
> This does not affect the Tx path, as it checked for a presence of an xn manager
> anyway. Rx processing is handled by the mbx_task that is not always cancelled
> before calling the new consolidated mailbox deinit function.
> Moreover, in the reset path idpf_intr_rel() reschedules it after the deinit is
> done. This leads to mbx_task referencing the freed mailbox and causing
> KASAN warnings.
>
> To remedy this, in the init path, do the first queueing of mbx_task in
> idpf_init_dflt_mbx(), in deinit and reset, always cancel the task in
> idpf_deinit_dflt_mbx() and in every flow first call idpf_mb_intr_rel_irq().
>
> Reviewed-by: Michal Kubiak <michal.kubiak@xxxxxxxxx>
> Signed-off-by: Larysa Zaremba <larysa.zaremba@xxxxxxxxx>
> ---
> 2.47.0

Tested-by: Samuel Salin <Samuel.salin@xxxxxxxxx>