summary refs log tree commit diff
path: root/fs/gfs2/sys.h
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2018-08-08 11:20:39 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-08-29 09:59:47 +0300
commitdec3c23c9aa1815f07d98ae0375b4cbc10971e13 (patch)
tree86f2f6e642ba94b8ce6adc95fac1a7b63070b474 /fs/gfs2/sys.h
parent66174b6998a645c39867c3a301b4ee4611d6ca5b (diff)
downloadlinux-dec3c23c9aa1815f07d98ae0375b4cbc10971e13.tar.gz
USB: net2280: Fix erroneous synchronization change
Commit f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking
for callbacks") was based on a serious misunderstanding.  It
introduced regressions into both the dummy-hcd and net2280 drivers.

The problem in dummy-hcd was fixed by commit 7dbd8f4cabd9 ("USB:
dummy-hcd: Fix erroneous synchronization change"), but the problem in
net2280 remains.  Namely: the ->disconnect(), ->suspend(), ->resume(),
and ->reset() callbacks must be invoked without the private lock held;
otherwise a deadlock will occur when the callback routine tries to
interact with the UDC driver.

This patch largely is a reversion of the relevant parts of
f16443a034c7.  It also drops the private lock around the calls to
->suspend() and ->resume() (something the earlier patch forgot to do).
This is safe from races with device interrupts because it occurs
within the interrupt handler.

Finally, the patch changes where the ->disconnect() callback is
invoked when net2280_pullup() turns the pullup off.  Rather than
making the callback from within stop_activity() at a time when dropping
the private lock could be unsafe, the callback is moved to a point
after the lock has already been dropped.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Fixes: f16443a034c7 ("USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks")
Reported-by: D. Ziesche <dziesche@zes.com>
Tested-by: D. Ziesche <dziesche@zes.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'fs/gfs2/sys.h')
0 files changed, 0 insertions, 0 deletions