> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of I Viswanath
> Sent: Saturday, March 14, 2026 7:28 PM
> To: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Kitszel, Przemyslaw
> <[email protected]>; Nguyen, Anthony L
> <[email protected]>; Keller, Jacob E
> <[email protected]>; [email protected];
> [email protected]
> Cc: [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; I Viswanath
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH net-next v9 1/7] net: core: Add
> state tracking for async netdev ops
>
> Async netdev ops are tricky because of the following problems:
>
> 1) Freeing the context associated with async netdev ops might require
> waiting for completion of the associated work which might require
> the
> rtnl lock or the instance lock. However this will deadlock in
> __dev_close_many as the cleanup is done with those locks already
> held.
>
> 2) We need a way to enable/disable async netdev ops depending on the
> PM
> state to allow/prevent hardware access as appropriate.
>
> We solve these problems by introducing a state variable to track the
> current state of netdev. This can take the following values:
> - ACTIVE (up and normal operation)
> - DOWN (down)
> - INACTIVE (in suspend/shutdown)
>
> To solve 1, we set the state to down in __dev_close_many. In the
> associated op handler, we check for the current state and return if
> the netdev is down.
>
> To solve 2, the commit introduces the following functions:
> - netif_enable_async_ops -> sets state to ACTIVE
> - netif_disable_async_ops -> sets state to INACTIVE and cancels any
> pending work as required.
>
> The op implementation can use the state information to do the required
> processing.
>
> Signed-off-by: I Viswanath <[email protected]>
> ---
> include/linux/netdevice.h | 29 ++++++++++++++
> net/core/dev.c | 84
> ++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 111 insertions(+), 2 deletions(-)
>
...
> --
> 2.47.3
Reviewed-by: Aleksandr Loktionov <[email protected]>