mhi: core: Track number of failed M2 wakeups

Failed M2 wakeups may represent a serious hardware problem.
The device is refusing to wake up from low power states and all
modem functionality is now stalled.

Track these wakeup attempts.

Change-Id: I3115a4416f85290c5faead0e2d9f280d8cc3b662
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
This commit is contained in:
Tony Truong 2015-11-06 15:05:07 -08:00 committed by David Keitel
parent 2d40f51ad5
commit c9ccb15704
2 changed files with 3 additions and 1 deletions

View file

@ -385,6 +385,7 @@ struct mhi_counters {
u32 mhi_ready_cntr;
u32 m3_event_timeouts;
u32 m0_event_timeouts;
u32 m2_event_timeouts;
u32 msi_disable_cntr;
u32 msi_enable_cntr;
u32 nr_irq_migrations;

View file

@ -914,8 +914,9 @@ int mhi_initiate_m3(struct mhi_device_ctxt *mhi_dev_ctxt)
mhi_dev_ctxt->mhi_state == MHI_STATE_M1,
msecs_to_jiffies(MHI_MAX_RESUME_TIMEOUT));
if (0 == r || -ERESTARTSYS == r) {
mhi_log(MHI_MSG_INFO,
mhi_log(MHI_MSG_CRITICAL,
"MDM failed to come out of M2.\n");
mhi_dev_ctxt->counters.m2_event_timeouts++;
r = -EAGAIN;
goto exit;
}