Skip to contentSkip to conversation

target: fix tcm_loop build errors when SCSI=m

PATCH In review Randy Dunlap 2 participants 5 messages Aug 6, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 target: fix tcm_loop build errors when SCSI=m

From: Randy Dunlap <[email protected]>

Fix build errors when CONFIG_SCSI=m and CONFIG_LOOPBACK_TARGET=y by making LOOPBACK_TARGET depend on SCSI.

drivers/target/loopback/tcm_loop.o: In function `tcm_loop_port_link':
tcm_loop.c:(.text+0x445): undefined reference to scsi_add_device' drivers/target/loopback/tcm_loop.o: In function tcm_loop_driver_remove':
tcm_loop.c:(.text+0x55c): undefined reference to scsi_remove_host' tcm_loop.c:(.text+0x564): undefined reference to scsi_host_put' drivers/target/loopback/tcm_loop.o: In function `tcm_loop_submission_work':
tcm_loop.c:(.text+0x7c4): undefined reference to scmd_printk' drivers/target/loopback/tcm_loop.o: In function tcm_loop_driver_probe':
tcm_loop.c:(.text+0x7fb): undefined reference to scsi_host_alloc' tcm_loop.c:(.text+0x85b): undefined reference to scsi_add_host_with_dma' tcm_loop.c:(.text+0x896): undefined reference to scsi_host_put' drivers/target/loopback/tcm_loop.o: In function tcm_loop_port_unlink':
tcm_loop.c:(.text+0x962): undefined reference to scsi_device_lookup' tcm_loop.c:(.text+0x972): undefined reference to scsi_remove_device' tcm_loop.c:(.text+0x97a): undefined reference to scsi_device_put' drivers/target/loopback/tcm_loop.o:(.data+0x210): undefined reference to scsi_change_queue_depth'

Fixes 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD

fabric module")

Cc "Nicholas A. Bellinger" <[email protected]>
Cc Bart Van Assche <[email protected]>
Cc [email protected] # 2.6.39++

---
v2: add Fixes: and Cc:stable

 drivers/target/loopback/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/target/loopback/Kconfig +1 -0
@@ -1,5 +1,6 @@
 config LOOPBACK_TARGET
 	tristate "TCM Virtual SAS target and Linux/SCSI LDD fabric loopback module"
+	depends on SCSI
 	help
 	  Say Y here to enable the TCM Virtual SAS target and Linux/SCSI LLD
 	  fabric loopback module.
#1 lore raw

On Mon, 2018-08-06 at 16:20 -0700, Randy Dunlap wrote:
+AD4- Fixes: 3703b2c5d041 (+ACIAWw-SCSI+AF0- tcm+AF8-loop: Add multi-fabric Linux/SCSI LLD
+AD4- fabric module+ACI-)

From drivers/target/Kconfig on Linus' master branch:

menuconfig TARGET+AF8-CORE
tristate +ACI-Generic Target Core Mod (TCM) and ConfigFS Infrastructure+ACI- depends on SCSI +ACYAJg- BLOCK

if TARGET+AF8-CORE
+AFs- ... +AF0-
source +ACI-drivers/target/loopback/Kconfig+ACI-
endif

In other words, the loopback driver already depends on SCSI. So I doubt that this is a longstanding issue. Did you encounter this with Linus' master branch or rather with linux-next?

Thanks,

Bart.

#2 lore raw
In reply to Randy Dunlap
Quoted 10 lines · Bart Van Assche
Quoted 2 lines · Randy Dunlap
Fixes 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD

fabric module")

From drivers/target/Kconfig on Linus' master branch:

menuconfig TARGET_CORE

	tristate "Generic Target Core Mod (TCM) and ConfigFS Infrastructure"
	depends on SCSI && BLOCK
Quoted 8 lines

if TARGET_CORE
[ ... ]
source "drivers/target/loopback/Kconfig"
endif

In other words, the loopback driver already depends on SCSI. So I doubt that this is a longstanding issue. Did you encounter this with Linus' master branch or rather with linux-next?

Darn. Thanks for the info.

I encountered it in linux-next. I'll dig deeper.

Signature · 1 line
~Randy
#3 lore raw
In reply to Randy Dunlap

On Mon, 2018-08-06 at 16:29 -0700, Randy Dunlap wrote:
+AD4- On 08/06/2018 04:26 PM, Bart Van Assche wrote:
+AD4- +AD4- On Mon, 2018-08-06 at 16:20 -0700, Randy Dunlap wrote:
+AD4- +AD4- +AD4- Fixes: 3703b2c5d041 (+ACIAWw-SCSI+AF0- tcm+AF8-loop: Add multi-fabric Linux/SCSI LLD
+AD4- +AD4- +AD4- fabric module+ACI-)
+AD4- +AD4-
+AD4- +AD4- From drivers/target/Kconfig on Linus' master branch:
+AD4- +AD4-
+AD4- +AD4- menuconfig TARGET+AF8-CORE
+AD4- +AD4- tristate +ACI-Generic Target Core Mod (TCM) and ConfigFS Infrastructure+ACI-
+AD4- +AD4- depends on SCSI +ACYAJg- BLOCK
+AD4- +AD4-
+AD4- +AD4- if TARGET+AF8-CORE
+AD4- +AD4- +AFs- ... +AF0-
+AD4- +AD4- source +ACI-drivers/target/loopback/Kconfig+ACI-
+AD4- +AD4- endif
+AD4- +AD4-
+AD4- +AD4- In other words, the loopback driver already depends on SCSI. So I doubt that +AD4- +AD4- this is a longstanding issue. Did you encounter this with Linus' master branch +AD4- +AD4- or rather with linux-next?
+AD4-
+AD4- Darn. Thanks for the info.
+AD4-
+AD4- I encountered it in linux-next. I'll dig deeper.

This patch series may be what you are looking for: +ACIAWw-PATCH v2 0/9+AF0- block:
Consolidate scsi sense buffer usage+ACI- (https://lkml.org/lkml/2018/7/31/829).

Bart.

#4 lore raw
In reply to Randy Dunlap
Quoted 16 lines · Randy Dunlap
Quoted 15 lines · Bart Van Assche
Quoted 2 lines · Randy Dunlap
Fixes 3703b2c5d041 ("[SCSI] tcm_loop: Add multi-fabric Linux/SCSI LLD

fabric module")

From drivers/target/Kconfig on Linus' master branch:

menuconfig TARGET_CORE

	tristate "Generic Target Core Mod (TCM) and ConfigFS Infrastructure"
	depends on SCSI && BLOCK

if TARGET_CORE
[ ... ]
source "drivers/target/loopback/Kconfig"
endif

Quoted 7 lines
Quoted 3 lines

In other words, the loopback driver already depends on SCSI. So I doubt that this is a longstanding issue. Did you encounter this with Linus' master branch or rather with linux-next?

Darn. Thanks for the info.

I encountered it in linux-next. I'll dig deeper.

For TARGET_CORE, the depends on SCSI has been removed in linux-next. That allows the kconfig to go sideways.

Signature · 1 line
~Randy