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

Commit 4c47ad5f authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru
Browse files

usb: gsi: Allow suspend upon previous suspend failure in gsi_suspend



Driver marks func_is_suspended flag to true and queue suspend work in
gsi_suspend. suspend_work may fail the suspend if the LINK is not in U3.

During host hibernation testing gsi_suspend failing as LINK is not in U3
and next time when bus suspend initiated driver checking for
func_is_suspended flag and bailout the suspend with out queuing suspend
work. This causes a mismatch of usage count and usb not entering to
low power mode.

To fix this issue, Check for the state in gsi_suspend. If the state is
!= suspended or != suspend_in_progress then don't bail out the suspend.

Change-Id: Iade9ba330b232261e205cd821ef42053297befbb
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent df696d5e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2480,8 +2480,12 @@ static void gsi_suspend(struct usb_function *f)
	bool block_db;
	struct f_gsi *gsi = func_to_gsi(f);

	/* Check if function is already suspended in gsi_func_suspend() */
	if (f->func_is_suspended) {
	/* Check if function is already suspended in gsi_func_suspend()
	 * Or func_suspend would have bailed out earlier if func_remote_wakeup
	 * wasn't enabled.
	 */
	if (f->func_is_suspended && (gsi->d_port.sm_state == STATE_SUSPENDED ||
			gsi->d_port.sm_state == STATE_SUSPEND_IN_PROGRESS)) {
		log_event_dbg("%s: func already suspended, return\n", __func__);
		return;
	}