Commit 49fdf6bb authored by Lijun Ou's avatar Lijun Ou Committed by Doug Ledford

IB/hns: Modify the init of iboe lock

This lock will be used in query port interface, and will be called
while IB device was registered to OFED framework/IB Core. So, the
lock of iboe must be initiated before IB device was registered.
Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarDongdong Huang(Donald) <hdd.huang@huawei.com>
Reviewed-by: default avatarWei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent c4a193d3
...@@ -602,6 +602,7 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev) ...@@ -602,6 +602,7 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
struct device *dev = &hr_dev->pdev->dev; struct device *dev = &hr_dev->pdev->dev;
iboe = &hr_dev->iboe; iboe = &hr_dev->iboe;
spin_lock_init(&iboe->lock);
ib_dev = &hr_dev->ib_dev; ib_dev = &hr_dev->ib_dev;
strlcpy(ib_dev->name, "hisi_%d", IB_DEVICE_NAME_MAX); strlcpy(ib_dev->name, "hisi_%d", IB_DEVICE_NAME_MAX);
...@@ -686,8 +687,6 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev) ...@@ -686,8 +687,6 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
goto error_failed_setup_mtu_gids; goto error_failed_setup_mtu_gids;
} }
spin_lock_init(&iboe->lock);
iboe->nb.notifier_call = hns_roce_netdev_event; iboe->nb.notifier_call = hns_roce_netdev_event;
ret = register_netdevice_notifier(&iboe->nb); ret = register_netdevice_notifier(&iboe->nb);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment