Bug 195629

Summary: 4.11.0 stable kernel couldn't pass build
Product: Drivers Reporter: Icenowy Zheng (icenowy)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: high CC: richard
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 4.11.0 Subsystem:
Regression: No Bisected commit-id:
Attachments: the .config file I used
CONFIG_SCSI_LPFC patch to drivers/scsi/Kconfig

Description Icenowy Zheng 2017-05-02 04:13:27 UTC
Created attachment 256161 [details]
the .config file I used

When building the newest Linux 4.11.0 kernel, it failed with the following errors when "MODPOST vmlinux.o":
```
drivers/built-in.o:core.c:function lpfc_nvme_create_localport: error: undefined reference to 'nvme_fc_register_localport'
drivers/built-in.o:core.c:function lpfc_nvme_destroy_localport: error: undefined reference to 'nvme_fc_unregister_remoteport'
drivers/built-in.o:core.c:function lpfc_nvme_destroy_localport: error: undefined reference to 'nvme_fc_unregister_localport'
drivers/built-in.o:core.c:function lpfc_nvme_register_port: error: undefined reference to 'nvme_fc_register_remoteport'
drivers/built-in.o:core.c:function lpfc_nvme_unregister_port: error: undefined reference to 'nvme_fc_unregister_remoteport'
drivers/built-in.o:core.c:function lpfc_nvmet_create_targetport: error: undefined reference to 'nvmet_fc_register_targetport'
drivers/built-in.o:core.c:function lpfc_nvmet_destroy_targetport: error: undefined reference to 'nvmet_fc_unregister_targetport'
drivers/built-in.o:core.c:function lpfc_nvmet_unsol_ls_event: error: undefined reference to 'nvmet_fc_rcv_ls_req'
drivers/built-in.o:core.c:function lpfc_nvmet_unsol_fcp_event: error: undefined reference to 'nvmet_fc_rcv_fcp_req'
```
Comment 1 Richard Narron 2017-05-05 23:29:35 UTC
I ran into this today when I set 

  CONFIG_SCSI_LPFC=y
  ...
  CONFIG_NVME_FC=m
  ...
  CONFIG_NVME_TARGET_FC=m

One workaround is to set

  CONFIG_SCSI_LPFC=n

And another workaround is to set

  CONFIG_SCSI_LPFC=y
  ...
  CONFIG_NVME_FC=y
  ...
  CONFIG_NVME_TARGET_FC=y

While searching for a solution I found this:

  https://lkml.org/lkml/2017/3/21/308

I'm not sure that the suggested patch is the best fix, but something needs to be changed...
Comment 2 Richard Narron 2017-05-06 09:38:45 UTC
Created attachment 256235 [details]
CONFIG_SCSI_LPFC patch to drivers/scsi/Kconfig

Attached is another possible patch which makes it clear what is required to make CONFIG_SCSI_LPFC work and does not turn anything off.