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

Commit ac82634f authored by Pratham Pratap's avatar Pratham Pratap Committed by Gerrit - the friendly Code Review server
Browse files

usb: gadget: f_mass_storage: Remove runtime async resume



Currently the f_mass_storage function driver is calling
usb_gadget_autopm_get_async() in set_alt which increments
dwc3 power usage count which can prevent the controller to
transition into LPM during cable disconnect or composition
switch. Fix this removing the get_async/put_async from
function driver and let gadget driver take care of this.

Change-Id: I6dfb4ae1e4a9366ef56ebf40ea517f98b20250ee
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent ef94cac2
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -2229,8 +2229,6 @@ static int do_set_interface(struct fsg_common *common, struct fsg_dev *new_fsg)
			fsg->bulk_out_enabled = 0;
			fsg->bulk_out_enabled = 0;
		}
		}


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


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

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