On Tuesday 31 July 2012 11:49:29 Alan Stern wrote: > On Tue, 31 Jul 2012, Bjørn Mork wrote: > > > Well, you are then saying that usb-storage has priority over any other > > function and that is often wrong IMHO. > > No, I'm not saying that at all. The situation is perfectly symmetric. Well, the capabilities are not. Most drivers are less well able to handle a reset than the storage driver is. > Another alternative is for the other drivers to delay the reset (by > sleeping in their pre_reset callbacks) until they can handle the reset > safely. No! You must not ever do that! The reset is a part of the error handling path of the block layer. Therefore it must not sleep indefinitely. In particular you must never wait for anything user space does or for any part of the kernel that allocates memory with GFP_KERNEL or GFP_NOFS, and you must allocate memory only with GFP_NOIO. The penalty is deadlock. > The kernel doesn't know which functions the user is interested in. It > has no basis for saying "The user doesn't care about the mass-storage > function so don't let usb-storage issue any device resets". Yes. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html