On Sat, 2004-09-18 at 09:10, Alan Stern wrote: 
> At any rate, this oops occurs whenever a USB host controller driver is
> unloaded while one of the devices it controls is still open.  Your drive
> was still open because it was mounted, and when the shutdown scripts 
> unmounted it the oops was triggered.

Correct me if I'm wrong: If one of the controlled devices is still open,
shouldn't the reference count on the modules involved (including the
appropriate hcd) be incremented to prevent rmmod ? I don't mean to say
that as soon as I connect the drive it should be impossible to rmmod
ehci_hcd.  Rather, when I mount a partition, it should become impossible
to rmmod ehci_hcd (or uhci_hcd, or whichever host controller the drive
happens to be going through at the time) and all other modules involved
in the access to the file system (such as sd_mod), because they are now
part of the pipeline towards the drive. Is this the "known bug" ?

I don't know the ramifications of incrementing the reference count on
the appropriate modules when mounting a partition from its controlled
USB drive, which is why I also submitted a bug report with the
distribution I'm using (http://bugs.gentoo.org/show_bug.cgi?id=64562),
pointing to the fact that their "hotplug" rc service causes ehci_hcd
(and pretty much all USB-related stuff) to be rmmod-ed upon shutdown,
regardless of whether they are still in use or not.

I don't know which is more difficult - adding a "check" to the hotplug
scripts to determine whether any of the mounted file systems are
usb-storage file systems, or making it impossible for the pipeline to
the USB drive to be broken, by incrementing reference counts on all the
modules involved in the pipeline.

Of course, another solution would be to simply compile all mistakenly
rmmod-ed modules into the kernel - but that's a workaround at best.

Thanks a lot for your help.  It is merely curiosity that drives me to
ask further questions.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to