From 31b78d3de5f39ad6b0345b2ff97f9093b9017313 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Thu, 27 Oct 2022 18:37:06 +0800 Subject: [PATCH] RDMA/hns: Fix hns_roce_table_get return value driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5X0C3 --------------------------------------------------------------------- The return value of set_hem has been fixed to ENODEV, which will lead a diagnostic information missing. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Signed-off-by: Chengchang Tang Reviewed-by: Yangyang Li Reviewed-by: Haoyue Xu Reviewed-by: YueHaibing Signed-off-by: Zheng Zengkai --- drivers/infiniband/hw/hns/hns_roce_hem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hem.c b/drivers/infiniband/hw/hns/hns_roce_hem.c index a5f7b8775756..e158b41328f3 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -596,11 +596,12 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev, } /* Set HEM base address(128K/page, pa) to Hardware */ - if (hr_dev->hw->set_hem(hr_dev, table, obj, HEM_HOP_STEP_DIRECT)) { + ret = hr_dev->hw->set_hem(hr_dev, table, obj, HEM_HOP_STEP_DIRECT); + if (ret) { hns_roce_free_hem(hr_dev, table->hem[i]); table->hem[i] = NULL; - ret = -ENODEV; - dev_err(dev, "set HEM base address to HW failed.\n"); + dev_err(dev, "set HEM base address to HW failed, ret = %d.\n", + ret); goto out; } -- GitLab