]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2: fix locking when netconsole is used
authorIvan Vecera <ivecera@redhat.com>
Tue, 18 Oct 2016 06:16:03 +0000 (08:16 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 27 Feb 2017 05:57:15 +0000 (21:57 -0800)
commit3f6f8c17a27f4f47d74e426e47cce52175d3e40c
tree6d7c544cfe43d076aae9859edc6007f30d389f6c
parent1607b491764f9dbfd23e6ea891a2286988e19cbd
bnx2: fix locking when netconsole is used

Orabug: 25477840

Functions bnx2_reg_rd_ind(), bnx2_reg_wr_ind() and bnx2_ctx_wr()
can be called with IRQs disabled when netconsole is enabled. So they
should use spin_{,un}lock_irq{save,restore} instead of _bh variants.

Example call flow:
bnx2_poll()
  ->bnx2_poll_link()
    ->bnx2_phy_int()
      ->bnx2_set_remote_link()
        ->bnx2_shmem_rd()
          ->bnx2_reg_rd_ind()
            -> spin_lock_bh(&bp->indirect_lock);
               spin_unlock_bh(&bp->indirect_lock);
               ...
               -> __local_bh_enable_ip

static inline void __local_bh_enable_ip(unsigned long ip)
      WARN_ON_ONCE(in_irq() || irqs_disabled());   <<<<<< WARN

Cc: Sony Chacko <sony.chacko@qlogic.com>
Cc: Dept-HSGLinuxNICDev@qlogic.com
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6bc80629eefc3731f5881092bed610d994e05763)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnx2.c