On 15-Nov-2002 Randy.Dunlap wrote:
> On Thu, 14 Nov 2002, Duncan Haldane wrote:
>|
>| any ideas?
> 
> Hi,
> 
> I think that the usb_bus_list_lock semaphore just isn't
> initialized yet.
> This can happen because we don't have much control over
> the order of initcalls in 2.4.  There is more control
> over them in 2.5.
> 
> So I think that the usb_cpia_init() is happening before usb_init().

Yes, I think you are right.
To test your idea, I moved the initialization

        init_MUTEX(&usb_bus_list_lock);

from usb_init() to just before the call to usb_scan_devices()
in usb_register() and the oops went away and cpia worked.


I see that in the working code prior to 2.4.13, usb_init() doesnt handle
any usb_bus_list_lock initialization.  Hmmm.

I believe that cpia_usb.c cannot be compiled into the kernel unless
usb is also compiled into the kernel.  Is there any way to move the 
initialization of cpia_usb to later in the boot sequence?

Or put some #ifndef module ... #endif code that moves the lock initialization
to before the call to usb_scan devices, and tests whether it is done
so it is only initialized the first time usb_register  is called?

Duncan





> One thing that we could do is have usb_register() return an
> error code in this case, but that probably wouldn't help in
> the long term.  If it were a module, the module could be
> reloaded, but in this case, it's built-into-kernel, so it
> would just be dead.
> 
> Another thing that we could do is try to do some init inside
> usb_register(), but that looks unsafe (racy).
> 
> Another thing that we might do is try to force (control) the
> init order.  This might be the best fix overall.
> 
> Other ideas out there?
> 
> -- 
> ~Randy

----------------------------------
E-Mail: Duncan Haldane <[EMAIL PROTECTED]>
Date: 15-Nov-2002
Time: 03:16:47

This message was sent by XFMail
----------------------------------


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to