Skip to content

Commit

Permalink
power/wakelock: Add a timeout to wakelocks globally
Browse files Browse the repository at this point in the history
Few wakelocks tends to get stuck for no reason. Blocking them
isn't necessary and sometimes blocking them breaks basic
functionality.
Wakelocks like "tx_swr_ctrl" tends to get stuck if we keep earphones
connected and drops battery massively.

Test: Keep earphones plugged in and leave device for few hours
Expected result: No "tx_swr_ctrl" is being stuck.
Actual result: Patch is working as expected.

Change-Id: I5296990a84ab44cf6e449d6535b8b99408c415c8
Signed-off-by: Panchajanya1999 <[email protected]>
Signed-off-by: Forenche <[email protected]>
  • Loading branch information
Panchajanya1999 authored and saikiran2001-v2 committed Apr 14, 2023
1 parent 76f5fde commit 1b2d503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/wakelock.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int pm_wake_lock(const char *buf)
do_div(timeout_ms, NSEC_PER_MSEC);
__pm_wakeup_event(wl->ws, timeout_ms);
} else {
__pm_stay_awake(wl->ws);
__pm_wakeup_event(wl->ws, 500);
}

wakelocks_lru_most_recent(wl);
Expand Down

0 comments on commit 1b2d503

Please sign in to comment.