On Wed, 7 Oct 2009, Alan Cox wrote: > > > It would probably be cleaner if they could lock against each other > > > > What you mean isn't clear. After all, open sometimes has to call > > resume. So how could resume lock against open? > > Probably it needs a counting lock as the code is currently structured - > which is a bit ugly. What paths do we end up going through the device > open method into resume in the same thread ? Currently there are no such paths. I keep forgetting that the resume is done in serial_install() rather than serial_open(). Eventually the tty_port reorganization will probably force the resume to move into the activate method. However in the option and sierra drivers there is a perverse path from close to resume: Both their close methods call usb_autopm_get_interface(). This could be removed without much trouble; perhaps we should do so. Alan Stern -- 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