Skip to contentSkip to conversation

usb: Correct dependencies around USB_EMUL

PATCH Superseded Tom Rini 2 participants 6 messages Mar 20 – Mar 23 USB

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 usb: Correct dependencies around USB_EMUL

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.

---
Cc: Marek Vasut <[email protected]>

---
 drivers/usb/emul/Kconfig  | 2 ++
 drivers/usb/host/Makefile | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/usb/emul/Kconfig +2 -0
index 279f6c6d7404..8ba372453e37 100644
@@ -1,7 +1,9 @@
 config USB_EMUL
 	bool "Support for USB device emulation"
 	depends on SANDBOX
+	select BLK
 	select DM_USB
+	select SCSI
 	select USB_HOST
 	help
 	  Since sandbox does not have access to a real USB bus, it is possible
drivers/usb/host/Makefile +1 -1
index ef4ce62a680c..9cac53f07c7a 100644
@@ -5,7 +5,7 @@
 
 ifdef CONFIG_$(PHASE_)DM_USB
 obj-y += usb-uclass.o
-obj-$(CONFIG_SANDBOX) += usb-sandbox.o
+obj-$(CONFIG_USB_EMUL) += usb-sandbox.o
 endif
 
 ifdef CONFIG_$(PHASE_)USB_STORAGE
Signature · 1 line
2.43.0
#1 lore raw
Quoted 20 lines · Tom Rini

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.

---
Cc: Marek Vasut <[email protected]>

---
  drivers/usb/emul/Kconfig  | 2 ++
  drivers/usb/host/Makefile | 2 +-
  2 files changed, 3 insertions(+), 1 deletion(-)
drivers/usb/emul/Kconfig +0 -0
index 279f6c6d7404..8ba372453e37 100644

drivers/usb/emul/Kconfig line 4

Quoted 4 lines
drivers/usb/emul/Kconfig +1 -0
@@ -1,7 +1,9 @@
  config USB_EMUL
  	bool "Support for USB device emulation"
  	depends on SANDBOX
+	select BLK

The select SCSI and Makefile change I do understand. But why do we also need BLK ? I can't find anything which would interact with BLK in the sandbox USB emulation ?

Quoted 18 lines
drivers/usb/emul/Kconfig +1 -0
  	select DM_USB
+	select SCSI
  	select USB_HOST
  	help
  	  Since sandbox does not have access to a real USB bus, it is possible
drivers/usb/host/Makefile +1 -1
index ef4ce62a680c..9cac53f07c7a 100644
@@ -5,7 +5,7 @@
 
  ifdef CONFIG_$(PHASE_)DM_USB
  obj-y += usb-uclass.o
-obj-$(CONFIG_SANDBOX) += usb-sandbox.o
+obj-$(CONFIG_USB_EMUL) += usb-sandbox.o
  endif
 
  ifdef CONFIG_$(PHASE_)USB_STORAGE
author
#2 lore raw
Quoted 16 lines · Marek Vasut
Quoted 15 lines · Tom Rini

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.

---
Cc: Marek Vasut <[email protected]>

---
  drivers/usb/emul/Kconfig  | 2 ++
  drivers/usb/host/Makefile | 2 +-
  2 files changed, 3 insertions(+), 1 deletion(-)
Quoted 13 lines

drivers/usb/emul/Kconfig line 4

Quoted 9 lines
drivers/usb/emul/Kconfig +1 -0
index 279f6c6d7404..8ba372453e37 100644
@@ -1,7 +1,9 @@
  config USB_EMUL
  	bool "Support for USB device emulation"
  	depends on SANDBOX
+	select BLK

The select SCSI and Makefile change I do understand. But why do we also need BLK ? I can't find anything which would interact with BLK in the sandbox USB emulation ?

Ah woops, I was fixing too many problems at once then and forgot BLK is select'd by SCSI now, not depends on, so indeed, it's not required here.

Signature · 1 line
Tom
#3 lore raw
Quoted 31 lines · Tom Rini
Quoted 16 lines · Marek Vasut
Quoted 15 lines · Tom Rini

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.

---
Cc: Marek Vasut <[email protected]>

---
   drivers/usb/emul/Kconfig  | 2 ++
   drivers/usb/host/Makefile | 2 +-
   2 files changed, 3 insertions(+), 1 deletion(-)
Quoted 13 lines

drivers/usb/emul/Kconfig line 4

Quoted 9 lines
drivers/usb/emul/Kconfig +1 -0
index 279f6c6d7404..8ba372453e37 100644
@@ -1,7 +1,9 @@
   config USB_EMUL
   	bool "Support for USB device emulation"
   	depends on SANDBOX
+	select BLK

The select SCSI and Makefile change I do understand. But why do we also need BLK ? I can't find anything which would interact with BLK in the sandbox USB emulation ?

Quoted 2 lines

Ah woops, I was fixing too many problems at once then and forgot BLK is select'd by SCSI now, not depends on, so indeed, it's not required here.

Excellent, then please do a V2 and then all is fine. Thanks !

author
#4 lore raw

PATCH v2 1/1 usb: Correct dependencies around USB_EMUL

In reply to Marek Vasut

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.

---
Changes in v2:
- Drop erroneous select BLK line, pointed out by Marek

Cc Marek Vasut <[email protected]>
---
 drivers/usb/emul/Kconfig  | 1 +
 drivers/usb/host/Makefile | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/usb/emul/Kconfig +1 -0
index 279f6c6d7404..6305f2496c3b 100644
@@ -2,6 +2,7 @@ config USB_EMUL
 	bool "Support for USB device emulation"
 	depends on SANDBOX
 	select DM_USB
+	select SCSI
 	select USB_HOST
 	help
 	  Since sandbox does not have access to a real USB bus, it is possible
drivers/usb/host/Makefile +1 -1
index ef4ce62a680c..9cac53f07c7a 100644
@@ -5,7 +5,7 @@
 
 ifdef CONFIG_$(PHASE_)DM_USB
 obj-y += usb-uclass.o
-obj-$(CONFIG_SANDBOX) += usb-sandbox.o
+obj-$(CONFIG_USB_EMUL) += usb-sandbox.o
 endif
 
 ifdef CONFIG_$(PHASE_)USB_STORAGE
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#5 lore raw
Quoted 8 lines · Tom Rini

The symbol USB_EMUL is how sandbox has access to USB. It's implementation however enforces a few other requirements. It must have SCSI enabled, and in turn that means it must have BLK enabled. Finally, we should not be using SANDBOX itself as a symbol to decide what to build or not build here, as SANDBOX is selected for COMPILE_TEST builds as well and so may not have enabled the sandbox specific USB support.