Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m
@ 2026-09-03  7:43 Venkat Rao Bagalkote
  2026-09-03 11:06 ` pavrampu
  2026-09-03 16:57 ` Tyrel Datwyler
  0 siblings, 2 replies; 3+ messages in thread
From: Venkat Rao Bagalkote @ 2026-09-03  7:43 UTC (permalink / raw)
  To: James.Bottomley, mkp, tyreld
  Cc: linux-scsi, linux-kernel, pavrampu, brking, davemarq,
	linuxppc-dev, Venkat Rao Bagalkote

Building with CONFIG_SCSI_IBMVFC=y and CONFIG_NVME_FC=m results in a
link failure:

  ibmvfc-nvme.o: undefined reference to `nvme_fc_register_localport'
  ibmvfc-nvme.o: undefined reference to `nvme_fc_register_remoteport'
  ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_localport'
  ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_remoteport'
  ibmvfc-core.o: undefined reference to `nvme_fc_rescan_remoteport'

IS_ENABLED() evaluates to 1 for both =y and =m, so the nvme_fc_*
call sites are kept in the object file. When SCSI_IBMVFC=y (built-in)
but NVME_FC=m (loadable module), the linker cannot resolve these
symbols at vmlinux link time.

Add the same "depends on NVME_FC || NVME_FC=n" constraint already
used by SCSI_LPFC to prevent this configuration.

Reported-by: Pavithra <pavrampu@linux.ibm.com>
Closes: https://lore.kernel.org/all/327877a29337aa526cc50ac88fbddb86@linux.ibm.com/
Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
---
 drivers/scsi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 4a2af0f702e1..1eec66195cf4 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -753,6 +753,7 @@ config SCSI_IBMVFC
 	tristate "IBM Virtual FC support"
 	depends on PPC_PSERIES && SCSI
 	depends on SCSI_FC_ATTRS
+	depends on NVME_FC || NVME_FC=n
 	help
 	  This is the IBM POWER Virtual FC Client
 
-- 
2.45.2


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

* Re: [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m
  2026-09-03  7:43 [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m Venkat Rao Bagalkote
@ 2026-09-03 11:06 ` pavrampu
  2026-09-03 16:57 ` Tyrel Datwyler
  1 sibling, 0 replies; 3+ messages in thread
From: pavrampu @ 2026-09-03 11:06 UTC (permalink / raw)
  To: Venkat Rao Bagalkote
  Cc: James.Bottomley, mkp, tyreld, linux-scsi, linux-kernel, brking,
	davemarq, linuxppc-dev

On 2026-09-03 13:13, Venkat Rao Bagalkote wrote:
> Building with CONFIG_SCSI_IBMVFC=y and CONFIG_NVME_FC=m results in a
> link failure:
> 
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_register_localport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_register_remoteport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_localport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_remoteport'
>   ibmvfc-core.o: undefined reference to `nvme_fc_rescan_remoteport'
> 
> IS_ENABLED() evaluates to 1 for both =y and =m, so the nvme_fc_*
> call sites are kept in the object file. When SCSI_IBMVFC=y (built-in)
> but NVME_FC=m (loadable module), the linker cannot resolve these
> symbols at vmlinux link time.
> 
> Add the same "depends on NVME_FC || NVME_FC=n" constraint already
> used by SCSI_LPFC to prevent this configuration.
> 
> Reported-by: Pavithra <pavrampu@linux.ibm.com>
> Closes:
> https://lore.kernel.org/all/327877a29337aa526cc50ac88fbddb86@linux.ibm.com/
> Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> ---

Hi Venkat,

Tested the patch, compilation issue is not observed with patch.

Logs:
-----
without patch:
:/home/linux-next # make -j 80
   UPD     include/generated/utsversion.h
   CC      init/version-timestamp.o
   KSYMS   .tmp_vmlinux0.kallsyms.S
   AS      .tmp_vmlinux0.kallsyms.o
   LD      .tmp_vmlinux1
/usr/bin/ld.bfd: warning: discarding dynamic section .glink
/usr/bin/ld.bfd: warning: discarding dynamic section .plt
/usr/bin/ld.bfd: linkage table error against 
`nvme_fc_unregister_remoteport'
/usr/bin/ld.bfd: stubs don't match calculated size
/usr/bin/ld.bfd: can not build stubs: bad value
/usr/bin/ld.bfd: drivers/scsi/ibmvscsi/ibmvfc-core.o: in function 
`ibmvfc_rport_add_thread':
ibmvfc-core.c:(.text+0x70dc): undefined reference to 
`nvme_fc_rescan_remoteport'
/usr/bin/ld.bfd: drivers/scsi/ibmvscsi/ibmvfc-nvme.o: in function 
`ibmvfc_nvme_register_remoteport':
ibmvfc-nvme.c:(.text+0x1420): undefined reference to 
`nvme_fc_register_remoteport'
/usr/bin/ld.bfd: drivers/scsi/ibmvscsi/ibmvfc-nvme.o: in function 
`ibmvfc_nvme_unregister_remoteport':
ibmvfc-nvme.c:(.text+0x153c): undefined reference to 
`nvme_fc_unregister_remoteport'
/usr/bin/ld.bfd: drivers/scsi/ibmvscsi/ibmvfc-nvme.o: in function 
`ibmvfc_nvme_register':
ibmvfc-nvme.c:(.text+0x164c): undefined reference to 
`nvme_fc_register_localport'
/usr/bin/ld.bfd: drivers/scsi/ibmvscsi/ibmvfc-nvme.o: in function 
`ibmvfc_nvme_unregister':
ibmvfc-nvme.c:(.text+0x1778): undefined reference to 
`nvme_fc_unregister_localport'
make[2]: *** [scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 1
make[1]: *** [/home/linux-next/Makefile:1390: vmlinux] Error 2
make: *** [Makefile:248: __sub-make] Error 2

with patch:

:/home/linux-next # patch -p1 < patch
patching file drivers/scsi/Kconfig
:/home/linux-next # make -j 80
   SYNC    include/config/auto.conf
   UPD     include/config/kernel.release
   UPD     include/generated/utsrelease.h
.
.
   COPY    arch/powerpc/boot/fdt_rw.c
   COPY    arch/powerpc/boot/fdt_sw.c
   COPY    arch/powerpc/boot/fdt_wip.c
   BOOTCC  arch/powerpc/boot/libfdt-wrapper.o
   BOOTCC  arch/powerpc/boot/inffast.o
   COPY    arch/powerpc/boot/decompress_inflate.c
   BOOTCC  arch/powerpc/boot/empty.o
   BOOTCC  arch/powerpc/boot/fdt.o
   BOOTCC  arch/powerpc/boot/fdt_ro.o
   BOOTCC  arch/powerpc/boot/fdt_rw.o
   BOOTCC  arch/powerpc/boot/fdt_strerror.o
   BOOTCC  arch/powerpc/boot/fdt_sw.o
   BOOTCC  arch/powerpc/boot/fdt_wip.o
   BOOTCC  arch/powerpc/boot/inflate.o
   BOOTCC  arch/powerpc/boot/inftrees.o
   BOOTCC  arch/powerpc/boot/decompress.o
   BOOTAR  arch/powerpc/boot/wrapper.a
   WRAP    arch/powerpc/boot/zImage.pseries
   WRAP    arch/powerpc/boot/zImage.epapr

Please add below tag:

Tested-by: Pavithra <pavrampu@linux.ibm.com>

Thanks,
Pavithra

>  drivers/scsi/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
> index 4a2af0f702e1..1eec66195cf4 100644
> --- a/drivers/scsi/Kconfig
> +++ b/drivers/scsi/Kconfig
> @@ -753,6 +753,7 @@ config SCSI_IBMVFC
>  	tristate "IBM Virtual FC support"
>  	depends on PPC_PSERIES && SCSI
>  	depends on SCSI_FC_ATTRS
> +	depends on NVME_FC || NVME_FC=n
>  	help
>  	  This is the IBM POWER Virtual FC Client


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

* Re: [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m
  2026-09-03  7:43 [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m Venkat Rao Bagalkote
  2026-09-03 11:06 ` pavrampu
@ 2026-09-03 16:57 ` Tyrel Datwyler
  1 sibling, 0 replies; 3+ messages in thread
From: Tyrel Datwyler @ 2026-09-03 16:57 UTC (permalink / raw)
  To: Venkat Rao Bagalkote, James.Bottomley, mkp
  Cc: linux-scsi, linux-kernel, pavrampu, brking, davemarq,
	linuxppc-dev

On 9/3/26 12:43 AM, Venkat Rao Bagalkote wrote:
> Building with CONFIG_SCSI_IBMVFC=y and CONFIG_NVME_FC=m results in a
> link failure:
> 
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_register_localport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_register_remoteport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_localport'
>   ibmvfc-nvme.o: undefined reference to `nvme_fc_unregister_remoteport'
>   ibmvfc-core.o: undefined reference to `nvme_fc_rescan_remoteport'
> 
> IS_ENABLED() evaluates to 1 for both =y and =m, so the nvme_fc_*
> call sites are kept in the object file. When SCSI_IBMVFC=y (built-in)
> but NVME_FC=m (loadable module), the linker cannot resolve these
> symbols at vmlinux link time.
> 
> Add the same "depends on NVME_FC || NVME_FC=n" constraint already
> used by SCSI_LPFC to prevent this configuration.
> 
> Reported-by: Pavithra <pavrampu@linux.ibm.com>
> Closes: https://lore.kernel.org/all/327877a29337aa526cc50ac88fbddb86@linux.ibm.com/
> Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> ---
Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>

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

end of thread, other threads:[~2026-09-03 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  7:43 [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m Venkat Rao Bagalkote
2026-09-03 11:06 ` pavrampu
2026-09-03 16:57 ` Tyrel Datwyler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox