mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
usb: gadget: f_mass_storage: Disable eps during disconnect
When receiving a disconnect event from the UDC, the mass storage function driver currently runs the handle_exception() routine asynchronously. For UDCs that support runtime PM, there is a possibility the UDC is already suspended by the time the do_set_interface() is executed. This can lead to HW register access while the UDC is already suspended. Change-Id: Ie1374cb7c895bd9d5c0129dd18886980dba71712 Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Link: https://lore.kernel.org/r/1635365407-31337-3-git-send-email-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Git-commit: 9fff139aeb11186fd8e75860c959c86cb43ab2f6 Git-Repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by: Rohith Kollalsi <quic_rkollals@quicinc.com>
This commit is contained in:
parent
da325a8c58
commit
e326bb5942
1 changed files with 10 additions and 0 deletions
|
|
@ -2301,6 +2301,16 @@ static void fsg_disable(struct usb_function *f)
|
|||
{
|
||||
struct fsg_dev *fsg = fsg_from_func(f);
|
||||
|
||||
/* Disable the endpoints */
|
||||
if (fsg->bulk_in_enabled) {
|
||||
usb_ep_disable(fsg->bulk_in);
|
||||
fsg->bulk_in_enabled = 0;
|
||||
}
|
||||
if (fsg->bulk_out_enabled) {
|
||||
usb_ep_disable(fsg->bulk_out);
|
||||
fsg->bulk_out_enabled = 0;
|
||||
}
|
||||
|
||||
__raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue