On Mon, 27 Jul 2009, ravindu kher wrote: > Hello all, > > While going through the code of mass storage driver, I found that the > device pointer, "pusb_dev" beeing protected by "dev_mutex". > I have also found that the "pusb_dev" will be used in the following functions. > > 1) usb_fill_bulk_urb > 2) usb_buffer_alloc > 3) usb_buffer_free > 4) usb_sg_init > 5) usb_submit_urb > > My question is, instead of locking the "dev_mutex" for entire process > of submitting command, Can I lock and unlock the "dev_mutex" in the > functions(listed above) where I am using it. No. dev_mutex does other things in addition to protecting pusb_dev. Furthermore, you can't change those routines just to suit your needs. They are used by many other drivers; if you change them then the other drivers won't work. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html