Linux-RDMA Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] RDMA/hns: Fix build error again
@ 2019-10-07 21:18 Arnd Bergmann
  2019-10-21 21:08 ` Doug Ledford
  2019-10-29 19:17 ` Jason Gunthorpe
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2019-10-07 21:18 UTC (permalink / raw)
  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, linux-kernel

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 <arnd@arndb.de>
---
 drivers/infiniband/hw/hns/Kconfig  | 17 ++++++++++++++---
 drivers/infiniband/hw/hns/Makefile |  8 ++++++--
 2 files changed, 20 insertions(+), 5 deletions(-)

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
-- 
2.20.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] RDMA/hns: Fix build error again
  2019-10-07 21:18 [PATCH] RDMA/hns: Fix build error again Arnd Bergmann
@ 2019-10-21 21:08 ` Doug Ledford
  2019-10-21 21:51   ` Arnd Bergmann
  2019-10-29 19:17 ` Jason Gunthorpe
  1 sibling, 1 reply; 5+ messages in thread
From: Doug Ledford @ 2019-10-21 21:08 UTC (permalink / raw)
  To: Arnd Bergmann, Lijun Ou, Wei Hu(Xavier), Jason Gunthorpe
  Cc: Hulk Robot, YueHaibing, Shaobo Xu, Shamir Rabinovitch, Xi Wang,
	Tao Tian, Masahiro Yamada, linux-rdma, linux-kernel


[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

On Mon, 2019-10-07 at 23:18 +0200, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>

This fix looks reasonable, but since I can't test this at all, and I'm
personally tired of trying and failing to fix this issue, I need to ask
if you've tried all the permutations for this just to confirm it works
in all valid cases?

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] RDMA/hns: Fix build error again
  2019-10-21 21:08 ` Doug Ledford
@ 2019-10-21 21:51   ` Arnd Bergmann
  2019-10-22 17:50     ` Doug Ledford
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2019-10-21 21:51 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Lijun Ou, Wei Hu(Xavier),
	Jason Gunthorpe, Hulk Robot, YueHaibing, Shaobo Xu,
	Shamir Rabinovitch, Xi Wang, Tao Tian, Masahiro Yamada,
	linux-rdma, linux-kernel

On Mon, Oct 21, 2019 at 11:09 PM Doug Ledford <dledford@redhat.com> wrote:
>
> This fix looks reasonable, but since I can't test this at all, and I'm
> personally tired of trying and failing to fix this issue, I need to ask
> if you've tried all the permutations for this just to confirm it works
> in all valid cases?

I'm fairly sure I would have found them all by now: Since I sent this
patch I built 4680 randconfig kernels, 293 of which had some HNS
driver enabled.

I also like to think that I spent more time to think it through in theory.

      Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] RDMA/hns: Fix build error again
  2019-10-21 21:51   ` Arnd Bergmann
@ 2019-10-22 17:50     ` Doug Ledford
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2019-10-22 17:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lijun Ou, Wei Hu(Xavier),
	Jason Gunthorpe, Hulk Robot, YueHaibing, Shaobo Xu,
	Shamir Rabinovitch, Xi Wang, Tao Tian, Masahiro Yamada,
	linux-rdma, linux-kernel


[-- Attachment #1: Type: text/plain, Size: 963 bytes --]

On Mon, 2019-10-21 at 23:51 +0200, Arnd Bergmann wrote:
> On Mon, Oct 21, 2019 at 11:09 PM Doug Ledford <dledford@redhat.com>
> wrote:
> > This fix looks reasonable, but since I can't test this at all, and
> > I'm
> > personally tired of trying and failing to fix this issue, I need to
> > ask
> > if you've tried all the permutations for this just to confirm it
> > works
> > in all valid cases?
> 
> I'm fairly sure I would have found them all by now: Since I sent this
> patch I built 4680 randconfig kernels, 293 of which had some HNS
> driver enabled.
> 
> I also like to think that I spent more time to think it through in
> theory.

I reviewed it pretty closely, and I couldn't find any way in which I
thought it would fail, I'm just being picky because I want this to be
the last fix ;-)

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] RDMA/hns: Fix build error again
  2019-10-07 21:18 [PATCH] RDMA/hns: Fix build error again Arnd Bergmann
  2019-10-21 21:08 ` Doug Ledford
@ 2019-10-29 19:17 ` Jason Gunthorpe
  1 sibling, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2019-10-29 19:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lijun Ou, Wei Hu(Xavier),
	Doug Ledford, Hulk Robot, YueHaibing, Shaobo Xu,
	Shamir Rabinovitch, Xi Wang, Tao Tian, Masahiro Yamada,
	linux-rdma, linux-kernel

On Mon, Oct 07, 2019 at 11:18:08PM +0200, Arnd Bergmann wrote:
> 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 <arnd@arndb.de>
> ---
>  drivers/infiniband/hw/hns/Kconfig  | 17 ++++++++++++++---
>  drivers/infiniband/hw/hns/Makefile |  8 ++++++--
>  2 files changed, 20 insertions(+), 5 deletions(-)

Applied to for-next, let us give it some time in linux-next I guess?

Thanks,
Jason

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 21:18 [PATCH] RDMA/hns: Fix build error again Arnd Bergmann
2019-10-21 21:08 ` Doug Ledford
2019-10-21 21:51   ` Arnd Bergmann
2019-10-22 17:50     ` Doug Ledford
2019-10-29 19:17 ` Jason Gunthorpe

Linux-RDMA Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rdma/0 linux-rdma/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rdma linux-rdma/ https://lore.kernel.org/linux-rdma \
		linux-rdma@vger.kernel.org
	public-inbox-index linux-rdma

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rdma


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git