Skip to contentSkip to conversation

RFC: [2.6 patch] let BLK_DEV_UB depend on EMBEDDED

PATCH Adrian Bunk 13 participants 30 messages Dec 20, 2004 – Jan 24, 2005

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

drivers/block/Kconfig renamed from drivers/block/Kconfig.old +1 -1
@@ -303,7 +303,7 @@
 
 config BLK_DEV_UB
 	tristate "Low Performance USB Block driver"
-	depends on USB
+	depends on USB && EMBEDDED
 	help
 	  This driver supports certain USB attached storage devices
 	  such as flash keys.
#1 lore raw
Quoted 2 lines · Adrian Bunk

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

It depends. I like it.

drivers/block/Kconfig line 306

Quoted 4 lines

config BLK_DEV_UB

drivers/block/Kconfig renamed from drivers/block/Kconfig.old +1 -1
 	tristate "Low Performance USB Block driver"
-	depends on USB
+	depends on USB && EMBEDDED

The ub has nothing to do with embedded systems, most of which do not run with CONFIG_EMBEDDED, BTW.

-- Pete

#2 lore raw
In reply to Adrian Bunk
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

You don't want to use the scsi layer? You like the stability of it at times? :)

Quoted 2 lines

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

No, it's good for non-embedded boxes too.

thanks,

greg k-h

#3 lore raw
Quoted 11 lines · Greg KH
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

You don't want to use the scsi layer? You like the stability of it at times? :)
...

What about a dependency of BLK_DEV_UB on USB_STORAGE=n ?

Quoted 3 lines

thanks,

greg k-h

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 1 line · Adrian Bunk

What about a dependency of BLK_DEV_UB on USB_STORAGE=n ?

I have them both as 'm' in my configuration, works like a charm.

-- Pete

#5 lore raw
Quoted 7 lines · Pete Zaitcev
Quoted 1 line · Adrian Bunk

What about a dependency of BLK_DEV_UB on USB_STORAGE=n ?

I have them both as 'm' in my configuration, works like a charm.

ub can work like that, but it makes it darned difficult to use usb-storage like that. ub wants to bind to the devices, not usb-storage, and if ub is unloaded, usb-storage doesn't bind to them. at least that's been my experience with it.

Signature · 1 line
~Randy
#6 lore raw
Quoted 7 lines · Randy.Dunlap
Quoted 6 lines · Pete Zaitcev
Quoted 1 line · Adrian Bunk

What about a dependency of BLK_DEV_UB on USB_STORAGE=n ?

Quoted 6 lines
Quoted 1 line

I have them both as 'm' in my configuration, works like a charm.

ub can work like that, but it makes it darned difficult to use usb-storage like that. ub wants to bind to the devices, not usb-storage, and if ub is unloaded, usb-storage doesn't bind to them. at least that's been my experience with it.

Enabling CONFIG_BLK_DEV_UB actually disables usb-storage from attaching to certain devices, regardless of what's loaded or not.

I, personally, don't like this. But I wasn't consulted on that particular feature. I'm given to understand that some bad things can happen when two drivers can bind to the same device, but I haven't had time to experiment with it.

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

Matt

Signature · 7 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

C:  They kicked your ass, didn't they?
S:  They were cheating!
					-- The Chief and Stef
User Friendly, 11/19/1997
#7 lore raw
Quoted 3 lines · Matthew Dharm

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

Is it that bad, really? Honestly, I could not imagine users can be so dumb. The option defaults to off. There is a warning in the Kconfig. And yet they first enable it and then complain about it. I don't know what to do about it, either.

-- Pete

#22 lore raw
In reply to Randy.Dunlap
Quoted 11 lines · Randy.Dunlap
Quoted 5 lines · Pete Zaitcev
Quoted 1 line · Adrian Bunk

What about a dependency of BLK_DEV_UB on USB_STORAGE=n ?

I have them both as 'm' in my configuration, works like a charm.

ub can work like that, but it makes it darned difficult to use usb-storage like that. ub wants to bind to the devices, not usb-storage, and if ub is unloaded, usb-storage doesn't bind to them. at least that's been my experience with it.

There is no asymmetry in lists of devices in either of them, however currently there aren't any devices which usb-storage cannot handle and ub can. Thus it makes sense to conditionalize part of usb-storage list on ub. Otherwise, it would be a separate configuration item, I suppose. We'll when we get there.

I don't quite understand why it matters for you if a certain module is loaded or not loaded. The hotplug acts upon the contents of modules.usbmap which does not change when you modprobe or rmmod things. So, the match lists are made non-conflicting between
ub and usb-storage. It looks as if Adrian has the same broken mental model of the way things work. Once again, what is loaded does not matter (not in ideal world, but in reality we still have conflicts such as e100 and eepro100).

-- Pete

#19 lore raw
In reply to Matthew Dharm
Quoted 3 lines · Matthew Dharm

Enabling CONFIG_BLK_DEV_UB actually disables usb-storage from attaching to certain devices, regardless of what's loaded or not.

It also seems to mean significantly slower access (at high speed) for the most standard devices. That doesn't seem like a win, though I suspect fixing it should be as simple as switching over to use the USB scatterlist calls (which usb-storage uses) ...

- Davve

Quoted 3 lines

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

#20 lore raw
Quoted 4 lines · David Brownell

It also seems to mean significantly slower access (at high speed) for the most standard devices. That doesn't seem like a win, though I suspect fixing it should be as simple as switching over to use the USB scatterlist calls (which usb-storage uses) ...

They do not allow asynchronous operation, last time I checked.

-- Pete

#8 lore raw
In reply to Pete Zaitcev
Quoted 8 lines · Pete Zaitcev
Quoted 3 lines · Matthew Dharm

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

Quoted 4 lines

Is it that bad, really? Honestly, I could not imagine users can be so dumb. The option defaults to off. There is a warning in the Kconfig. And yet they first enable it and then complain about it. I don't know what to do about it, either.

I was told this was enabled in the mandrake 2.6.9 kernel. I haven't confirmed that.

Yes, users are very stupid. Ever worked in tech support?

Signature · 7 lines
Phil Dibowitz                             [email protected]
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
 - Benjamin Franklin, 1759
#9 lore raw
In reply to Pete Zaitcev
Quoted 7 lines · Pete Zaitcev
Quoted 3 lines · Matthew Dharm

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

Is it that bad, really? Honestly, I could not imagine users can be so dumb.

'There are more things in Heaven and Earth, Horatio...."

Yes, users can be so dumb. Commonly, the exchange goes like this:

USER: My device used to work in 2.6.7, and now it's busted.
US: Please turn on debugging and send us the logs.
USER: (sends dmesg which shows ub in use)
US: Turn off CONFIG_BLK_DEV_UB
USER: It works! You should make it more clear that UB breaks things...

And that's the optimal case. Often times they cut the dmesg so we can't see what's wrong. And this usually takes 3 days for the entire exchange.

Quoted 3 lines

The option defaults to off. There is a warning in the Kconfig. And yet they first enable it and then complain about it. I don't know what to do about it, either.

The best idea I have is to hide CONFIG_BLK_DEV_UB behind CONFIG_EXPERIMENTAL.

The next-best idea I have is to make UB print out some sort of warning message at startup.

Neither of these ideas is very good, I'll admit.

Matt

Signature · 8 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

A:  The most ironic oxymoron wins ...
DP: "Microsoft Works"
A:  Uh, okay, you win.
					-- A.J. & Dust Puppy
User Friendly, 1/18/1998
#10 lore raw
Quoted 3 lines · Matthew Dharm

The best idea I have is to hide CONFIG_BLK_DEV_UB behind CONFIG_EXPERIMENTAL.

As a long-term solution, this obviously won't work, but I think it's a _very_ good solution for now. UB _is_ expiramental at this point. It still has it's issues, and per Pete is still not to be used unless you really know what you're doing.

That makes it expiramental to me.

Quoted 4 lines

The next-best idea I have is to make UB print out some sort of warning message at startup.

Neither of these ideas is very good, I'll admit.

This is decent idea. Some "Warning: UB enabled - your usb-storage devices may not work properly!" type thing on loading can't hurt.

Not the cleanest thing in the world, but look how well it worked for the unusual_devs cleanups.

Signature · 7 lines
Phil Dibowitz                             [email protected]
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
 - Benjamin Franklin, 1759
#11 lore raw
In reply to Matthew Dharm
Quoted 2 lines · Matthew Dharm

The best idea I have is to hide CONFIG_BLK_DEV_UB behind CONFIG_EXPERIMENTAL.

I thought about it, but I do not like CONFIG_EXPERIMENTAL as a concept. I seem to recall a few instances when it was practically required, because some necessary driver was covered by it, and so users ran it always-on. AFAIK, both Fedora and Red Hat Enterprise Linux 4 Beta have it enabled for that reason. We can try it, certainly, to see if it helps.

Quoted 2 lines

The next-best idea I have is to make UB print out some sort of warning message at startup.

This is probably a cure worse than the disease.

-- Pete

#12 lore raw
Quoted 7 lines · Pete Zaitcev
Quoted 2 lines · Matthew Dharm

The best idea I have is to hide CONFIG_BLK_DEV_UB behind CONFIG_EXPERIMENTAL.

Quoted 5 lines

I thought about it, but I do not like CONFIG_EXPERIMENTAL as a concept. I seem to recall a few instances when it was practically required, because some necessary driver was covered by it, and so users ran it always-on. AFAIK, both Fedora and Red Hat Enterprise Linux 4 Beta have it enabled for that reason. We can try it, certainly, to see if it helps.

Just because other people use it wrong doesn't mean we can't use it right...

Signature · 7 lines
Phil Dibowitz                             [email protected]
Freeware and Technical Pages              Insanity Palace of Metallica
http://www.phildev.net/                   http://www.ipom.com/

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
 - Benjamin Franklin, 1759
#13 lore raw
In reply to Pete Zaitcev
Quoted 10 lines · Pete Zaitcev
Quoted 3 lines · Matthew Dharm

I can tell you that this has turned into the single largest source of bug reports/complaints about usb-storage. Something has to be done. I just don't know what.

Is it that bad, really? Honestly, I could not imagine users can be so dumb. The option defaults to off. There is a warning in the Kconfig. And yet they first enable it and then complain about it. I don't know what to do about it, either.

Its not that they just enable it. Its that it has side effects. I enable it to support one device - it then 'devnaps' other devices that usbstorage supports _much_ better. Is there some way it could work in reverse. eg. let ub bind only if usbstorage does not, possibly making usbstorage a _little_ more conservative if ub is present?

Ed Tomlinson

maintainer
#14 lore raw
Quoted 5 lines · Ed Tomlinson

Its not that they just enable it. Its that it has side effects. I enable it to support one device - it then 'devnaps' other devices that usbstorage supports _much_ better. Is there some way it could work in reverse. eg. let ub bind only if usbstorage does not, possibly making usbstorage a _little_ more conservative if ub is present?

Unfortunately there isn't any way to define which driver should bind to a device, if they are both capable of controlling it. Maybe there should be. It might not be too hard to add a sysfs interface for that sort of thing.

Alan Stern

maintainer
#23 lore raw
In reply to Pete Zaitcev
Quoted 8 lines · Pete Zaitcev

I don't quite understand why it matters for you if a certain module is loaded or not loaded. The hotplug acts upon the contents of modules.usbmap which does not change when you modprobe or rmmod things. So, the match lists are made non-conflicting between
ub and usb-storage. It looks as if Adrian has the same broken mental model of the way things work. Once again, what is loaded does not matter (not in ideal world, but in reality we still have conflicts such as e100 and eepro100).

No one has posted a reply to this point, so here's one even if it is unnecessary.

What matters is not which modules are loaded, but rather which modules bind to which devices. If ub is configured then usb-storage will not bind to certain devices, regardless of what modules are loaded.

Problems start arising when devices that ub binds to and usb-storage doesn't (when ub is configured) fail to work with ub, or work much more slowly than they do with usb-storage. And since some distributions enable ub in their shipping configurations, users often don't realize what has happened -- they only know that things don't work as well as they used to.

Maybe a reasonable answer would be to ask distributors not to enable ub, and leave it up to individual users to configure it when they want to. That is the default setting in Kconfig, after all.

Alan Stern

#15 lore raw
In reply to Alan Stern
Quoted 8 lines · Alan Stern
Quoted 5 lines · Ed Tomlinson

Its not that they just enable it. Its that it has side effects. I enable it to support one device - it then 'devnaps' other devices that usbstorage supports _much_ better. Is there some way it could work in reverse. eg. let ub bind only if usbstorage does not, possibly making usbstorage a _little_ more conservative if ub is present?

Quoted 4 lines

Unfortunately there isn't any way to define which driver should bind to a device, if they are both capable of controlling it. Maybe there should be. It might not be too hard to add a sysfs interface for that sort of thing.

We are working on it...

thanks,

greg k-h

#21 lore raw
In reply to Pete Zaitcev
Quoted 8 lines · Pete Zaitcev
Quoted 4 lines · David Brownell

It also seems to mean significantly slower access (at high speed) for the most standard devices. That doesn't seem like a win, though I suspect fixing it should be as simple as switching over to use the USB scatterlist calls (which usb-storage uses) ...

They do not allow asynchronous operation, last time I checked.

You could add an async mode ... heck, even the hack of dedicating a kernel thread to that task ("psuedo-async" within "ub") would give much more reasonable throughput.

- Dave

#16 lore raw
In reply to Alan Stern
Quoted 8 lines · Alan Stern
Quoted 5 lines · Ed Tomlinson

Its not that they just enable it. Its that it has side effects. I enable it to support one device - it then 'devnaps' other devices that usbstorage supports _much_ better. Is there some way it could work in reverse. eg. let ub bind only if usbstorage does not, possibly making usbstorage a _little_ more conservative if ub is present?

Quoted 4 lines

Unfortunately there isn't any way to define which driver should bind to a device, if they are both capable of controlling it. Maybe there should be. It might not be too hard to add a sysfs interface for that sort of thing.

This is a neverending battle with ALSA and OSS modules claiming the same device, resulting in bizarre behavior. You could argue that it's user or vendor error but that doesn't change the flood of bug reports on alsa-user.

I am sure the ALSA developers would welcome a generic solution for this problem.

Lee

#17 lore raw
In reply to Pete Zaitcev
Quoted 4 lines · Pete Zaitcev

Is it that bad, really? Honestly, I could not imagine users can be so dumb. The option defaults to off. There is a warning in the Kconfig. And yet they first enable it and then complain about it. I don't know what to do about it, either.

Well, I presume you know this, but at least in 2.6.9, there's no warning. When I read it, it said:

CONFIG_BLK_DEV_UB:

This driver supports certain USB attached storage devices such as flash keys.

If unsure, say N.

which sounded potentially useful, and certainly didn't give the impression that the driver was likely to perform terribly in common cases (i.e. when using an external drive).

The sample Kconfig warnings I saw posted later in this thread would certainly have given enough information to know to avoid the driver, though if true, this might be even clearer:

Note: this driver does not coexist well with usb-storage, and usb-storage is is often the best driver for common devices like external drive enclosures. At the moment, usb-storage may peform dramatically better for those devices.

If you're not certain you need this driver, you should probably say 'N' here, and choose usb-storage instead.

Signature · 3 lines
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4
#18 lore raw
Quoted 11 lines · Rob Browning

The sample Kconfig warnings I saw posted later in this thread would certainly have given enough information to know to avoid the driver, though if true, this might be even clearer:

Note: this driver does not coexist well with usb-storage, and usb-storage is is often the best driver for common devices like external drive enclosures. At the moment, usb-storage may peform dramatically better for those devices.

If you're not certain you need this driver, you should probably say 'N' here, and choose usb-storage instead.

The other caveat which is worth adding is that currently, the UB device only supports a single LUN. Some devices, most notably USB readers that support multiple types of compact flash/secure digital/smart media/et.al., and the PalmOne T5 PDA export multiple LUN's.

(I was scratching my head for a while trying to figure out why the T5 documentation claimed that you could access both the internal flash memory as well as the Secure Digital external memory via the USB interface until I realized it was because I was using the UB driver, and it didn't support multiple LUN's.)

- Ted

#24 lore raw

RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

In reply to Greg KH
Quoted 8 lines · Greg KH
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

Quoted 7 lines

You don't want to use the scsi layer? You like the stability of it at times? :)

Quoted 2 lines

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

No, it's good for non-embedded boxes too.

My current understanding is:
- BLK_DEV_UB supports a subset of what USB_STORAGE can support
- for an average user, there's no reason to enable BLK_DEV_UB
- if you really know what you are doing, there might be several reasons why you might want to use BLK_DEV_UB

What about the patch below to let BLK_DEV_UB depend on USB_STORAGE=n?

If you really know what you are doing, you'll also know that you have to set USB_STORAGE=n before you can enable BLK_DEV_UB.

diffstat output:

 drivers/block/Kconfig              |    2 +-
 drivers/usb/storage/unusual_devs.h |    2 --
 drivers/usb/storage/usb.c          |    4 ----
 3 files changed, 1 insertion(+), 7 deletions(-)
drivers/block/Kconfig renamed from drivers/block/Kconfig.old +1 -1
@@ -303,7 +303,7 @@
 
 config BLK_DEV_UB
 	tristate "Low Performance USB Block driver"
-	depends on USB
+	depends on USB && USB_STORAGE=n
 	help
 	  This driver supports certain USB attached storage devices
 	  such as flash keys.
drivers/usb/storage/unusual_devs.h renamed from drivers/usb/storage/unusual_devs.h.old +0 -2
@@ -549,13 +549,11 @@
 		US_SC_SCSI, US_PR_CB, NULL,
 		US_FL_SINGLE_LUN ),
 
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 UNUSUAL_DEV(  0x0781, 0x0002, 0x0009, 0x0009, 
 		"Sandisk",
 		"ImageMate SDDR-31",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_IGNORE_SER ),
-#endif
 
 UNUSUAL_DEV(  0x0781, 0x0100, 0x0100, 0x0100,
 		"Sandisk",
drivers/usb/storage/usb.c renamed from drivers/usb/storage/usb.c.old +0 -4
@@ -144,9 +144,7 @@
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_BULK) },
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_BULK) },
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_BULK) },
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
-#endif
 
 	/* Terminating entry */
 	{ }
@@ -220,10 +218,8 @@
 	  .useTransport = US_PR_BULK},
 	{ .useProtocol = US_SC_8070,
 	  .useTransport = US_PR_BULK},
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 	{ .useProtocol = US_SC_SCSI,
 	  .useTransport = US_PR_BULK},
-#endif
 
 	/* Terminating entry */
 	{ NULL }
#25 lore raw

Re: RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

Quoted 15 lines · Adrian Bunk
Quoted 14 lines · Greg KH
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

You don't want to use the scsi layer? You like the stability of it at times? :)

Quoted 2 lines

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

Quoted 8 lines
Quoted 1 line

No, it's good for non-embedded boxes too.

My current understanding is:
- BLK_DEV_UB supports a subset of what USB_STORAGE can support
- for an average user, there's no reason to enable BLK_DEV_UB
- if you really know what you are doing, there might be several reasons why you might want to use BLK_DEV_UB

I have been running with just the code portion of this patch for a while now, with good results (no Kconfig changes.)

Pete and Matt, do you mind me applying the following portion of the patch to the kernel tree?

thanks,

greg k-h

Quoted 39 lines
drivers/usb/storage/unusual_devs.h renamed from drivers/usb/storage/unusual_devs.h.old +0 -2
@@ -549,13 +549,11 @@
 		US_SC_SCSI, US_PR_CB, NULL,
 		US_FL_SINGLE_LUN ),
 
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 UNUSUAL_DEV(  0x0781, 0x0002, 0x0009, 0x0009, 
 		"Sandisk",
 		"ImageMate SDDR-31",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_IGNORE_SER ),
-#endif
 
 UNUSUAL_DEV(  0x0781, 0x0100, 0x0100, 0x0100,
 		"Sandisk",
drivers/usb/storage/usb.c renamed from drivers/usb/storage/usb.c.old +0 -4
@@ -144,9 +144,7 @@
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_QIC, US_PR_BULK) },
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_UFI, US_PR_BULK) },
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_8070, US_PR_BULK) },
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 	{ USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, US_SC_SCSI, US_PR_BULK) },
-#endif
 
 	/* Terminating entry */
 	{ }
@@ -220,10 +218,8 @@
 	  .useTransport = US_PR_BULK},
 	{ .useProtocol = US_SC_8070,
 	  .useTransport = US_PR_BULK},
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 	{ .useProtocol = US_SC_SCSI,
 	  .useTransport = US_PR_BULK},
-#endif
 
 	/* Terminating entry */
 	{ NULL }
#26 lore raw

Re: RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

Quoted 25 lines · Greg KH
Quoted 15 lines · Adrian Bunk
Quoted 14 lines · Greg KH
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

You don't want to use the scsi layer? You like the stability of it at times? :)

Quoted 2 lines

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

Quoted 8 lines
Quoted 1 line

No, it's good for non-embedded boxes too.

My current understanding is:
- BLK_DEV_UB supports a subset of what USB_STORAGE can support
- for an average user, there's no reason to enable BLK_DEV_UB
- if you really know what you are doing, there might be several reasons why you might want to use BLK_DEV_UB

Quoted 5 lines

I have been running with just the code portion of this patch for a while now, with good results (no Kconfig changes.)

Pete and Matt, do you mind me applying the following portion of the patch to the kernel tree?

I have no objection.

Matt

Signature · 7 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

E:  You run this ship with Windows?!  YOU IDIOT!
L:  Give me a break, it came bundled with the computer!
					-- ESR and Lan Solaris
User Friendly, 12/8/1998
#27 lore raw

Re: RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

Quoted 26 lines · Matthew Dharm
Quoted 25 lines · Greg KH
Quoted 23 lines · Adrian Bunk
Quoted 8 lines · Greg KH
Quoted 6 lines · Adrian Bunk

I've already seen people crippling their usb-storage driver with enabling BLK_DEV_UB - and I doubt the warning in the help text added after 2.6.9 will fix all such problems.

Is there except for kernel size any good reason for using BLK_DEV_UB instead of USB_STORAGE?

Quoted 7 lines

You don't want to use the scsi layer? You like the stability of it at times? :)

Quoted 2 lines

If not, I'd suggest the patch below to let BLK_DEV_UB depend on EMBEDDED.

No, it's good for non-embedded boxes too.

My current understanding is:
- BLK_DEV_UB supports a subset of what USB_STORAGE can support
- for an average user, there's no reason to enable BLK_DEV_UB
- if you really know what you are doing, there might be several reasons why you might want to use BLK_DEV_UB

Quoted 7 lines
Quoted 5 lines

I have been running with just the code portion of this patch for a while now, with good results (no Kconfig changes.)

Pete and Matt, do you mind me applying the following portion of the patch to the kernel tree?

I have no objection.

Ok, I've commited the change to my trees, thanks.

greg k-h

#28 lore raw

Re: RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

In reply to Greg KH
Quoted 6 lines · Greg KH

I have been running with just the code portion of this patch for a while now, with good results (no Kconfig changes.)

Pete and Matt, do you mind me applying the following portion of the patch to the kernel tree?

Quoted 7 lines

drivers/usb/storage/unusual_devs.h line 558

Quoted 7 lines
drivers/usb/storage/unusual_devs.h renamed from drivers/usb/storage/unusual_devs.h.old +0 -2
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 UNUSUAL_DEV(  0x0781, 0x0002, 0x0009, 0x0009, 
 		"Sandisk",
 		"ImageMate SDDR-31",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_IGNORE_SER ),
-#endif

Urgh. Please do. Code which may compile differently in the kernel image according to which _modules_ are configured at the time is horrid, and should be avoided.

Signature · 1 line
dwmw2
#29 lore raw

Re: RFC: [2.6 patch] let BLK_DEV_UB depend on USB_STORAGE=n

Quoted 7 lines · David Woodhouse
Quoted 6 lines · Greg KH

I have been running with just the code portion of this patch for a while now, with good results (no Kconfig changes.)

Pete and Matt, do you mind me applying the following portion of the patch to the kernel tree?

Quoted 11 lines
Quoted 7 lines

drivers/usb/storage/unusual_devs.h line 558

Quoted 7 lines
drivers/usb/storage/unusual_devs.h renamed from drivers/usb/storage/unusual_devs.h.old +0 -2
-#if !defined(CONFIG_BLK_DEV_UB) && !defined(CONFIG_BLK_DEV_UB_MODULE)
 UNUSUAL_DEV(  0x0781, 0x0002, 0x0009, 0x0009, 
 		"Sandisk",
 		"ImageMate SDDR-31",
 		US_SC_DEVICE, US_PR_DEVICE, NULL,
 		US_FL_IGNORE_SER ),
-#endif

Urgh. Please do. Code which may compile differently in the kernel image according to which _modules_ are configured at the time is horrid, and should be avoided.

The fallacy of this "urgh" is easy to demonstrate when you consider usb-storage and ub the one and the same driver. Initially, ub was just a mode for usb-storage ("threadless"). I only factored them separate for reasons of clarity. Horrid, indeed. There's no reason to build one statically and another as a module.

Mind, I didn't disagree with the backout patch as such, but not because it was a good idea, but because it may help to shut up a few stupid users (provided that our scripts preserve the link order from drivers/usb/Makefile in modules.usbmap, or have other way to make sure that usb-storage entries are ahead of ub entires; did anyone actually check it? if those scripts sort by name, ub still pops ahead, and the backout is utterly ineffectual).

When we reintroduce ub in Fedora, I'll just put this patch right back, it's not a problem. But please think about this issue a little more, you might want to take the Urgh back.

-- Pete