提交 4089a51b 编写于 作者: W Weihang Li 提交者: Xie XiuQi

RDMA/hns: delete spin_lock_irqsave during add gid and delete gid

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

In add_gid and delete gid process, driver would send cmd to IMP and
use jiffies to wait the result of cmd. Jiffies cannot work in irq, so
spin_lock_irqsave should be deleted in this process.

Feature or Bugfix: Bugfix
Signed-off-by: NWeihang Li <liweihang@hisilicon.com>
Reviewed-by: Nwangxi <wangxi11@huawei.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4f608393
......@@ -127,7 +127,6 @@ static int hns_roce_del_gid(const struct ib_gid_attr *attr, void **context)
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) {
......@@ -137,15 +136,11 @@ static int hns_roce_del_gid(const struct ib_gid_attr *attr, void **context)
return -EINVAL;
}
spin_lock_irqsave(&hr_dev->iboe.lock, flags);
ret = hr_dev->hw->set_gid(hr_dev, port, attr->index, &zgid, &zattr);
if (ret)
dev_warn(hr_dev->dev, "del gid failed(%d), index = %d", ret,
attr->index);
spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
return ret;
}
#else
......@@ -155,7 +150,6 @@ static int hns_roce_add_gid(struct ib_device *device, u8 port_num,
{
struct hns_roce_dev *hr_dev = to_hr_dev(device);
u8 port = port_num - 1;
unsigned long flags;
int ret;
rdfx_func_cnt(hr_dev, RDFX_FUNC_ADD_GID);
......@@ -167,16 +161,12 @@ static int hns_roce_add_gid(struct ib_device *device, u8 port_num,
return -EINVAL;
}
spin_lock_irqsave(&hr_dev->iboe.lock, flags);
ret = hr_dev->hw->set_gid(hr_dev, port, index, (union ib_gid *)gid,
attr);
if (ret)
dev_err(hr_dev->dev, "set gid failed(%d), index = %d",
ret, index);
spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
return ret;
}
......@@ -187,7 +177,6 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
struct ib_gid_attr zattr = { };
union ib_gid zgid = { {0} };
u8 port = port_num - 1;
unsigned long flags;
int ret;
rdfx_func_cnt(hr_dev, RDFX_FUNC_DEL_GID);
......@@ -199,15 +188,11 @@ static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
return -EINVAL;
}
spin_lock_irqsave(&hr_dev->iboe.lock, flags);
ret = hr_dev->hw->set_gid(hr_dev, port, index, &zgid, &zattr);
if (ret)
dev_warn(hr_dev->dev, "del gid failed(%d), index = %d", ret,
index);
spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
return ret;
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册