> -----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 5/7] 8139cp: Implement
> ndo_set_rx_mode_async callback
> 
> Implement the ndo_set_rx_mode_async callback and update the driver to
> use the snapshot/commit model for RX mode update.
> 
> Signed-off-by: I Viswanath <[email protected]>
> ---
> 
> Call paths involving netif_set_rx_mode in 8139cp
> 
> netif_set_rx_mode
> |-- cp_init_hw
> |   |-- cp_open (ndo_open, takes lock)
> |   |   `-- cp_change_mtu (ndo_change_mtu, takes lock)
> |   |
> |   `-- cp_resume (lock added)
> |
> `-- cp_tx_timeout (ndo_tx_timeout, takes lock)
> 
>  drivers/net/ethernet/realtek/8139cp.c | 49 ++++++++++++++++++--------
> -
>  1 file changed, 33 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/8139cp.c
> b/drivers/net/ethernet/realtek/8139cp.c
> index 5652da8a178c..9651a0d9d8f0 100644
> --- a/drivers/net/ethernet/realtek/8139cp.c
> +++ b/drivers/net/ethernet/realtek/8139cp.c
> @@ -372,7 +372,6 @@ struct cp_private {
>       } while (0)

...

>  static void __cp_get_stats(struct cp_private *cp) @@ -1040,7 +1042,7
> @@ static void cp_init_hw (struct cp_private *cp)
>       cp_start_hw(cp);
>       cpw8(TxThresh, 0x06); /* XXX convert magic num to a constant */
> 
> -     __cp_set_rx_mode(dev);
> +     netif_set_rx_mode(dev);
>       cpw32_f (TxConfig, IFG | (TX_DMA_BURST << TxDMAShift));
> 
>       cpw8(Config1, cpr8(Config1) | DriverLoaded | PMEnable); @@ -
> 1262,7 +1264,7 @@ static void cp_tx_timeout(struct net_device *dev,
> unsigned int txqueue)
>       cp_clean_rings(cp);
>       cp_init_rings(cp);
>       cp_start_hw(cp);
> -     __cp_set_rx_mode(dev);
> +     netif_set_rx_mode(dev);
I'm afraid netif_set_rx_mode() in async mode expects netdev ops lock context.
Driver lock != netdev ops lock by definition.
If this path does not hold the required ops lock, lockdep/WARN can trigger.

>       cpw16_f(IntrMask, cp_norx_intr_mask);
> 
>       netif_wake_queue(dev);
> @@ -1870,6 +1872,7 @@ static const struct net_device_ops cp_netdev_ops
> = {
>       .ndo_validate_addr      = eth_validate_addr,
>       .ndo_set_mac_address    = cp_set_mac_address,
>       .ndo_set_rx_mode        = cp_set_rx_mode,
> +     .ndo_set_rx_mode_async  = cp_set_rx_mode_async,
>       .ndo_get_stats          = cp_get_stats,
>       .ndo_eth_ioctl          = cp_ioctl,
>       .ndo_start_xmit         = cp_start_xmit,
> @@ -2071,7 +2074,7 @@ static int __maybe_unused cp_suspend(struct

...

Reply via email to