> From: "Randy.Dunlap" <[EMAIL PROTECTED]>
> Date: Fri, 15 Nov 2002 08:40:36 -0800 (PST)

> | > 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?

> Yes, I agree.  I had a patch last night that moved the semaphore
> init, but then I realized that it was a bad idea.
> As Oliver says, the right patch is something like this in init/main.c:
> 
> #ifdef CONFIG_USB
>       extern usb_init(void);
>       usb_init();
> #endif
> 
> and in drivers/usb/usb.c:
> 
> #ifdef MODULE
> module_init(usb_init);
> #endif
> 
> This is the way it used to be many many moons ago.

VERY many moons ago. Today, the same effect is accomplished by
module_init() without #ifdef bracket. If the module is compiled
into the kernel, do_initcalls does the call there.

To make cpia initialize later than the USB, the proper configuration
must be used, which prohibits CPIA being 'y' and USB core 'm'.
It can be done without "if", by using dep_tristate as appropriate.
Also, the order in which cpia and usbcore are listed in the Makefile
is significant, it determines the order in which do_initcalls
calls them in case of them being 'y'.

-- Pete


-------------------------------------------------------
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