Skip to contentSkip to conversation

usb: Do not compile USB_STORAGE with !BLK && !DM_USB

PATCH New Alexander Graf 2 participants 5 messages Oct 19, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: Do not compile USB_STORAGE with !BLK && !DM_USB

The USB storage driver does not compile when CONFIG_BLK is set, but DM_USB is not set, as we're missing the DM device links for CONFIG_BLK enabled code paths.

So far it looks like nobody fell into this trap, because no board enabled CONFIG_BLK and CONFIG_USB_STORAGE while not enabling CONFIG_DM_USB, but we should still reflect that dependency properly in Kconfig so that implicit enabling of CONFIG_USB_STORAGE works.

---
 drivers/usb/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/Kconfig +1 -0
index 4fbe172e05..297dda1511 100644
@@ -65,6 +65,7 @@ comment "USB peripherals"
 
 config USB_STORAGE
 	bool "USB Mass Storage support"
+	depends on DM_USB || !BLK
 	---help---
 	  Say Y here if you want to connect USB mass storage devices to your
 	  board's USB port.
Signature · 1 line
2.12.3
#1 lore raw

PATCH 1/1 usb: Do not compile USB_STORAGE with !BLK && !DM_USB

Quoted 10 lines · Alexander Graf

The USB storage driver does not compile when CONFIG_BLK is set, but DM_USB is not set, as we're missing the DM device links for CONFIG_BLK enabled code paths.

So far it looks like nobody fell into this trap, because no board enabled CONFIG_BLK and CONFIG_USB_STORAGE while not enabling CONFIG_DM_USB, but we should still reflect that dependency properly in Kconfig so that implicit enabling of CONFIG_USB_STORAGE works.

Can we fix it such that it'd compile ? :)

Quoted 17 lines
---
 drivers/usb/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/Kconfig +1 -0
index 4fbe172e05..297dda1511 100644
@@ -65,6 +65,7 @@ comment "USB peripherals"
 
 config USB_STORAGE
 	bool "USB Mass Storage support"
+	depends on DM_USB || !BLK
 	---help---
 	  Say Y here if you want to connect USB mass storage devices to your
 	  board's USB port.
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 usb: Do not compile USB_STORAGE with !BLK && !DM_USB

Quoted 5 lines · Marek Vasut
Quoted 4 lines · Alexander Graf

The USB storage driver does not compile when CONFIG_BLK is set, but DM_USB is not set, as we're missing the DM device links for CONFIG_BLK enabled code paths.

Quoted 8 lines
Quoted 6 lines

So far it looks like nobody fell into this trap, because no board enabled CONFIG_BLK and CONFIG_USB_STORAGE while not enabling CONFIG_DM_USB, but we should still reflect that dependency properly in Kconfig so that implicit enabling of CONFIG_USB_STORAGE works.

Can we fix it such that it'd compile ? :)

I'm not sure. It feels awkward to allow code to use DM enabled block functions, but not DM enabled USB functionality. I can definitely see why the code tripped over :).

Wasn't Simon planning to rip out non-DM enabled devices soon'ish anyways?

Alex

#3 lore raw

PATCH 1/1 usb: Do not compile USB_STORAGE with !BLK && !DM_USB

Quoted 15 lines · Alexander Graf
Quoted 12 lines · Marek Vasut
Quoted 10 lines · Alexander Graf

The USB storage driver does not compile when CONFIG_BLK is set, but DM_USB is not set, as we're missing the DM device links for CONFIG_BLK enabled code paths.

So far it looks like nobody fell into this trap, because no board enabled CONFIG_BLK and CONFIG_USB_STORAGE while not enabling CONFIG_DM_USB, but we should still reflect that dependency properly in Kconfig so that implicit enabling of CONFIG_USB_STORAGE works.

Quoted 7 lines
Quoted 1 line

Can we fix it such that it'd compile ? :)

I'm not sure. It feels awkward to allow code to use DM enabled block functions, but not DM enabled USB functionality. I can definitely see why the code tripped over :).

Wasn't Simon planning to rip out non-DM enabled devices soon'ish anyways?

I dunno. Which devices have this problem ?

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 1/1 usb: Do not compile USB_STORAGE with !BLK && !DM_USB

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Alexander Graf
Quoted 13 lines · Marek Vasut
Quoted 10 lines · Alexander Graf

The USB storage driver does not compile when CONFIG_BLK is set, but DM_USB is not set, as we're missing the DM device links for CONFIG_BLK enabled code paths.

So far it looks like nobody fell into this trap, because no board enabled CONFIG_BLK and CONFIG_USB_STORAGE while not enabling CONFIG_DM_USB, but we should still reflect that dependency properly in Kconfig so that implicit enabling of CONFIG_USB_STORAGE works.

Can we fix it such that it'd compile ? :)

Quoted 8 lines
Quoted 5 lines

I'm not sure. It feels awkward to allow code to use DM enabled block functions, but not DM enabled USB functionality. I can definitely see why the code tripped over :).

Wasn't Simon planning to rip out non-DM enabled devices soon'ish anyways?

I dunno. Which devices have this problem ?

The ones I've seen (enable DISTRO_DEFAULTS, enable USB, enable CONFIG_BLK, don't enable DM_USB and don't enable USB_STORAGE today) are mostly i.MX6 and OMAP/AM[3-5]xxx based.

Alex