Skip to content

Commit d5b60e2

Browse files
arndbjgunthorpe
authored andcommitted
RDMA/hns: Fix build error again
This is not the first attempt to fix building random configurations, unfortunately the attempt in commit a07fc0b ("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 a07fc0b ("RDMA/hns: Fix build error") and a3e2d4c ("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: a07fc0b ("RDMA/hns: Fix build error") Fixes: a3e2d4c ("RDMA/hns: remove obsolete Kconfig comment") Fixes: dd74282 ("RDMA/hns: Initialize the PCI device for hip08 RoCE") Fixes: 08805fd ("RDMA/hns: Split hw v1 driver from hns roce driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent bb3dba3 commit d5b60e2

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

drivers/infiniband/hw/hns/Kconfig

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config INFINIBAND_HNS
3-
bool "HNS RoCE Driver"
3+
tristate "HNS RoCE Driver"
44
depends on NET_VENDOR_HISILICON
55
depends on ARM64 || (COMPILE_TEST && 64BIT)
6+
depends on (HNS_DSAF && HNS_ENET) || HNS3
67
---help---
78
This is a RoCE/RDMA driver for the Hisilicon RoCE engine. The engine
89
is used in Hisilicon Hip06 and more further ICT SoC based on
910
platform device.
1011

12+
To compile HIP06 or HIP08 driver as module, choose M here.
13+
1114
config INFINIBAND_HNS_HIP06
12-
tristate "Hisilicon Hip06 Family RoCE support"
15+
bool "Hisilicon Hip06 Family RoCE support"
1316
depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET
17+
depends on INFINIBAND_HNS=m || (HNS_DSAF=y && HNS_ENET=y)
1418
---help---
1519
RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and
1620
Hip07 SoC. These RoCE engines are platform devices.
1721

22+
To compile this driver, choose Y here: if INFINIBAND_HNS is m, this
23+
module will be called hns-roce-hw-v1
24+
1825
config INFINIBAND_HNS_HIP08
19-
tristate "Hisilicon Hip08 Family RoCE support"
26+
bool "Hisilicon Hip08 Family RoCE support"
2027
depends on INFINIBAND_HNS && PCI && HNS3
28+
depends on INFINIBAND_HNS=m || HNS3=y
2129
---help---
2230
RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC.
2331
The RoCE engine is a PCI device.
32+
33+
To compile this driver, choose Y here: if INFINIBAND_HNS is m, this
34+
module will be called hns-roce-hw-v2.

drivers/infiniband/hw/hns/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ hns-roce-objs := hns_roce_main.o hns_roce_cmd.o hns_roce_pd.o \
99
hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \
1010
hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o
1111

12+
ifdef CONFIG_INFINIBAND_HNS_HIP06
1213
hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs)
13-
obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o
14+
obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o
15+
endif
1416

17+
ifdef CONFIG_INFINIBAND_HNS_HIP08
1518
hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs)
16-
obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o
19+
obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o
20+
endif

0 commit comments

Comments
 (0)