• Eric Dumazet's avatar
    net/mlx4_en: initialize cmd.context_lock spinlock earlier · 0c5ddb51
    Eric Dumazet authored
    Maciej Żenczykowski reported lockdep warning a spinlock
    was not registered before being held in mlx4_cmd_wake_completions()
    
    cmd.context_lock initialization is not at the right place.
    
    1) mlx4_cmd_use_events() can be called multiple times.
       Calling spin_lock_init() on a live spinlock can lead
       to hangs.
    
    2) mlx4_cmd_wake_completions() can be called while lock
       has not been initialized.
       Lockdep complains, and current logic is not race prone.
    
    It seems better to move the initialization earlier in
    mlx4_load_one()
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
    Cc: Eugenia Emantayev <eugenia@mellanox.com>
    Cc: Tariq Toukan <tariqt@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0c5ddb51
main.c 115 KB