usb: gadget: f_mass_storage: call try_to_freeze only when its safe
authorGeorge Cherian <george.cherian@ti.com>
Fri, 8 Nov 2013 05:20:52 +0000 (10:50 +0530)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 15 May 2014 05:26:55 +0000 (07:26 +0200)
commitc75083226e8fd9f248836c0e9f2c9015edc60440
treeab8be34a3a80f03411ca9fdfad76d441ae2f7bc3
parent4a57b0fa9f20b194c9f303036dda100f4a721bf5
usb: gadget: f_mass_storage: call try_to_freeze only when its safe

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 but since commit 0f9548ca1 ("lockdep: check that no
locks held at freeze time") lockdep complains about it.

Signed-off-by: George Cherian <george.cherian@ti.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_mass_storage.c