On Tue, Sep 11, 2001 at 12:28:50AM +0200, Oliver Neukum wrote:
> Hi list,
> 
> here is a patch against pre-7 to prevent races with module unload.
> It adds a field 'module' to the usb_driver structure. Thus all applicable 
> drivers are touched. These are too numerous to contact all maintainers.
> 
> It does not work for storage and microtek as it would interfere with scsi 
> unregistering. It also does not work with serial, as it and possibly hid and 
> videodev, which I still have to look into, use submodules.

Why would it not work with those other modules?  They are all still usb
subsystem modules, and need to be there when their probe functions are
being called.  I don't see why it wouldn't work for them also.

What about devio.c?

> +static inline void* do_probe_driver(struct usb_driver* driver,struct 
> usb_device *dev,unsigned int ifnum,struct usb_device_id *id)
> +{

id needs to be "const struct usb_device *"

> @@ -717,9 +748,7 @@
>                               interface->act_altsetting = i;
>                               id = usb_match_id(dev, interface, id);
>                               if (id) {
> -                                     down(&driver->serialize);
> -                                     private = driver->probe(dev,ifnum,id);
> -                                     up(&driver->serialize);
> +                                     do_probe_driver(driver,dev,ifnum,id);
>                                       if (private != NULL)
>                                               break;
>                               }
> @@ -729,9 +758,7 @@
>                       if (private == NULL)
>                               interface->act_altsetting = 0;
>               } else { /* "old style" driver */
> -                     down(&driver->serialize);
> -                     private = driver->probe(dev, ifnum, NULL);
> -                     up(&driver->serialize);
> +                     do_probe_driver(driver,dev,ifnum,NULL);
>               }

private needs to be set to the return value of do_probe_driver otherwise
this will not work.  Have you tested this?


> @@ -1044,8 +1070,7 @@
>  {
>       api_wrapper_data *awd = (api_wrapper_data *)urb->context;
>  
> -     if (waitqueue_active(awd->wakeup))
> -             wake_up(awd->wakeup);
> +     wake_up(awd->wakeup);
>  #if 0
>       else
>               dbg("(blocking_completion): waitqueue empty!"); 

What does this do?  Isn't this and the kfree patch for other reasons?

> diff -u --recursive --new-file linuxvanilla/drivers/usb/usbkbd.c 
> linux/drivers/usb/usbkbd.c
> --- linuxvanilla/drivers/usb/usbkbd.c Mon Sep 10 23:39:45 2001
> +++ linux/drivers/usb/usbkbd.c        Tue Sep 11 00:09:30 2001
> @@ -275,6 +275,7 @@
>       probe:          usb_kbd_probe,
>       disconnect:     usb_kbd_disconnect,
>       id_table:       usb_kbd_id_table,
> +     module :        THIS_MODULE,

Come on, keep the style the same:
        module:         THIS_MODULE,

thanks,

greg k-h

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to