On Thu, Jul 29, 2004 at 06:19:15PM +0200, Duncan Sands wrote: > Rather than taking the semaphore dev->serialize in the > top-level ioctl handler, usbdev_ioctl, push it down to the > individual ioctl routines. This is a Good Thing because > the ioctl routines do plenty of copy_to/from_user calls.
So? It's safe to hold a semaphore while copying data from or to userspace. I don't really see that this will fix much, becides make it harder to figure out where the lock is held :) > Patches 16/18 and 17/18 (proc_control and proc_bulk) also > release the semaphore while waiting for the urb to complete. > This fixes http://bugme.osdl.org/show_bug.cgi?id=3108. Hm, I don't see how this fixes anything. If we hold the semaphore, the urb will complete eventually, and then the semaphore will be released, and any one blocking on it will wake up, right? > You may well wonder why I copied some of the usb_start_wait_urb > infrastructure from messages.c. Good question! There are two > reasons that I recall. The first is that if you use usb_start_wait_urb, > then you are obliged to drop the semaphore before calling it. Why? > But the device might get disconnected, or the configuration may > change, between your dropping the semaphore and the actual > urb submission in usb_start_wait_urb. That's probably not the > end of the world, but I'd rather avoid those kinds of hassles. > Another reason is that I'd like to see if I can make the waiting > interruptible. Having the waiting logic in devio.c means (hopefully) > that I can muck around with it without borking the rest of the USB > subsystem. Why do you want to make the waiting interruptible? What will that help with? thanks, greg k-h ------------------------------------------------------- This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel