• Govindarajulu Varadarajan's avatar
    enic: fix possible deadlock in enic_stop/ enic_rfs_flw_tbl_free · b6931c9b
    Govindarajulu Varadarajan authored
    The following warning is shown when spinlock debug is enabled.
    
    This occurs when enic_flow_may_expire timer function is running and
    enic_stop is called on same CPU.
    
    Fix this by using spink_lock_bh().
    
    =================================
    [ INFO: inconsistent lock state ]
    3.17.0-netnext-05504-g59f35b81 #268 Not tainted
    ---------------------------------
    inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
    ifconfig/443 [HC0[0]:SC0[0]:HE1:SE1] takes:
     (&(&enic->rfs_h.lock)->rlock){+.?...}, at:
    enic_rfs_flw_tbl_free+0x34/0xd0 [enic]
    {IN-SOFTIRQ-W} state was registered at:
      [<ffffffff810a25af>] __lock_acquire+0x83f/0x21c0
      [<ffffffff810a45f2>] lock_acquire+0xa2/0xd0
      [<ffffffff814913fc>] _raw_spin_lock+0x3c/0x80
      [<ffffffffa029c3d5>] enic_flow_may_expire+0x25/0x130[enic]
      [<ffffffff810bcd07>] call_timer_fn+0x77/0x100
      [<ffffffff810bd8e3>] run_timer_softirq+0x1e3/0x270
      [<ffffffff8105f9ae>] __do_softirq+0x14e/0x280
      [<ffffffff8105fdae>] irq_exit+0x8e/0xb0
      [<ffffffff8103da0f>] smp_apic_timer_interrupt+0x3f/0x50
      [<ffffffff81493742>] apic_timer_interrupt+0x72/0x80
      [<ffffffff81018143>] default_idle+0x13/0x20
      [<ffffffff81018a6a>] arch_cpu_idle+0xa/0x10
      [<ffffffff81097676>] cpu_startup_entry+0x2c6/0x330
      [<ffffffff8103b7ad>] start_secondary+0x21d/0x290
    irq event stamp: 2997
    hardirqs last  enabled at (2997): [<ffffffff81491865>] _raw_spin_unlock_irqrestore+0x65/0x90
    hardirqs last disabled at (2996): [<ffffffff814915e6>] _raw_spin_lock_irqsave+0x26/0x90
    softirqs last  enabled at (2968): [<ffffffff813b57a3>] dev_deactivate_many+0x213/0x260
    softirqs last disabled at (2966): [<ffffffff813b5783>] dev_deactivate_many+0x1f3/0x260
    
    other info that might help us debug this:
     Possible unsafe locking scenario:
    
           CPU0
           ----
      lock(&(&enic->rfs_h.lock)->rlock);
      <Interrupt>
        lock(&(&enic->rfs_h.lock)->rlock);
    
     *** DEADLOCK ***
    Reported-by: default avatarJan Stancek <jstancek@redhat.com>
    Signed-off-by: default avatarGovindarajulu Varadarajan <_govind@gmx.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b6931c9b
enic_clsf.c 6.77 KB