From 4089a51bec0d6be0b61e12e9aa74cc7b464a31ec Mon Sep 17 00:00:00 2001 From: Weihang Li Date: Thu, 11 Jul 2019 09:34:13 +0800 Subject: [PATCH] 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: Weihang Li Reviewed-by: wangxi Reviewed-by: liuyixian Reviewed-by: Yang Yingliang Signed-off-by: Yang Yingliang --- drivers/infiniband/hw/hns/hns_roce_main.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c index f7876d833ba9..3dc629725557 100644 --- a/drivers/infiniband/hw/hns/hns_roce_main.c +++ b/drivers/infiniband/hw/hns/hns_roce_main.c @@ -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 -- GitLab