msm_serial_hs: Fix race condition blocking suspend and remove wakeup source
The __pm_stay_awake/relax() calls were moved to runtime callbacks as a
means to fix data loss due to race conditions between incoming userspace
commands and executing PM related callbacks.
However calling the __pm_relax (to notify wakeup event processing)
as part of the runtime suspend callback could be race prone between
the system suspend and the runtime framework. If the system suspend
gets to run before the runtime callback, the wakeup event will block
system suspend.
Remove the use of the wakeup source altogether, instead do these:
1. Block system suspend based on the current clk request count and the
RPM state of the device (to detect potential inbound userspace
requests).
2. If the driver is in the process of executing the system suspend
callback, ignore any userspace requests.
3. If the client calls a shutdown without an unvote ioctl, zero out
the client_count vote forcefully to allow suspend.
CRs-Fixed: 977421
Change-Id: I17de85f29b555c1a4563dd59bec3ba3084c3604f
Signed-off-by:
Girish Mahadevan <girishm@codeaurora.org>
Loading
Please register or sign in to comment