Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bogendoerfer <tbogendoerfer@suse.de>2019-06-07 13:27:44 +0200
committerThomas Bogendoerfer <tbogendoerfer@suse.de>2019-06-07 13:31:04 +0200
commit8430f553d9c7977712b320167f697127f4d5e2a8 (patch)
tree3646702edb31fd7d70e6a813a2cfb666eed35704
parenta76fd63ce817b28b22ef8626563b8aa0fcc69fd1 (diff)
RDMA/hns: Move spin_lock_irqsave to the correct place
(bsc#1104427 FATE#326416 bsc#1137236).
-rw-r--r--patches.drivers/RDMA-hns-Move-spin_lock_irqsave-to-the-correct-place.patch92
-rw-r--r--series.conf1
2 files changed, 93 insertions, 0 deletions
diff --git a/patches.drivers/RDMA-hns-Move-spin_lock_irqsave-to-the-correct-place.patch b/patches.drivers/RDMA-hns-Move-spin_lock_irqsave-to-the-correct-place.patch
new file mode 100644
index 0000000000..3a110d3ffd
--- /dev/null
+++ b/patches.drivers/RDMA-hns-Move-spin_lock_irqsave-to-the-correct-place.patch
@@ -0,0 +1,92 @@
+From: Lang Cheng <chenglang@huawei.com>
+Date: Fri, 24 May 2019 15:31:22 +0800
+Subject: RDMA/hns: Move spin_lock_irqsave to the correct place
+Patch-mainline: Queued in subsystem maintainer repository
+Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git
+Git-commit: 780f33962ef27d7f27c6b47a55593c6ffd357922
+References: bsc#1104427 FATE#326416 bsc#1137236
+
+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>
+Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
+---
+ drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 5 +++++
+ drivers/infiniband/hw/hns/hns_roce_main.c | 10 ----------
+ 2 files changed, 5 insertions(+), 10 deletions(-)
+
+--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
++++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+@@ -1780,11 +1780,14 @@ static int hns_roce_v1_set_gid(struct hn
+ int gid_index, const union ib_gid *gid,
+ const struct ib_gid_attr *attr)
+ {
++ unsigned long flags;
+ u32 *p = NULL;
+ u8 gid_idx = 0;
+
+ gid_idx = hns_get_gid_index(hr_dev, port, gid_index);
+
++ spin_lock_irqsave(&hr_dev->iboe.lock, flags);
++
+ p = (u32 *)&gid->raw[0];
+ roce_raw_write(*p, hr_dev->reg_base + ROCEE_PORT_GID_L_0_REG +
+ (HNS_ROCE_V1_GID_NUM * gid_idx));
+@@ -1801,6 +1804,8 @@ static int hns_roce_v1_set_gid(struct hn
+ roce_raw_write(*p, hr_dev->reg_base + ROCEE_PORT_GID_H_0_REG +
+ (HNS_ROCE_V1_GID_NUM * gid_idx));
+
++ spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
++
+ return 0;
+ }
+
+--- a/drivers/infiniband/hw/hns/hns_roce_main.c
++++ b/drivers/infiniband/hw/hns/hns_roce_main.c
+@@ -78,18 +78,13 @@ static int hns_roce_add_gid(const struct
+ {
+ struct hns_roce_dev *hr_dev = to_hr_dev(attr->device);
+ u8 port = attr->port_num - 1;
+- unsigned long flags;
+ int ret;
+
+ if (port >= hr_dev->caps.num_ports)
+ return -EINVAL;
+
+- spin_lock_irqsave(&hr_dev->iboe.lock, flags);
+-
+ ret = hr_dev->hw->set_gid(hr_dev, port, attr->index, &attr->gid, attr);
+
+- spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
+-
+ return ret;
+ }
+
+@@ -98,18 +93,13 @@ static int hns_roce_del_gid(const struct
+ struct hns_roce_dev *hr_dev = to_hr_dev(attr->device);
+ struct ib_gid_attr zattr = { };
+ u8 port = attr->port_num - 1;
+- unsigned long flags;
+ int ret;
+
+ if (port >= hr_dev->caps.num_ports)
+ return -EINVAL;
+
+- spin_lock_irqsave(&hr_dev->iboe.lock, flags);
+-
+ ret = hr_dev->hw->set_gid(hr_dev, port, attr->index, &zgid, &zattr);
+
+- spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
+-
+ return ret;
+ }
+
diff --git a/series.conf b/series.conf
index 41ceebb55b..6df0a2b3f8 100644
--- a/series.conf
+++ b/series.conf
@@ -46786,6 +46786,7 @@
# rdma/rdma for-next
patches.drivers/RDMA-qedr-Fix-incorrect-device-rate.patch
patches.drivers/RDMA-hns-Update-CQE-specifications.patch
+ patches.drivers/RDMA-hns-Move-spin_lock_irqsave-to-the-correct-place.patch
# dhowells/linux-fs keys-uefi
patches.suse/0001-KEYS-Allow-unrestricted-boot-time-addition-of-keys-t.patch