Re: [PATCH] scsi: ibmvfc: Add Kconfig dependency to fix link failure when NVME_FC=m

From: Tyrel Datwyler

Date: Thu Sep 03 2026 - 12:57:16 EST


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@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/327877a29337aa526cc50ac88fbddb86@xxxxxxxxxxxxx/
> Signed-off-by: Venkat Rao Bagalkote <venkat88@xxxxxxxxxxxxx>
> ---
Acked-by: Tyrel Datwyler <tyreld@xxxxxxxxxxxxx>