Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55010c56 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: f_mass_storage: Perform async runtime suspend after ep disable"

parents ddfde557 1c682be3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2222,6 +2222,8 @@ static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg)
			fsg->bulk_out_enabled = 0;
		}

		/* allow usb LPM after eps are disabled */
		usb_gadget_autopm_put_async(common->gadget);
		common->fsg = NULL;
		wake_up(&common->fsg_wait);
	}
@@ -2286,6 +2288,10 @@ static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{
	struct fsg_dev *fsg = fsg_from_func(f);
	fsg->common->new_fsg = fsg;

	/* prevents usb LPM until thread runs to completion */
	usb_gadget_autopm_get_async(fsg->common->gadget);

	raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
	return USB_GADGET_DELAYED_STATUS;
}