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

Commit c004eb5f authored by Ajay Agarwal's avatar Ajay Agarwal Committed by Razziell
Browse files

usb: dwc3-msm: Relax PM wakelock if PM resume from B_SUSPEND state



The driver holds PM wakelock if PM resume is called. If the
device was in B_SUSPEND(peripheral mode bus suspend) when
suspended earlier, then we will not be releasing the wakelock
from sm_work. Do so in order to allow system suspend to happen
again.

Change-Id: I07396a9ea89b2cdc7683d818c589d2e29bcddfe0
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 5fe0b556
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -4144,6 +4144,12 @@ static void dwc3_msm_otg_sm_work(struct work_struct *w)
			pm_runtime_get_sync(mdwc->dev);
			pm_runtime_get_sync(mdwc->dev);
			dbg_event(0xFF, "SUSP gsync",
			dbg_event(0xFF, "SUSP gsync",
				atomic_read(&mdwc->dev->power.usage_count));
				atomic_read(&mdwc->dev->power.usage_count));
		} else {
			/*
			 * Release PM Wakelock if PM resume had happened from
			 * peripheral mode bus suspend case.
			 */
			pm_relax(mdwc->dev);
		}
		}
		break;
		break;