[PATCH v3] usb: gadget: f_mass_storage: call try_to_freeze only when its safe

2013-11-07 Thread George Cherian
Call try_to_freeze() in sleep_thread() only when it's safe to sleep. do_read() and do_write() calls sleep_thread with lock held. Make sure these won't call try_to_freeze() by passing can_freeze flag to sleep_thread. Calling try_to_freeze() with a lock hold was done since day one in f_mass_storage

[PATCH v3] usb: gadget: f_mass_storage: call try_to_freeze only when its safe

2013-11-07 Thread George Cherian
Call try_to_freeze() in sleep_thread() only when it's safe to sleep. do_read() and do_write() calls sleep_thread with lock held. Make sure these won't call try_to_freeze() by passing can_freeze flag to sleep_thread. Calling try_to_freeze() with a lock hold was done since day one in f_mass_storage