Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4273702rwd; Tue, 23 May 2023 05:48:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7QCIXMQncOnPX2d2qghOAosGpu2HD1QYddhwSV8XemBW4hYcEAeMA337hQUK3XlY/3kEqX X-Received: by 2002:a17:903:22c4:b0:1ae:6003:2dd9 with SMTP id y4-20020a17090322c400b001ae60032dd9mr18459068plg.43.1684846129980; Tue, 23 May 2023 05:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684846129; cv=none; d=google.com; s=arc-20160816; b=oZIXxYljU69ziAZRLXU9GURcetSzOieQPe8ItDgKMdqMXXy6MNfnVjwHVzHgo4xyex ogxBtYd0pAtEvTWCIFuOm+XzfnYU3MBA6SOeyDvFI7pIb++I9fALkqH5wajnwVdn/oUU Trl37DaQdaG7/2a+OGcy+M/XUaor3WVQwz5XY3wmXZAiT3XPdAIp1795aYEjPEK39YZJ gLVSFF32y9SOKiURnaYgui18mXcyUE9R/OR0/4bCKrtkS8PXrO1r5x2yZqjvJStyLa/V HRlX6+24tlL3RKbRgfJTcSgE8Wjgb97TZ7meZQrw9LXrxpY06x93cGW3VWhAG5ydj5wp KZfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FUz6TbBe8rx4CaEjGPka2yTCXlvkg7GMvBtFLQa8C3g=; b=wlO3DZttZxigPml2SQ+GUC6u+kVGZOaRb5UZiG9GTOVZX27hnVnjUtvCBr5L4a8rwJ rrGhGcA4fMhNthnvsVneMKTbee8SPz9p7mhxE/sb7bdXd/kHXpZpHWlqqkHvRAx3W2mK tCfvppstbS9SFBeVVjnd5D+k4TiUiS5H07M42ZypUe1EkUvE1d3mlkzfJkGBSo/7g60S 1hCuPTQyg9DOftHMzR1Ba+NxEWMfQISwWWVCt9IWUomJyoKrRxX7toVd2Fq/ZE6n3B0W TIEqeCT1NLVncaDUzJ06VUKILpDRUpySuWgbGN812yTL6fZLeVZ+o6wbz9ByxeOTCfLu +OxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a170902e54800b001afa3f973a7si5173019plf.619.2023.05.23.05.48.35; Tue, 23 May 2023 05:48:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236790AbjEWMS6 (ORCPT + 99 others); Tue, 23 May 2023 08:18:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236120AbjEWMSw (ORCPT ); Tue, 23 May 2023 08:18:52 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED5EE11F; Tue, 23 May 2023 05:18:50 -0700 (PDT) Received: from kwepemi500006.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4QQYF46lKwzLpyJ; Tue, 23 May 2023 20:15:52 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 23 May 2023 20:18:48 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-rc 2/3] RDMA/hns: Fix hns_roce_table_get return value Date: Tue, 23 May 2023 20:16:40 +0800 Message-ID: <20230523121641.3132102-3-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230523121641.3132102-1-huangjunxian6@hisilicon.com> References: <20230523121641.3132102-1-huangjunxian6@hisilicon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500006.china.huawei.com (7.221.188.68) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengchang Tang 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 Signed-off-by: Junxian Huang --- 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 aa8a08d1c014..f30274986c0d 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hem.c +++ b/drivers/infiniband/hw/hns/hns_roce_hem.c @@ -595,11 +595,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; } -- 2.30.0