From patchwork Mon Oct 7 21:18:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175412 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4816676ill; Mon, 7 Oct 2019 14:19:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwR5iKYMOttwCS+DoIa6NS0RkX+f1mbWh38a/6j73W31C97YmGMOWm3OmAl3WprTFR9ZlK7 X-Received: by 2002:a50:ab83:: with SMTP id u3mr30662815edc.228.1570483139860; Mon, 07 Oct 2019 14:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570483139; cv=none; d=google.com; s=arc-20160816; b=DUdyTpfFxUS0h12t8hNxH5i2gfg8Pdcwp1nXH5Nqm7e6ATlm1tz1/fQSqTnxCJR9tZ If+1Bd+optqkh47LpjPcvOQlptg5XBceXWlbBnrM872yIAbGC2eAb6GO+B2xOiE7/zp4 QNYm0WAm7aifNuI9XahNjRwAt5bEWRRk6CpQjE17+6bF11BMSAsy9UdbwS/uPN+QEHVI NwVftwUlsfObYlGRdl0qSOrIAAzelb9mV2Ce7Rp24Z9TAcMzAhV72LhIICwt+1OmXRmP ErBEDZFQ9JHffBkRuMNlQ34vPFsRefwG+ODDMGTJ7ZVTzvSF4+UpkCzoPNNQPAWVat0o Cm/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kKf+rwWr3FwgvAg+F1kCJspTgHtxhM1hsSEjfrpcTD8=; b=gDnUYie7nP5SMh0NVYoH4USMEzj4MchM3vFofKqW09J1W8Ldkgd0j/7FiSjGyunS/d 7BzDdGLMM3+6iQzFG1+qbuAdnv7hz1EYsQ8XFbIyWKxivhxfz0laiFXr2BXtFpDj5xwZ 6CwADyz4tXED9f481gdq2VOoVeJ+tAeGTgPWFSz6FyG0+puw145bBCqyN/ql5lLr1YW1 6PurS0vQ9q0UQRzo+LzJZNXgRAb5eW90hv5JwFzIScuH7g/EGvDluAHKKqlyN7zk+qOl w7DQJrdPu8qxxqHibUN1oy/s64QuVSL3gJSgS89+yg/uoR5rtuTnJT5UTHoEXpw+xTZR k+JQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s14si9890612edc.83.2019.10.07.14.18.59; Mon, 07 Oct 2019 14:18:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729563AbfJGVS4 (ORCPT + 26 others); Mon, 7 Oct 2019 17:18:56 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:57431 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729528AbfJGVSx (ORCPT ); Mon, 7 Oct 2019 17:18:53 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1N0qmr-1hwMca18BJ-00wmyc; Mon, 07 Oct 2019 23:18:29 +0200 From: Arnd Bergmann To: Lijun Ou , "Wei Hu(Xavier)" , Doug Ledford , Jason Gunthorpe Cc: Arnd Bergmann , Hulk Robot , YueHaibing , Shaobo Xu , Shamir Rabinovitch , Xi Wang , Tao Tian , Masahiro Yamada , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] RDMA/hns: Fix build error again Date: Mon, 7 Oct 2019 23:18:08 +0200 Message-Id: <20191007211826.3361202-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:EWiNtZuGapRE+xX1PdtaFNnMOeHZZ8DNLe6GyszUnhUPAIMsWRd +7JZjySSe+lzQIBYcSqcZYMF0teNr+S0b0Bgw0gu8IBq7zI59qfH6MgaBuuxq3frVb9o+Ud OhevsJQQSGs6rJWEgNS+GrJcGjNLj+w5RuUAI0zjTduNkbJac6a7x5qZTOSDQtCUNF0SktU 8rHgKAQ7GcQWdyE6Mdlvg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:LG5/IVF1Aus=:dEwU4fUmO4LXKB528E/eiF azbIpFIGe8I8qZqUKzVBpHVDKlsT6ZGX1TDE955icdCig9ES/mRViuK7BRrwe4qWCIrvVekvE juFv3PJ/xY8Qy9YccE+2Yn4P7ZWnG0Dy6DU6+FFPxQBkenEU0T4a7E7rk/02knOMuT2uVFqu+ sRiJTLmZJESoI/4ngWv9fgd0zo5cxjfEKJIBjj19n69cjYge3Bpdsw85K00bG6+HATlZaQ3tf W3Wljb9cZN4fjN6o8lnGMESAvSs0LsP28hlEIZwSGFhHquVn+K0hpcO9BlL6f4mDmo58hRgcE rfaNNrQ3lbGSgX0YqZtwmS2r2otOjZa2emKDTCAXuNnXFVVSvHXDYuXnSNf5MHPRNxkVN/J17 SZYsKZjADPBVVO+r4QzrbJjDkpLzgexVT7FPbnGx0c9Ud8SsYVehRRySvOBBFgHwPFTV4YoDW QDd6K9eETIiple3I0bNuHKg7OLaEphVClc9HuwY6/QeMMIwnrU9SH15miNJJNxQIGpFos/nRj 7BzUvZVLjrYHz3PfOzfXb1vVIKA9Jz9gFIAXXWC5FavFgv+JQmGVnqXzQb2CEJI4XrBPXmLov neoEmIxyG+hUzRBnviXQNJOdHVA2A8jrExddQ816tC9D4O8q3jUzdpGceZyv25CnNCeCFEnRG EUZS59Nzi9+DsFFGWNEdbN+bGVeqjLJAGek/tsUw/X2E6/yQEywbcRO3zv3TrmQ1XiUy69gXH jxlOJEI4mNIpmzOteoztMa5zgRQeJdZsHtKyuwbEjT675mZsZL48djD2BpJM0v2UfBL8YqNKZ GwEyfmaEpL7wy89De/LFHEc2Iz7Q7SvgmgDhhCN45BfuWN7sFKcnFOp5fHli8MZYwWsgcBXvR 81Mty/DSXVJgZk3RhOEQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is not the first attempt to fix building random configurations, unfortunately the attempt in commit a07fc0bb483e ("RDMA/hns: Fix build error") caused a new problem when CONFIG_INFINIBAND_HNS_HIP06=m and CONFIG_INFINIBAND_HNS_HIP08=y: drivers/infiniband/hw/hns/hns_roce_main.o:(.rodata+0xe60): undefined reference to `__this_module' Revert commits a07fc0bb483e ("RDMA/hns: Fix build error") and a3e2d4c7e766 ("RDMA/hns: remove obsolete Kconfig comment") to get back to the previous state, then fix the issues described there differently, by adding more specific dependencies: INFINIBAND_HNS can now only be built-in if at least one of HNS or HNS3 are built-in, and the individual back-ends are only available if that code is reachable from the main driver. Fixes: a07fc0bb483e ("RDMA/hns: Fix build error") Fixes: a3e2d4c7e766 ("RDMA/hns: remove obsolete Kconfig comment") Fixes: dd74282df573 ("RDMA/hns: Initialize the PCI device for hip08 RoCE") Fixes: 08805fdbeb2d ("RDMA/hns: Split hw v1 driver from hns roce driver") Signed-off-by: Arnd Bergmann --- drivers/infiniband/hw/hns/Kconfig | 17 ++++++++++++++--- drivers/infiniband/hw/hns/Makefile | 8 ++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) -- 2.20.0 diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig index d602b698b57e..4921c1e40ccd 100644 --- a/drivers/infiniband/hw/hns/Kconfig +++ b/drivers/infiniband/hw/hns/Kconfig @@ -1,23 +1,34 @@ # SPDX-License-Identifier: GPL-2.0-only config INFINIBAND_HNS - bool "HNS RoCE Driver" + tristate "HNS RoCE Driver" depends on NET_VENDOR_HISILICON depends on ARM64 || (COMPILE_TEST && 64BIT) + depends on (HNS_DSAF && HNS_ENET) || HNS3 ---help--- This is a RoCE/RDMA driver for the Hisilicon RoCE engine. The engine is used in Hisilicon Hip06 and more further ICT SoC based on platform device. + To compile HIP06 or HIP08 driver as module, choose M here. + config INFINIBAND_HNS_HIP06 - tristate "Hisilicon Hip06 Family RoCE support" + bool "Hisilicon Hip06 Family RoCE support" depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET + depends on INFINIBAND_HNS=m || (HNS_DSAF=y && HNS_ENET=y) ---help--- RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and Hip07 SoC. These RoCE engines are platform devices. + To compile this driver, choose Y here: if INFINIBAND_HNS is m, this + module will be called hns-roce-hw-v1 + config INFINIBAND_HNS_HIP08 - tristate "Hisilicon Hip08 Family RoCE support" + bool "Hisilicon Hip08 Family RoCE support" depends on INFINIBAND_HNS && PCI && HNS3 + depends on INFINIBAND_HNS=m || HNS3=y ---help--- RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC. The RoCE engine is a PCI device. + + To compile this driver, choose Y here: if INFINIBAND_HNS is m, this + module will be called hns-roce-hw-v2. diff --git a/drivers/infiniband/hw/hns/Makefile b/drivers/infiniband/hw/hns/Makefile index 449a2d81319d..e105945b94a1 100644 --- a/drivers/infiniband/hw/hns/Makefile +++ b/drivers/infiniband/hw/hns/Makefile @@ -9,8 +9,12 @@ hns-roce-objs := hns_roce_main.o hns_roce_cmd.o hns_roce_pd.o \ hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \ hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o +ifdef CONFIG_INFINIBAND_HNS_HIP06 hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs) -obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o +obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o +endif +ifdef CONFIG_INFINIBAND_HNS_HIP08 hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs) -obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o +obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o +endif