Skip to content

Commit 9f555a0

Browse files
simontrimmerLucas Tanure
authored andcommitted
mfd: clsic: add a completion timeout and warning to pm_resume
Change-Id: Ibdaf4a3d42895a8c70e5fe1d7b81155bf1063596 Signed-off-by: Simon Trimmer <[email protected]>
1 parent d17b53a commit 9f555a0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/mfd/clsic/clsic-core.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,12 @@ static int clsic_pm_service_transition(struct clsic *clsic, int pm_event)
953953
#define CLSIC_BOOT_PROGRESS_POLL_MICROSECONDS 5000
954954
#define CLSIC_BOOT_PROGRESS_TIMEOUT_MICROSECONDS 2000000
955955

956+
/*
957+
* Setting the timeout for the enumeration or firmware download to be 100
958+
* seconds (the bootloader message timeout is 90 seconds)
959+
*/
960+
#define CLSIC_PM_COMPLETION_TIMEOUT (HZ * 100)
961+
956962
static int clsic_runtime_resume(struct device *dev)
957963
{
958964
struct clsic *clsic = dev_get_drvdata(dev);
@@ -1024,7 +1030,11 @@ static int clsic_runtime_resume(struct device *dev)
10241030
* Wait for the system to have fully initialised, including any
10251031
* firmware download and enumeration activity
10261032
*/
1027-
wait_for_completion(&clsic->pm_completion);
1033+
if (wait_for_completion_timeout(&clsic->pm_completion,
1034+
CLSIC_PM_COMPLETION_TIMEOUT) == 0) {
1035+
clsic_err(clsic, "Completion timeout\n");
1036+
return -ETIMEDOUT;
1037+
}
10281038

10291039
trace_clsic_pm(RPM_ACTIVE);
10301040

0 commit comments

Comments
 (0)