OSDN Git Service

RDMA/hns: Move spin_lock_irqsave to the correct place
authorLang Cheng <chenglang@huawei.com>
Fri, 24 May 2019 07:31:22 +0000 (15:31 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 27 May 2019 20:27:59 +0000 (17:27 -0300)
commit780f33962ef27d7f27c6b47a55593c6ffd357922
treee6e3049039744aafb29899c0a1f7e2f87232c6b8
parent0502849d0bb133b492eed24fd270441e652c84cc
RDMA/hns: Move spin_lock_irqsave to the correct place

When hip08 set gid, it will call spin_unlock_bh when send cmq.  if main.ko
call spin_lock_irqsave firstly, and the kernel is before commit
f71b74bca637 ("irq/softirqs: Use lockdep to assert IRQs are
disabled/enabled"), it will cause WARN_ON_ONCE because of calling
spin_unlock_bh in disable context.

In fact, the spin_lock_irqsave in main.ko is only used for hip06, and
should be placed in hns_roce_hw_v1.c. hns_roce_hw_v2.c uses its own
spin_unlock_bh and does not need main.ko manage spin_lock.

Signed-off-by: Lang Cheng <chenglang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_hw_v1.c
drivers/infiniband/hw/hns/hns_roce_main.c